[Newcompiler] Adding the create closure environment bytecode

Klaus D. Witzel klaus.witzel at cobss.com
Sun Aug 19 19:20:54 UTC 2007


Hi Math,

when you use (self success: ...), where/how is successFlag initialized  
before one of your (variant) routines is entered?

IIR successFlag is mainly for primitiveXYZ routines, it corresponds to  
#primitiveFailed (fall through into the compiled method which has  
primitive # in its header).

Do you know about another (existing) bytecode routine which is using  
successFlag?

Cheers
Klaus

On Sun, 19 Aug 2007 14:58:10 +0200, Mathieu Suen <mathieusuen at yahoo.fr>  
wrote:

> 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