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

commits at source.squeak.org commits at source.squeak.org
Thu Feb 6 03:25:23 UTC 2014


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

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

Name: VMMaker.oscog-eem.610
Author: eem
Time: 5 February 2014, 7:21:23.697 pm
UUID: 1f5ba92f-b8cd-4144-8ebf-5cff693870ac
Ancestors: VMMaker.oscog-eem.609

Make StackInterpreterPrimitives>>primitiveObjectPointsTo correct
for both Spur and SqueakV3.

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

Item was changed:
  ----- Method: StackInterpreterPrimitives>>primitiveObjectPointsTo (in category 'object access primitives') -----
  primitiveObjectPointsTo
  	"This primitive is assumed to be fast (see e.g. MethodDictionary>>includesKey:) so make it so.
  	 N.B.  Written to use literalHeaderOf: so that in Cog subclasses cogged methods (whose headers
  	 point to the machine code method) are still correctly scanned, for the header as well as literals."
+ 	| rcvr thang header fmt numSlots methodHeader |
- 	| rcvr thang header fmt lastField methodHeader |
  	thang := self stackTop.
  	rcvr := self stackValue: 1.
  	(objectMemory isImmediate: rcvr) ifTrue:
  		[^self pop: 2 thenPushBool: false].
  
  	"Inlined version of lastPointerOf: for speed in determining if rcvr is a context."
  	header := objectMemory baseHeader: rcvr.
  	fmt := objectMemory formatOfHeader: header.
  	(objectMemory isPointersFormat: fmt)
  		ifTrue:
  			[(fmt = objectMemory indexablePointersFormat
  			  and: [objectMemory isContextHeader: header]) 
  				ifTrue:
  	 				[(self isMarriedOrWidowedContext: rcvr) ifTrue:
  						[self externalWriteBackHeadFramePointers.
  						 (self isStillMarriedContext: rcvr) ifTrue:
  							[^self pop: 2
  									thenPushBool: (self marriedContext: rcvr
  														pointsTo: thang
  														stackDeltaForCurrentFrame: 2)]].
  					"contexts end at the stack pointer"
+ 					numSlots := CtxtTempFrameStart + (self fetchStackPointerOf: rcvr)]
- 					lastField := CtxtTempFrameStart + (self fetchStackPointerOf: rcvr) * BytesPerOop]
  				ifFalse:
+ 					[numSlots := objectMemory numSlotsOf: rcvr]]
- 					[lastField := (objectMemory sizeBitsOfSafe: rcvr) - objectMemory baseHeaderSize]]
  		ifFalse:
  			[fmt < objectMemory firstCompiledMethodFormat "no pointers" ifTrue:
  				[^self pop: 2 thenPushBool: false].
  			"CompiledMethod: contains both pointers and bytes:"
  			methodHeader := self headerOf: rcvr.
  			methodHeader = thang ifTrue: [^self pop: 2 thenPushBool: true].
+ 			numSlots := (self literalCountOfHeader: methodHeader) + 1].
- 			lastField := ((self literalCountOfHeader: methodHeader) + 1) * BytesPerOop].
  
+ 	self assert: numSlots - 1 * BytesPerOop + objectMemory baseHeaderSize = (objectMemory lastPointerOf: rcvr).
+ 	objectMemory baseHeaderSize
+ 		to: numSlots - 1 * BytesPerOop + objectMemory baseHeaderSize
+ 		by: BytesPerOop
+ 		do: [:i|
+ 			(self longAt: rcvr + i) = thang ifTrue:
+ 				[^self pop: 2 thenPushBool: true]].
- 	objectMemory baseHeaderSize to: lastField by: objectMemory bytesPerOop do:
- 		[:i |
- 		(self longAt: rcvr + i) = thang ifTrue:
- 			[^self pop: 2 thenPushBool: true]].
  	self pop: 2 thenPushBool: false!

Item was added:
+ ----- Method: StackInterpreterSimulator>>primitiveObjectPointsTo (in category 'object access primitives') -----
+ primitiveObjectPointsTo
+ 	"self halt."
+ 	^super primitiveObjectPointsTo!



More information about the Vm-dev mailing list