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

commits at source.squeak.org commits at source.squeak.org
Mon Mar 10 20:23:06 UTC 2014


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

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

Name: VMMaker.oscog-eem.636
Author: eem
Time: 10 March 2014, 12:19:45.557 pm
UUID: 97945106-afaf-4c50-be03-a1806625c3b9
Ancestors: VMMaker.oscog-eem.635

Fix byteFormatForNumBytes: and hence fix the new version of
positive64BitIntegerFor:.

Make sure expungeDuplicateAndUnmarkedClasses: resets
classTableIndex for nil entries.

Eliminate duplication in generateEntire.
Typo.

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

Item was changed:
  ----- Method: ObjectMemory>>byteFormatForNumBytes: (in category 'header access') -----
  byteFormatForNumBytes: numBytes
+ 	^self firstByteFormat + (4 - numBytes bitAnd: 3)!
- 	^self firstByteFormat + (numBytes bitAnd: 3)!

Item was changed:
  ----- Method: SpurMemoryManager>>byteFormatForNumBytes: (in category 'header format') -----
  byteFormatForNumBytes: numBytes
+ 	^self firstByteFormat + (8 - numBytes bitAnd: self wordSize - 1)!
- 	^self firstByteFormat + (numBytes bitAnd: self wordSize - 1)!

Item was changed:
  ----- Method: SpurMemoryManager>>expungeDuplicateAndUnmarkedClasses: (in category 'class table') -----
  expungeDuplicateAndUnmarkedClasses: expungeUnmarked
  	"Bits have been set in the classTableBitmap corresponding to
  	 used classes.  Any class in the class table that does not have a
  	 bit set has no instances with that class index.  However, becomeForward:
  	 can create duplicate entries, and these duplicate entries
  		a) won't have a bit set on load (because there are no forwarders on load),
  		b) wont match their identityHash.
  	 So expunge duplicates by eliminating unmarked entries that don't occur at
  	 their identityHash.
  	 Further, any class in the table that is unmarked will also not have a bit set so
  	 eliminate unmarked classes using the bitmap too."
  	1 to: numClassTablePages - 1 do: "Avoid expunging the puns by not scanning the 0th page."
  		[:i| | classTablePage |
  		"optimize scan by only scanning bitmap in regions that have pages."
  		classTablePage := self fetchPointer: i ofObject: hiddenRootsObj.
  		classTablePage ~= nilObj ifTrue:
  			[i << self classTableMajorIndexShift
  				to: i << self classTableMajorIndexShift + self classTableMinorIndexMask
  				by: 8
  				do: [:majorBitIndex| | byteIndex byte classIndex classOrNil |
  					"optimize scan by scanning a byte of indices (8 indices) at a time"
  					byteIndex := majorBitIndex / BitsPerByte.
  					byte := classTableBitmap at: byteIndex.
  					byte ~= 255 ifTrue:
  						[0 to: 7 do:
  							[:minorBitIndex|
  							(byte noMask: 1 << minorBitIndex) ifTrue:
  								[classIndex := majorBitIndex + minorBitIndex.
  								 classOrNil := self fetchPointer: (classIndex bitAnd: self classTableMinorIndexMask)
  												   ofObject: classTablePage.
  								 self assert: (self classAtIndex: classIndex) = classOrNil.
  								 self assert: (classOrNil = nilObj or: [coInterpreter addressCouldBeClassObj: classOrNil]).
  								 "only remove a class if it is at a duplicate entry or it is unmarked and we're expunging unmarked classes."
+ 								 classOrNil = nilObj
+ 									ifTrue:
+ 										[classIndex < classTableIndex ifTrue:
+ 											[classTableIndex := classIndex]]
+ 									ifFalse:
+ 										[((expungeUnmarked and: [(self isMarked: classOrNil) not])
+ 										  or: [(self rawHashBitsOf: classOrNil) ~= classIndex]) ifTrue:
+ 										[self storePointerUnchecked: (classIndex bitAnd: self classTableMinorIndexMask)
+ 											ofObject: classTablePage
+ 											withValue: nilObj.
+ 										 "but if it is marked, it should still be in the table at its correct index."
+ 										 self assert: ((expungeUnmarked and: [(self isMarked: classOrNil) not])
+ 													or: [(self classAtIndex: (self rawHashBitsOf: classOrNil)) = classOrNil]).
+ 										 "If the removed class is before the classTableIndex, set the
+ 										  classTableIndex to point to the empty slot so as to reuse it asap."
+ 										 classIndex < classTableIndex ifTrue:
+ 											[classTableIndex := classIndex]]]]]]]]]!
- 								 (classOrNil ~= nilObj
- 								  and: [(expungeUnmarked and: [(self isMarked: classOrNil) not])
- 									  or: [(self rawHashBitsOf: classOrNil) ~= classIndex]]) ifTrue:
- 									[self storePointerUnchecked: (classIndex bitAnd: self classTableMinorIndexMask)
- 										ofObject: classTablePage
- 										withValue: nilObj.
- 									 "but if it is marked, it should still be in the table at its correct index."
- 									 self assert: ((expungeUnmarked and: [(self isMarked: classOrNil) not])
- 												or: [(self classAtIndex: (self rawHashBitsOf: classOrNil)) = classOrNil]).
- 									 "If the removed class is before the classTableIndex, set the
- 									  classTableIndex to point to the empty slot so as to reuse it asap."
- 									 classIndex < classTableIndex ifTrue:
- 										[classTableIndex := classIndex]]]]]]]]!

Item was changed:
  ----- Method: SpurMemoryManager>>markAndTraceHiddenRoots (in category 'gc - global') -----
  markAndTraceHiddenRoots
  	"The hidden roots hold both the class table pages and the obj stacks,
  	 and hence need special treatment.
  	 The obj stacks must be marked specially; their pages must be marked,
  	 but only the contents of the ephemeronQueue should be marked.
  	 If a class table page is weak we can mark and trace the hiddenRoots,
+ 	 which will not trace through class table pages because they are weak.
- 	 which will not trace through class table opages because they are weak.
  	 But if class table pages are strong, we must mark the pages and *not*
  	 trace them so that only classes reachable from the true roots will be
  	 marked, and unreachable classes will be left unmarked."
  
  	self markAndTraceObjStack: markStack andContents: false.
  	self markAndTraceObjStack: weaklingStack andContents: false.
  	self markAndTraceObjStack: ephemeronQueue andContents: true.
  
  	self setIsMarkedOf: self freeListsObj to: true.
  
  	(self isWeakNonImm: classTableFirstPage) ifTrue:
  		[^self markAndTrace: hiddenRootsObj].
  
  	self setIsMarkedOf: hiddenRootsObj to: true.
  	self markAndTrace: classTableFirstPage.
  	1 to: numClassTablePages - 1 do:
  		[:i| self setIsMarkedOf: (self fetchPointer: i ofObject: hiddenRootsObj)
  				to: true]!

Item was changed:
  ----- Method: VMMaker>>generateEntire (in category 'generate sources') -----
  generateEntire
  	"Generate the interp, internal plugins and exports as well as the external plugins.
  	 If this comes from a generator, log it for convenience."
  	self configurationGeneratorNameOrNil ifNotNil:
  		[:generator|
  		 logger cr; nextPutAll: (generator selector copyReplaceAll: 'generate' with: '').
  		 interpreterClassName ifNotNil:
+ 			[logger space; nextPutAll: (CCodeGenerator shortMonticelloDescriptionForClass: (Smalltalk classNamed: interpreterClassName))].
- 			[logger
- 				space; nextPutAll: interpreterClassName;
- 				space; nextPutAll: (CCodeGenerator shortMonticelloDescriptionForClass: (Smalltalk classNamed: interpreterClassName))].
  		 logger cr; flush].
  	self generateMainVM.
  	self generateExternalPlugins!



More information about the Vm-dev mailing list