VM Maker: VMMaker.oscog-eem.2206.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.2206.mcz

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

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

Name: VMMaker.oscog-eem.2206
Author: eem
Time: 4 May 2017, 11:54:12.797765 am
UUID: 057f2258-7a2e-45e2-a425-7329bb4306ce
Ancestors: VMMaker.oscog-eem.2205

Fix the ARM regression introduced in VMMaker.oscog-eem.2160.  On ARM the link register must be saved and restored around the call to the ceNewHash trampoline in the identityHash primitive.

Add a convenience to test loading of the B3DAcceleratorPlugin.

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

Item was added:
+ ----- Method: B3DAcceleratorPlugin class>>testLoadPlugin (in category 'testing') -----
+ testLoadPlugin
+ "B3DAcceleratorPlugin testLoadPlugin"
+ <primitive: 'primitiveRendererVersion' module: 'B3DAcceleratorPlugin' error: ec>
+ self primitiveFailed!

Item was changed:
  ----- Method: CogARMCompiler>>genDivR:R:Quo:Rem: (in category 'abstract instructions') -----
  genDivR: abstractRegDivisor R: abstractRegDividend Quo: abstractRegQuotient Rem: abstractRegRemainder
  "Currently no instruction level support for divide on ARM. See also #canDivQuoRem"
  | rDividend rDivisor rQuotient rRemainder divRemFunctionAddr |
  <var: #divRemFunctionAddr type: #usqInt>
  self assert: abstractRegDividend ~= abstractRegDivisor.
  self assert: abstractRegQuotient ~= abstractRegRemainder.
  rDividend := abstractRegDividend.
  rDivisor := abstractRegDivisor.
  rDividend = CArg0Reg ifFalse:
  ["we need to move the value in rDividend to CArg0Reg. Best to double check if rDivisor is already using it first"
  rDivisor = CArg0Reg ifTrue: "oh dear; we also need to move rDivisor's value out of the way first.. I'll move it to CArg1Reg and if some nitwit has managed to put rDividend there they deserve the crash"
  [rDividend = CArg1Reg ifTrue:
  [self error: 'register choices in genDivR:R:Quo:Rem: made life impossible'].
  cogit MoveR: rDivisor R: CArg1Reg.
  "and update rDivisor or we get buggerd by the next clause"
  rDivisor := CArg1Reg].
  cogit MoveR: rDividend R: CArg0Reg].
  rDivisor = CArg1Reg ifFalse:
  [cogit MoveR: rDivisor R: CArg1Reg].
  divRemFunctionAddr := self aeabiDivModFunctionAddr.
+ self saveAndRestoreLinkRegAround:
- cogit backEnd saveAndRestoreLinkRegAround:
  [cogit CallFullRT: (self cCode: [divRemFunctionAddr asUnsignedInteger]
    inSmalltalk: [cogit simulatedTrampolineFor: divRemFunctionAddr])
  registersToBeSavedMask: (cogit registerMaskFor: CArg2Reg and: CArg3Reg)].
  "Now we need to move the r0/1 results back to rQuotient & rRemainder"
  rQuotient := abstractRegQuotient.
  rRemainder := abstractRegRemainder.
  rQuotient = CArg0Reg ifFalse: "oh good grief, not again"
  [cogit MoveR: CArg0Reg R: rQuotient.
  rQuotient = CArg1Reg ifTrue:
  [self error: 'register choices in genDivR:R:Quo:Rem: made life impossible'] ].
  rRemainder = CArg1Reg  ifFalse:
  [cogit MoveR: CArg1Reg R: rRemainder]
 
  !

Item was changed:
  ----- Method: CogObjectRepresentationFor32BitSpur>>genPrimitiveIdentityHash (in category 'primitive generators') -----
  genPrimitiveIdentityHash
  "Arguably we should fail for immediates, but so far no one has complained, so..."
  | jumpImm jumpSI jumpNotSet ret |
  <var: #jumpSI type: #'AbstractInstruction *'>
  <var: #jumpImm type: #'AbstractInstruction *'>
  <var: #jumpNotSet type: #'AbstractInstruction *'>
  jumpImm := self genJumpImmediate: ReceiverResultReg.
  self genGetHashFieldNonImmOf: ReceiverResultReg asSmallIntegerInto: TempReg.
  cogit CmpCq: ConstZero R: TempReg.
  jumpNotSet := cogit JumpZero: 0.
  cogit MoveR: TempReg R: ReceiverResultReg.
  ret := cogit genPrimReturn.
  jumpImm jmpTarget: cogit Label.
  jumpSI := self genJumpSmallInteger: ReceiverResultReg.
  jumpSI jmpTarget: ret.
  self genConvertCharacterToSmallIntegerInReg: ReceiverResultReg.
  cogit Jump: ret.
  jumpNotSet jmpTarget: cogit Label.
  "For non-behaviors we can call ceNewHash to assign a fresh hash.
  For behaviors we must fail into the interpreter primitive to enter the receiver into the class table."
  cogit getPrimitiveIndex = 75 ifFalse:
  [^0].
+ cogit backEnd saveAndRestoreLinkRegAround:
+ [cogit CallRT: ceNewHashTrampoline].
+ cogit genPrimReturn.
- cogit
- CallRT: ceNewHashTrampoline;
- genPrimReturn.
  ^UnfailingPrimitive!

Item was changed:
  ----- Method: CogObjectRepresentationFor64BitSpur>>genPrimitiveIdentityHash (in category 'primitive generators') -----
  genPrimitiveIdentityHash
  "Arguably we should fail for immediates, but so far no one has complained, so..."
  | jumpImm jumpNotSet jumpNotCharacter ret |
  <var: #jumpImm type: #'AbstractInstruction *'>
  <var: #jumpNotSet type: #'AbstractInstruction *'>
  <var: #jumpNotCharacter type: #'AbstractInstruction *'>
  jumpImm := self genJumpImmediate: ReceiverResultReg. "uses TstCqR"
  self genGetHashFieldNonImmOf: ReceiverResultReg asSmallIntegerInto: TempReg.
  cogit CmpCq: ConstZero R: TempReg.
  jumpNotSet := cogit JumpZero: 0.
  cogit MoveR: TempReg R: ReceiverResultReg.
  ret := cogit genPrimReturn.
  jumpImm jmpTarget: (cogit AndCq: objectMemory tagMask R: ReceiverResultReg R: TempReg).
  cogit CmpCq: objectMemory characterTag R: TempReg.
  jumpNotCharacter := cogit JumpNonZero: 0.
  self genConvertCharacterToSmallIntegerInReg: ReceiverResultReg.
  ret := cogit genPrimReturn.
  jumpNotCharacter jmpTarget: (cogit CmpCq: objectMemory smallFloatTag R: TempReg).
  cogit JumpNonZero: ret.
  self genConvertSmallFloatToSmallFloatHashAsIntegerInReg: ReceiverResultReg scratch: TempReg.
  cogit genPrimReturn.
  jumpNotSet jmpTarget: cogit Label.
  "For non-behaviors we can call ceNewHash to assign a fresh hash.
  For behaviors we must fail into the interpreter primitive to enter the receiver into the class table."
  cogit getPrimitiveIndex = 75 ifFalse:
  [^0].
+ cogit backEnd saveAndRestoreLinkRegAround:
+ [cogit CallRT: ceNewHashTrampoline].
+ cogit genPrimReturn.
- cogit
- CallRT: ceNewHashTrampoline;
- genPrimReturn.
  ^UnfailingPrimitive!