[Newcompiler] Adding the create closure environment bytecode

Mathieu Suen mathieusuen at yahoo.fr
Sun Aug 19 12:58:10 UTC 2007


Actually when I think about it I don't really understand what happen.  
The fact is that :

createEnvironment

	| closSize |
	self fetchNextBytecode.
	closSize := currentBytecode.
	self fetchNextBytecode.
	self push: (self splObj: ClosureEnvObject).
	self push: (self integerObjectOf: closSize).
	self primitiveNewWithArg.
	.
	successFlag ifTrue: [
		self storePointer: 4
			ofObject: activeContext
			withValue: self popStack]

This implemetation work but :

createEnvironment

	| closSize |
	self fetchNextBytecode.
	closSize := currentBytecode.
	self fetchNextBytecode.
	"The following may cause GC!"
	self success: (self sufficientSpaceToInstantiate:  (self splObj:  
ClosureEnvObject) indexableSize: closSize).
	successFlag ifTrue: [
		self storePointer: 4
			ofObject: activeContext
			withValue:(self instantiateClass: (self splObj: ClosureEnvObject)  
indexableSize: closSize)]


This one don't.

I suppose that if you don't use all the space of the MethodContext  
then the GC fail to look inside empty slot.

	Mth



On Aug 19, 2007, at 11:18 AM, Klaus D. Witzel wrote:

> I do not understand this (bug v.s. frame size v.s. not the best  
> optimization v.s. you don't use the stack). Could you post the  
> fileOut of your implementation of the bytecode.


	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com


More information about the Newcompiler mailing list