[Vm-dev] VM Maker: VMMaker.oscog-eem.817.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 11 19:31:16 UTC 2014


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

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

Name: VMMaker.oscog-eem.817
Author: eem
Time: 11 July 2014, 12:28:26.983 pm
UUID: 0b8a838c-97bf-4732-abe3-fb55d4937989
Ancestors: VMMaker.oscog-eem.816

The new selector-forwarding policy needs to deal with
nil methodDictionaries.

canPinObjects can be inlined.

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

Item was changed:
  ----- Method: CogObjectRepresentation>>canPinObjects (in category 'testing') -----
  canPinObjects
  	"Answer if the memory manager supports pinned objects."
+ 	<inline: true>
  	^false!

Item was changed:
  ----- Method: CogObjectRepresentationForSpur>>canPinObjects (in category 'testing') -----
  canPinObjects
  	"Answer if the memory manager supports pinned objects."
+ 	<inline: true>
  	^true!

Item was changed:
  ----- Method: SpurMemoryManager>>scanClassPostBecome:effects: (in category 'become implementation') -----
  scanClassPostBecome: startClassObj effects: becomeEffects
  	"Scan a class in the class table post-become.  Make sure the superclass
  	 chain contains no forwarding pointers, and that the method dictionaries
  	 are not forwarded either.  N.B. we don't follow methods or their
  	 methodClassAssociations since we can't guarantee that forwarders
  	 to compiled methods are not stored in method dictionaries via at:put:
  	 and so have to cope with forwarding pointers to compiled methods
  	 in method dictionaries anyway.  Instead the [Co]Interpreter must
  	 follow forwarders when fetching from method dictionaries and follow
  	 forwarders on become in the method cache and method zone."
  
  	| classObj obj |
  	"Algorithm depends on this to terminate loop at root of superclass chain."
  	self assert: (self rawHashBitsOf: nilObj) ~= 0.
  	self assert: (becomeEffects anyMask: BecamePointerObjectFlag). "otherwise why bother?"
  	classObj := startClassObj.
  
  	["e.g. the Newspeak bootstrap creates fake classes that contain bogus superclasses.
+ 	  Hence be cautious.  Also need to terminate at nilObject."
- 	  Hence be cautious."
  	 ((self isPointers: classObj)
+ 	   and: [(self rawNumSlotsOf: classObj) > MethodDictionaryIndex]) ifFalse:
- 	   and: [(self numSlotsOf: classObj) > MethodDictionaryIndex]) ifFalse:
  		[^self].
  	 obj := self followObjField: MethodDictionaryIndex ofObject: classObj.
  	 "Solving the becommed method stored into a method dictionary object issue is easy;
  	  just have a read barrier on fetching the method.  But solving the read barrier for
  	  selectors is more difficult (because selectors are currently not read, just their oops).
  	  For now provide a policy switch that either follows on become or lazily on lookup."
  	 self flag: 'need to fix the selector and methodDictionary issue'.
  	 self forwardingCount: [statFollowForBecome := statFollowForBecome + 1].
  	 FollowMethodDictionariesOnBecome
  		ifTrue: [self followForwardedObjectFields: obj toDepth: 0]
+ 		ifFalse:
+ 			[(self rawNumSlotsOf: obj) > MethodArrayIndex ifTrue:
+ 				[self followObjField: MethodArrayIndex ofObject: obj]].
- 		ifFalse: [self followObjField: MethodArrayIndex ofObject: obj].
  	 obj := self followObjField: SuperclassIndex ofObject: classObj.
  	 "If the superclass has an identityHash then either it is nil, or is in the class table.
  	  Tail recurse."
  	 (self rawHashBitsOf: obj) = 0] whileTrue:
  		["effectively self scanClassPostBecome: obj"
  		 classObj := obj]!



More information about the Vm-dev mailing list