[Vm-dev] Re: localIP, instructionPointer, currentBytecode data size

John M McIntosh johnmci at smalltalkconsulting.com
Tue Mar 2 17:21:39 UTC 2010

On 2010-03-02, at 12:41 AM, Ang BeePeng wrote:

> Is it true that char* in bold explain difference in both version? 

> localIP = pointerForOop(instructionPointer); instead of 

This moves the global variable instructionPointer OOPS value into localIP and makes it a memory address.   

> localIP = pointerForOop(foo->instructionPointer);

This move the element instructionPointer from foo into localIP, and makes it a memory address. On the PowerPC 
this form takes one less assembler instruction than referencing a  global.  On Intel depending on the compiler it may take less 
assembler instructions. 

> In the bluebook, for example 
>     pushReceiverVariableBytecode
>          | fieldIndex |
>          fieldIndex := self extractBits: 12 to: 15 of: currentBytecode.
> I thought bytecode should be one byte, 8 bits. Why extracting from the
> second byte?

That is implementation. Take a look at 

> Thanks.
> Ang Beepeng
> -- 
> View this message in context: http://n4.nabble.com/localIP-instructionPointer-currentBytecode-data-size-tp1574626p1574737.html
> Sent from the Squeak - VM mailing list archive at Nabble.com.

John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com

More information about the Vm-dev mailing list