Startup time, a short review & discussion

John M McIntosh johnmci at smalltalkconsulting.com
Sat Aug 2 18:17:01 UTC 2003


On Friday, August 1, 2003, at 04:05  PM, John M McIntosh wrote:

>>> Yes, but that wouldn't work because we can't say where the
>>> image comes from, so I can' say they are clean.
>
> Well I'm looking to see where that one object with the root bit set  
> comes from. A quick look didn't tell me.
> Some in or after the fullGC I'd guess.

Right the bit gets set right after the fullGC via
postGCAction
	...
	compilerInitialized
		ifTrue:
			[...]
		ifFalse:
			[(activeContext    < youngStart) ifTrue: [ self beRootIfOld:  
activeContext ].
			 (theHomeContext < youngStart) ifTrue: [ self beRootIfOld:  
theHomeContext ]].

You will note the setting of activeContext & theHomeContext and since  
we've just set  youngSpace boundary
to the end of memory, everything is OLD. Now I believe theHomeContext  
gets set in
fetchContextRegisters: activeCntx

fetchContextRegisters: activeCntx
	"Note: internalFetchContextRegisters: should track changes to this  
method."

	| tmp |
	self inline: true.
	tmp _ self fetchPointer: MethodIndex ofObject: activeCntx.
	(self isIntegerObject: tmp) ifTrue: [
		"if the MethodIndex field is an integer, activeCntx is a block  
context"
		tmp _ self fetchPointer: HomeIndex ofObject: activeCntx.
		(tmp < youngStart) ifTrue: [ self beRootIfOld: tmp ].
	] ifFalse: [
		"otherwise, it is a method context and is its own home context"
		tmp _ activeCntx.
	].
	theHomeContext _ tmp.
...


Now interesting enough it appears that at snapshot time, why  
theHomeContext is always the activeContext, which is why I've got a  
root bit set on only one object, versus two.

Then at image startup time we invoke

Interpreter>>loadInitialContext which sets the Root bit  on  
activeContext, then it calls  Interpreter>>fetchContextRegisters: which  
would do the beRootIfOld on the theHomeContext  based on the if above  
but I don't  think that happens since it's always a method context we  
are dealing with versus a block.

Haven't looked to see how far back this logic goes. Now I wonder when  
the clear Root bits was added to fix problems with RootBits not being  
cleared correctly after a Full GC. Anyone remember? Hint -  
"adjustAllOopsBy: bytesToShift -> ar 10/7/1998 - Clear the RootBit of  
all objects"

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list