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

commits at source.squeak.org commits at source.squeak.org
Thu Feb 20 01:40:27 UTC 2014


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

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

Name: VMMaker.oscog-eem.620
Author: eem
Time: 19 February 2014, 5:37:04.798 pm
UUID: 0c6991e0-acb5-4250-84d8-cdeebfac41e9
Ancestors: VMMaker.oscog-eem.619

Fix an assert fail in findSPOrNilOf:on:startingFrom:.

Fix scanClassPostBecome:effects: for the bogus temp classes the
Newspeak bootstrap creates.

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

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."
+ 	 ((self isPointers: classObj)
+ 	   and: [(self numSlotsOf: classObj) > MethodDictionaryIndex]) ifFalse:
+ 		[^self].
+ 	 obj := self followObjField: MethodDictionaryIndex ofObject: classObj.
- 	[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 punt on the issue and simply follow all selectors on become"
- 	  oops.  For now punt on the issue and simply follow all selectors on become"
  	 self flag: 'need to fix the selector and methodDictionary issue'.
  	 true
  		ifTrue: [self followForwardedObjectFields: obj toDepth: 0]
  		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]!

Item was changed:
  ----- Method: StackInterpreter>>findSPOrNilOf:on:startingFrom: (in category 'frame access') -----
  findSPOrNilOf: theFP on: thePage startingFrom: startFrame
  	"Search for the stack pointer for theFP.  This points to the hottest item on the frame's stack.
  	 DO NOT CALL THIS WITH theFP == localFP OR theFP == framePointer!!"
- 	<var: #aFrame type: #'char *'>
  	<var: #theFP type: #'char *'>
  	<var: #thePage type: #'StackPage *'>
+ 	<var: #startFrame type: #'char *'>
  	<returnTypeC: #'char *'>
+ 	| aFrame prevFrame |
- 	| aFrame theSP |
  	<inline: true>
  	<asmLabel: false>
+ 	<var: #aFrame type: #'char *'>
+ 	<var: #prevFrame type: #'char *'>
- 	<var: #startFrame type: #'char *'>
- 	<var: #theSP type: #'char *'>
  	self assert: (stackPages isFree: thePage) not.
+ 	startFrame = theFP ifTrue:
+ 		[thePage headSP >= startFrame ifTrue:
- 	aFrame := startFrame.
- 	theSP := thePage headSP.
- 	aFrame = theFP ifTrue:
- 		[theSP >= aFrame ifTrue:
  			["If the SP is invalid return the pointer to the receiver field."
  			 ^self frameReceiverOffset: aFrame].
  		 "Skip the instruction pointer on top of stack of inactive pages."
  		^thePage = stackPage
+ 			ifTrue: [thePage headSP]
+ 			ifFalse: [thePage headSP + BytesPerWord]].
+ 	aFrame := startFrame.
+ 	[prevFrame := aFrame.
- 			ifTrue: [theSP]
- 			ifFalse: [theSP + BytesPerWord]].
- 	[theSP := self frameCallerSP: aFrame.
  	 aFrame := self frameCallerFP: aFrame.
  	 aFrame ~= 0] whileTrue:
  		[theFP = aFrame ifTrue:
+ 			[^self frameCallerSP: prevFrame]].
- 			[^theSP]].
  	^nil!



More information about the Vm-dev mailing list