[Vm-dev] How to convert a Byte to an integer in VMMaker

Mathieu Suen mathk.sue at gmail.com
Wed Aug 15 12:17:58 UTC 2007


Hi.

I am in VMMaker and I want to convert the current bytecode to the  
corresponding integer.
How could I do that?

For the time being I have write the following instruction:

	self fetchNextBytecode.
	closSize := self positive32BitIntegerFor: 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)]]

But it don't seems to work
Thanks for helping


	Mth





More information about the Vm-dev mailing list