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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 12 00:32:01 UTC 2013

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.560
Author: eem
Time: 11 December 2013, 4:29:24.437 pm
UUID: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
Ancestors: VMMaker.oscog-eem.559

Also have to swizzle along the chain of free objStack pages.

Print value of topX field when printing objStacks.

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

Item was changed:
  ----- Method: SpurMemoryManager>>printObjStackPage:myIndex:pageType: (in category 'obj stacks') -----
  printObjStackPage: objStackPage myIndex: myx pageType: pageType
  	| freeOrNextPage isFirstPage isNextPage isFreePage |
  	<inline: false>
  	isFirstPage := pageType = ObjStackMyx.
  	isNextPage := pageType = ObjStackNextx.
  	isFreePage := pageType = ObjStackFreex.
  	self printObjStackPage: objStackPage
  		myIndex: myx
  		tag: (isFirstPage ifTrue: ['head'] ifFalse: [isFreePage ifTrue: ['free'] ifFalse: ['next']]).
  	(isFirstPage or: [isNextPage]) ifTrue:
+ 		[coInterpreter tab; print: 'topx: '; printNum: (self fetchPointer: ObjStackTopx ofObject: objStackPage); print: ' next: '; printHex: (self fetchPointer: ObjStackNextx ofObject: objStackPage).
- 		[coInterpreter tab; print: 'next: '; printHex: (self fetchPointer: ObjStackNextx ofObject: objStackPage).
  		 isFirstPage ifTrue:
  			[coInterpreter print: ' free: '; printHex: (self fetchPointer: ObjStackFreex ofObject: objStackPage)].
  		 coInterpreter cr].
  	freeOrNextPage := self fetchPointer: ObjStackFreex ofObject: objStackPage.
  	[freeOrNextPage ~= 0] whileTrue:
  		[self printObjStackPage: freeOrNextPage myIndex: myx pageType: ObjStackFreex.
  		 freeOrNextPage := self fetchPointer: ObjStackFreex ofObject: freeOrNextPage].
  	freeOrNextPage := self fetchPointer: ObjStackNextx ofObject: objStackPage.
  	freeOrNextPage ~= 0 ifTrue:
  		[self printObjStackPage: freeOrNextPage myIndex: myx pageType: ObjStackNextx]!

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 stackOrNil index field |
  	firstPage := stackOrNil := self fetchPointer: objStackRootIndex ofObject: hiddenRootsObj.
  	stackOrNil = nilObj ifTrue:
  	[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 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: ObjStackNextx ofObjStack: stackOrNil withValue: field].
  	  (index := index - 1) > ObjStackMyx] whileTrue.
  	 (stackOrNil := field) ~= 0] whileTrue.
  	[stackOrNil := self fetchPointer: ObjStackFreex ofObject: firstPage.
  	 stackOrNil ~= 0] whileTrue:
  		[field := segmentManager swizzleObj: stackOrNil.
  		 self storePointer: ObjStackFreex ofObjStack: firstPage withValue: field.
+ 		 firstPage := field].
- 		 firstPage := stackOrNil].
  	self assert: (self isValidObjStackAt: objStackRootIndex).
  	^self fetchPointer: objStackRootIndex ofObject: hiddenRootsObj!

More information about the Vm-dev mailing list