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

commits at source.squeak.org commits at source.squeak.org
Wed Feb 19 00:01:42 UTC 2014


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

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

Name: VMMaker.oscog-eem.619
Author: eem
Time: 18 February 2014, 3:57:13.565 pm
UUID: 9cd188c5-a1b6-46c2-8408-99190a15f19f
Ancestors: VMMaker.oscog-eem.618

Spur: Get obj stack swizzling correct.

Add some missing simulation plumbing.

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

Item was added:
+ ----- Method: SpurMemoryManager>>ioLoadModule:OfLength: (in category 'simulation only') -----
+ ioLoadModule: moduleNameIndex OfLength: moduleLength
+ 	<doNotGenerate>
+ 	<returnTypeC: #'void *'>
+ 	"Dummy - provided by support code"
+ 	^0!

Item was added:
+ ----- Method: SpurMemoryManager>>signed32BitValueOf: (in category 'simulation only') -----
+ signed32BitValueOf: oop
+ 	"hack around the CoInterpreter/ObjectMemory split refactoring"
+ 	<doNotGenerate>
+ 	^coInterpreter signed32BitValueOf: oop!

Item was changed:
  ----- Method: SpurMemoryManager>>swizzleObjStackAt: (in category 'obj stacks') -----
  swizzleObjStackAt: objStackRootIndex
  	"On load, swizzle the pointers in an obj stack. Answer the obj stack's oop."
  	| firstPage page stackOrNil index field |
  	firstPage := stackOrNil := self fetchPointer: objStackRootIndex ofObject: hiddenRootsObj.
  	stackOrNil = nilObj ifTrue:
  		[^stackOrNil].
  	[self assert: (self numSlotsOfAny: stackOrNil) = ObjStackPageSlots.
  	 self assert: (self fetchPointer: ObjStackMyx ofObject: stackOrNil) = objStackRootIndex.
  	 "There are four fixed slots in an obj stack, and a Topx of 0 indicates empty, so
  	   if there were 5 slots in an oop stack, full would be 2, and the last 0-rel index is 4.
  	   Hence the last index is topx + fixed slots - 1, or topx + ObjStackNextx"
  	 index := (self fetchPointer: ObjStackTopx ofObject: stackOrNil) + ObjStackNextx.
+ 	 "swizzle fields including ObjStackNextx, excluding ObjStackFreex and leave field containing the next link."
- 	 "swizzle fields including ObjStackNextx and leave field containing the next link."
  	 [field := self fetchPointer: index ofObject: stackOrNil.
  	  (field = 0 or: [self isImmediate: field]) ifFalse:
  		[field := segmentManager swizzleObj: field.
  		 self storePointer: index ofObjStack: stackOrNil withValue: field].
+ 	  (index := index - 1) >= ObjStackNextx] whileTrue.
- 	  (index := index - 1) > ObjStackMyx] whileTrue.
  	 (stackOrNil := field) ~= 0] whileTrue.
  	(stackOrNil := self fetchPointer: ObjStackFreex ofObject: firstPage) ~=  0 ifTrue:
+ 		[page := firstPage.
+ 		 [stackOrNil := segmentManager swizzleObj: stackOrNil.
+ 		  self storePointer: ObjStackFreex ofObjStack: page withValue: stackOrNil.
+ 		  page := stackOrNil.
+ 		  (stackOrNil := self fetchPointer: ObjStackFreex ofObject: page) ~=  0] whileTrue].
- 		[[page := self fetchPointer: ObjStackFreex ofObject: stackOrNil.
- 		 page ~= 0] whileTrue:
- 			[field := segmentManager swizzleObj: page.
- 			 self storePointer: ObjStackFreex ofObjStack: stackOrNil withValue: field.
- 			 stackOrNil := field]].
- 	(stackOrNil := self fetchPointer: ObjStackNextx ofObject: firstPage) ~= 0 ifTrue:
- 		[[page := self fetchPointer: ObjStackNextx ofObject: stackOrNil.
- 		 page ~= 0] whileTrue:
- 			[field := segmentManager swizzleObj: page.
- 			 self storePointer: ObjStackNextx ofObjStack: stackOrNil withValue: field.
- 			 stackOrNil := field]].
  	self assert: (self isValidObjStackAt: objStackRootIndex).
  	^self fetchPointer: objStackRootIndex ofObject: hiddenRootsObj!



More information about the Vm-dev mailing list