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

commits at source.squeak.org commits at source.squeak.org
Tue Oct 14 15:33:24 UTC 2014


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

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

Name: VMMaker.oscog-eem.901
Author: eem
Time: 14 October 2014, 8:30:46.154 am
UUID: 08ffab52-343a-41c4-a367-493bbc4d3eaa
Ancestors: VMMaker.oscog-eem.900

Rename hiddenRootsObj: to setHiddenRootsObj: for
clang.

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

Item was removed:
- ----- Method: SpurMemoryManager>>hiddenRootsObj: (in category 'class table') -----
- hiddenRootsObj: anOop
- 	hiddenRootsObj := anOop.
- 	self cCode: [self assert: self validClassTableRootPages]
- 		inSmalltalk: [numClassTablePages ifNotNil:
- 						[self assert: self validClassTableRootPages]]..
- 	classTableFirstPage := self fetchPointer: 0 ofObject: hiddenRootsObj.
- 	self assert: (self numSlotsOf: classTableFirstPage) - 1 = self classTableMinorIndexMask.
- 	"Set classTableIndex to the start of the last used page (excepting first page).
- 	 Set numClassTablePages to the number of used pages."
- 	numClassTablePages := self classTableRootSlots.
- 	2 to: numClassTablePages - 1 do:
- 		[:i|
- 		(self fetchPointer: i ofObject: hiddenRootsObj) = nilObj ifTrue:
- 			[numClassTablePages := i.
- 			 classTableIndex := (numClassTablePages - 1 max: 1) << self classTableMajorIndexShift.
- 			 ^self]].
- 	"no unused pages; set it to the start of the second page."
- 	classTableIndex := 1 << self classTableMajorIndexShift!

Item was changed:
  ----- Method: SpurMemoryManager>>initializeObjectMemory: (in category 'initialization') -----
  initializeObjectMemory: bytesToShift
  	"Initialize object memory variables at startup time. Assume endOfMemory at al are
  	 initialised by the image-reading code via setHeapBase:memoryLimit:endOfMemory:.
  	 endOfMemory is assumed to point to the end of the last object in the image.
  	 Assume: image reader also initializes the following variables:
  		specialObjectsOop
  		lastHash"
  	<inline: false>
  	| freeListObj |
  	"Catch mis-initializations leading to bad translations to C"
  	self assert: BaseHeaderSize = self baseHeaderSize.
  	self assert: (self maxSlotsForAlloc * BytesPerWord) asInteger > 0.
  	self bootstrapping ifFalse:
  		[self
  			initSegmentBridgeWithBytes: self bridgeSize
  			at: endOfMemory - self bridgeSize].
  	segmentManager adjustSegmentSwizzlesBy: bytesToShift.
  	"image may be at a different address; adjust oops for new location"
  	self adjustAllOopsBy: bytesToShift.
  	specialObjectsOop := segmentManager swizzleObj: specialObjectsOop.
  
  	"heavily used special objects"
  	nilObj		:= self splObj: NilObject.
  	falseObj	:= self splObj: FalseObject.
  	trueObj		:= self splObj: TrueObject.
  
  	"In Cog we insist that nil, true & false are next to each other (Cogit generates tighter
  	 conditional branch code as a result).  In addition, Spur places the free lists and
  	 class table root page immediately following them."
  	self assert: nilObj = oldSpaceStart.
  	self assert: falseObj = (self objectAfter: nilObj).
  	self assert: trueObj = (self objectAfter: falseObj).
  	freeListObj := self objectAfter: trueObj.
+ 	self setHiddenRootsObj: (self objectAfter: freeListObj).
- 	self hiddenRootsObj: (self objectAfter: freeListObj).
  	markStack := self swizzleObjStackAt: MarkStackRootIndex.
  	weaklingStack := self swizzleObjStackAt: WeaklingStackRootIndex.
  	ephemeronQueue := self swizzleObjStackAt: EphemeronQueueRootIndex.
  	self assert: self validObjStacks.
  	self assert: (self isEmptyObjStack: markStack).
  	self assert: (self isEmptyObjStack: weaklingStack).
  
  	self initializeFreeSpacePostLoad: freeListObj.
  	segmentManager collapseSegmentsPostSwizzle.
  	self computeFreeSpacePostSwizzle.
  	self initializeOldSpaceFirstFree: freeOldSpaceStart. "initializes endOfMemory, freeStart, free space"
  	"self bootstrapping ifFalse:
  		["self initializeNewSpaceVariables.
  		 scavenger initializeRememberedSet"]".
  	segmentManager checkSegments.
  
  	numCompactionPasses := CompactionPassesForGC.
  
  	"These defaults should depend on machine size; e.g. too small on a powerful laptop, too big on a Pi."
  	growHeadroom := 16*1024*1024.		"headroom when growing"
  	shrinkThreshold := 32*1024*1024.		"free space before shrinking"
  	self setHeapSizeAtPreviousGC.
  	heapGrowthToSizeGCRatio := 0.333333. "By default GC after scavenge if heap has grown by a third since the last GC"!

Item was added:
+ ----- Method: SpurMemoryManager>>setHiddenRootsObj: (in category 'class table') -----
+ setHiddenRootsObj: anOop
+ 	hiddenRootsObj := anOop.
+ 	self cCode: [self assert: self validClassTableRootPages]
+ 		inSmalltalk: [numClassTablePages ifNotNil:
+ 						[self assert: self validClassTableRootPages]]..
+ 	classTableFirstPage := self fetchPointer: 0 ofObject: hiddenRootsObj.
+ 	self assert: (self numSlotsOf: classTableFirstPage) - 1 = self classTableMinorIndexMask.
+ 	"Set classTableIndex to the start of the last used page (excepting first page).
+ 	 Set numClassTablePages to the number of used pages."
+ 	numClassTablePages := self classTableRootSlots.
+ 	2 to: numClassTablePages - 1 do:
+ 		[:i|
+ 		(self fetchPointer: i ofObject: hiddenRootsObj) = nilObj ifTrue:
+ 			[numClassTablePages := i.
+ 			 classTableIndex := (numClassTablePages - 1 max: 1) << self classTableMajorIndexShift.
+ 			 ^self]].
+ 	"no unused pages; set it to the start of the second page."
+ 	classTableIndex := 1 << self classTableMajorIndexShift!



More information about the Vm-dev mailing list