VM Maker: VMMaker.oscog-eem.2651.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2651.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2651.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2651
Author: eem
Time: 8 January 2020, 7:52:21.345726 pm
UUID: ffd7613e-36d3-4c9c-bf23-524af81cd1e9
Ancestors: VMMaker.oscog-eem.2650

Cogit:
Fix old bug in ARM32 LoadEffectiveAddressMwrR
Improve the ARM32 trampoline marshalling code fractionally.

=============== Diff against VMMaker.oscog-eem.2650 ===============

Item was changed:
  ----- Method: CogARMCompiler>>concretizeLoadEffectiveAddressMwrR (in category 'generate machine code - concretize') -----
  concretizeLoadEffectiveAddressMwrR
  "Will get inlined into concretizeAt: switch."
+ "destReg = srcReg + offset, but does not need to set condition codes, etc"
- "destReg = srcReg (which contains an address) + offset"
  <inline: true>
  | srcReg offset destReg instrOffset |
  offset := operands at: 0.
  srcReg := operands at: 1.
  destReg := operands at: 2.
  ^self rotateable8bitImmediate: offset
  ifTrue:
  [ :rot :immediate |
  self machineCodeAt: 0
  "add destReg, srcReg, #immediate ROR rot"
+ put: (self add: destReg rn: srcReg imm: immediate ror: rot).
- put: (self add: destReg rn: srcReg imm: immediate ror: rot<<1).
  4]
  ifFalse:
  [instrOffset := self moveCw: offset intoR: ConcreteIPReg.
  "add destReg, srcReg, ConcreteIPReg"
  self machineCodeAt: 16 put: (self add: destReg rn: srcReg rm: ConcreteIPReg).
+ instrOffset + 4]
+
+ "cogit processor disassembleInstructionAt: 0 In: machineCode object"!
- instrOffset + 4]!

Item was changed:
  ----- Method: CogARMCompiler>>genMarshallNArgs:arg:arg:arg:arg: (in category 'abi') -----
  genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3
  "Generate the code to pass up to four arguments in a C run-time call.  Hack: each argument is
  either a negative number, which encodes a constant, or a non-negative number, that of a register.
 
  Run-time calls have no more than four arguments, so chosen so that on ARM, where in its C ABI the
  first four integer arguments are passed in registers, all arguments can be passed in registers.  We
  defer to the back end to generate this code not so much that the back end knows whether it uses
  the stack or registers to pass arguments (it does, but...). In fact we defer for an extremely evil reason.
  Doing so allows the x64 (where up to 6 args are passed) to assign the register arguments in an order
  that allows some of the argument registers to be used for specific abstract registers, specifically
  ReceiverResultReg and ClassReg.  This is evil, evil, evil, but also it's really nice to keep using the old
  register assignments the original author has grown accustomed to."
  <inline: true>
  numArgs = 0 ifTrue: [^self].
  "Avoid arg regs being overwritten before they are read."
  numArgs > 1 ifTrue:
  [((cogit isTrampolineArgConstant: regOrConst1) not
    and: [regOrConst1 = CArg0Reg]) ifTrue:
  [cogit MoveR: regOrConst1 R: Extra0Reg.
  ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: Extra0Reg arg: regOrConst2 arg: regOrConst3].
  numArgs > 2 ifTrue:
  [((cogit isTrampolineArgConstant: regOrConst2) not
    and: [regOrConst2 = CArg0Reg or: [regOrConst2 = CArg1Reg]]) ifTrue:
  [cogit MoveR: regOrConst2 R: Extra1Reg.
  ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: Extra1Reg arg: regOrConst3].
  numArgs > 3 ifTrue:
  [((cogit isTrampolineArgConstant: regOrConst3) not
    and: [regOrConst3 = CArg0Reg or: [regOrConst3 = CArg1Reg or: [regOrConst3 = CArg2Reg]]]) ifTrue:
  [cogit MoveR: regOrConst3 R: Extra2Reg.
  ^self genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: Extra2Reg]]]].
  (cogit isTrampolineArgConstant: regOrConst0)
  ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst0) R: CArg0Reg]
+ ifFalse: [regOrConst0 ~= CArg0Reg ifTrue: [cogit MoveR: regOrConst0 R: CArg0Reg]].
- ifFalse: [cogit MoveR: regOrConst0 R: CArg0Reg].
  numArgs = 1 ifTrue: [^self].
  (cogit isTrampolineArgConstant: regOrConst1)
  ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst1) R: CArg1Reg]
+ ifFalse: [regOrConst1 ~= CArg1Reg ifTrue: [cogit MoveR: regOrConst1 R: CArg1Reg]].
- ifFalse: [cogit MoveR: regOrConst1 R: CArg1Reg].
  numArgs = 2 ifTrue: [^self].
  (cogit isTrampolineArgConstant: regOrConst2)
  ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst2) R: CArg2Reg]
+ ifFalse: [regOrConst2 ~= CArg2Reg ifTrue: [cogit MoveR: regOrConst2 R: CArg2Reg]].
- ifFalse: [cogit MoveR: regOrConst2 R: CArg2Reg].
  numArgs = 3 ifTrue: [^self].
  (cogit isTrampolineArgConstant: regOrConst3)
  ifTrue: [cogit MoveCq: (cogit trampolineArgValue: regOrConst3) R: CArg3Reg]
+ ifFalse: [regOrConst3 ~= CArg3Reg ifTrue: [cogit MoveR: regOrConst3 R: CArg3Reg]]!
- ifFalse: [cogit MoveR: regOrConst3 R: CArg3Reg]!