[Vm-dev] VM Maker: Cog-eem.167.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 9 00:20:16 UTC 2014


Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.167.mcz

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

Name: Cog-eem.167
Author: eem
Time: 8 July 2014, 5:20:02.037 pm
UUID: d2730d45-55dc-4c79-966f-126ad73aa40d
Ancestors: Cog-eem.166

Fix the identityHash definitions for the Pharo image bootstrap.

=============== Diff against Cog-eem.166 ===============

Item was added:
+ ----- Method: SpurBootstrap class>>BehaviorPROTOTYPEbasicIdentityHash (in category 'method prototypes pharo') -----
+ BehaviorPROTOTYPEbasicIdentityHash
+ 	"Answer a SmallInteger whose value is related to the receiver's identity.
+ 	 Behavior implements identityHash to allow the VM to use an object representation which
+ 	 does not include a direct reference to an object's class in an object.  If the VM is using
+ 	 this implementation then classes are held in a class table and instances contain the index
+ 	 of their class in the table.  A class's class table index is its identityHash so that an instance
+ 	 can be created without searching the table for a class's index.  The VM uses this primitive
+ 	 to enter the class into the class table, assigning its identityHash with an as yet unused
+ 	 class table index. If this primitive fails it means that the class table is full.  In Spur as of
+ 	 2014 there are 22 bits of classTable index and 22 bits of identityHash per object.
+ 
+ 	 Primitive. Essential. Do not override. See Object documentation whatIsAPrimitive."
+ 
+ 	<primitive: 175>
+ 	self primitiveFailed!

Item was changed:
+ ----- Method: SpurBootstrap class>>BehaviorPROTOTYPEidentityHash (in category 'method prototypes squeak') -----
- ----- Method: SpurBootstrap class>>BehaviorPROTOTYPEidentityHash (in category 'method prototypes') -----
  BehaviorPROTOTYPEidentityHash
  	"Answer a SmallInteger whose value is related to the receiver's identity.
  	 Behavior implements identityHash to allow the VM to use an object representation which
  	 does not include a direct reference to an object's class in an object.  If the VM is using
  	 this implementation then classes are held in a class table and instances contain the index
  	 of their class in the table.  A class's class table index is its identityHash so that an instance
  	 can be created without searching the table for a class's index.  The VM uses this primitive
  	 to enter the class into the class table, assigning its identityHash with an as yet unused
  	 class table index. If this primitive fails it means that the class table is full.  In Spur as of
  	 2014 there are 22 bits of classTable index and 22 bits of identityHash per object.
  
  	 Primitive. Essential. Do not override. See Object documentation whatIsAPrimitive."
  
  	<primitive: 175>
  	self primitiveFailed!

Item was added:
+ ----- Method: SpurBootstrap class>>ProtoObjectPROTOTYPEidentityHash (in category 'method prototypes pharo') -----
+ ProtoObjectPROTOTYPEidentityHash
+ 	"Answer a SmallInteger whose value is related to the receiver's identity.
+ 	 This method must not be overridden, except by SmallInteger.  As of
+ 	 2014, the 32-bit Spur VM has 22 bits of hash and 31-bit SmallIntegers
+ 	 (30 bits + 1 sign bit).  Shifting by 8 will not create large integers.
+ 	
+ 	 Do not override."
+ 
+ 	^self basicIdentityHash bitShift: 8!



More information about the Vm-dev mailing list