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

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

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

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

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

Name: VMMaker.oscog-eem.2165
Author: eem
Time: 18 March 2017, 10:00:02.579299 pm
UUID: 2fa022b2-1323-47d7-b2cd-66682edbaf80
Ancestors: VMMaker.oscog-eem.2164

Cogit:
Fix the regression introduced in VMMaker.oscog-eem.2161 & VMMaker.oscog-eem.2160 when reintroducing the ceNewHash: trampoline.  ceNewhash: must /not/ be called from Behavior's identityHash (175) only from ProtoObject's (75).

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

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 primitiveIndex = 75 ifFalse:
+ [^0].
  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 primitiveIndex = 75 ifFalse:
+ [^0].
  cogit
  CallRT: ceNewHashTrampoline;
  genPrimReturn.
  ^UnfailingPrimitive!

Item was added:
+ ----- Method: Cogit>>getPrimitiveIndex (in category 'accessing') -----
+ getPrimitiveIndex
+ "Access for the object representation primitive generation routines."
+ ^primitiveIndex!

Loading...