[Vm-dev] VM Maker: VMMaker.oscog-cb.1203.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Apr 16 22:12:42 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1203.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1203
Author: cb
Time: 16 April 2015, 3:10:57.814 pm
UUID: 915d00b2-7c03-4dfc-bcfc-00afe5c86fb6
Ancestors: VMMaker.oscog-eem.1202
added types for arrays used in machine code generation.
=============== Diff against VMMaker.oscog-eem.1202 ===============
Item was changed:
----- Method: CogObjectRepresentationForSpur>>mixed:branchIf:notInstanceOfBehaviors:target: (in category 'sista support') -----
mixed: numNonImmediates branchIf: reg notInstanceOfBehaviors: arrayObj target: targetFixUp
| jmpImmediate jumps label numCases classObj index |
+ <var: #jumps type: #'AbstractInstruction **'>
numCases := objectMemory numSlotsOf: arrayObj.
cogit MoveR: reg R: TempReg.
jmpImmediate := self genJumpImmediateInScratchReg: TempReg.
"Rcvr is non immediate"
jumps := self alloca: numNonImmediates type: (self cCode: [#'AbstractInstruction *'] inSmalltalk: [cogit backEnd class])..
self genGetClassIndexOfNonImm: reg into: TempReg.
index := 0.
0 to: numCases - 1 do:
[:i|
classObj := objectMemory fetchPointer: i ofObject: arrayObj.
(objectMemory isImmediateClass: classObj) ifFalse: [
self genCmpClassIndex: (objectMemory classTagForClass: classObj) R: TempReg.
jumps at: index put: (cogit JumpZero: 0).
index := index + 1 ] ].
cogit Jump: targetFixUp.
"Rcvr is immediate"
jmpImmediate jmpTarget: cogit Label.
numCases - numNonImmediates "num Immediates allowed"
caseOf:
{[ 1 ] -> [ "1 immediate allowed. jump to targetFixUp if the rcvr is not this immediate"
0 to: numCases - 1 do:
[ :j |
classObj := objectMemory fetchPointer: j ofObject: arrayObj.
(objectMemory isImmediateClass: classObj) ifTrue: [
self branchIf: reg hasNotImmediateTag: (objectMemory classTagForClass: classObj) target: targetFixUp ] ] ] .
[ 2 ] -> [ "2 immediates allowed. On 32 bits nothing to do, all immediate are allowed, on 64 bits generates the jump to fixup for the third tag"
self branch2CasesIf: reg notInstanceOfBehaviors: arrayObj target: targetFixUp ] .
[ 3 ] -> [ "nothing to do, all immediates are allowed." ] }.
label := self Label.
0 to: numNonImmediates - 1 do: [:i |
(jumps at: i) jmpTarget: label ].
^ 0
!
Item was changed:
----- Method: CogObjectRepresentationForSpur>>noneImmediateBranchIf:notInstanceOfBehaviors:target: (in category 'sista support') -----
noneImmediateBranchIf: reg notInstanceOfBehaviors: arrayObj target: targetFixUp
"All classes in arrayObj are not immediate"
- <inline: true>
| label numJumps jumps classObj |
+ <inline: true>
+ <var: #jumps type: #'AbstractInstruction **'>
cogit MoveR: reg R: TempReg.
jumps := self alloca: (objectMemory numSlotsOf: arrayObj) type: (self cCode: [#'AbstractInstruction *'] inSmalltalk: [cogit backEnd class])..
(self genJumpImmediateInScratchReg: TempReg) jmpTarget: targetFixUp.
self genGetClassIndexOfNonImm: reg into: TempReg.
0 to: (numJumps := objectMemory numSlotsOf: arrayObj) - 1 do:
[:i|
classObj := objectMemory fetchPointer: i ofObject: arrayObj.
self genCmpClassIndex: (objectMemory classTagForClass: classObj) R: TempReg.
jumps at: i put: (cogit JumpZero: 0) ].
cogit Jump: targetFixUp.
label := self Label.
0 to: numJumps do: [:i |
(jumps at: i) jmpTarget: label ].
!
More information about the Vm-dev
mailing list