[Vm-dev] how to map bytecodes to methods?

Eliot Miranda eliot.miranda at gmail.com
Tue Oct 5 17:53:41 UTC 2010

On Tue, Oct 5, 2010 at 10:44 AM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

> Hi. I am new with all these stuff. My problem is how to map bytecodes
> numbers to methods.
> For example, if in a method I send #class  and see the bytecodes I can see
> it has a "C7", which in decimal is 199.
> If I see Interpreter class >> initializeBytecodeTable    then in 199 I see
> #bytecodePrimClass  which is correct.
> Now....I want to go in the OTHER direction. For example, I have changed
> something in #bytecodePrimValueWithArg  and I would like to know WHICH
> method from the image side, generates that bytecode.

See VariableNode class>>initialize:

StdSelectors := Dictionary new: 64.
fillDict: StdSelectors
with: SelectorNode
mapping: ((1 to: Smalltalk specialSelectorSize) collect:
[:i | Smalltalk specialSelectorAt: i])
to: (SendPlus to: SendPlus + 31).

> Ok, sometimes it is intuitive, but sometimes more or less...
> Thanks
> Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101005/b2dbfdc5/attachment.htm

More information about the Vm-dev mailing list