[squeak-dev] literals in compiled method

Helmut Rohregger helmut.rohregger at gmail.com
Fri Mar 15 13:47:13 UTC 2013


Am 15.03.2013 14:29, schrieb Bert Freudenberg:
> On 2013-03-15, at 11:30, Helmut Rohregger <helmut.rohregger at gmail.com> wrote:
>
>> Hi all
>>
>> maybe someone of you can help me.
>> i am trying to read in a Squeak4.3.image in Java. My question is about the image-format.
>> when i read in a compiled method, there is a object header, then a compiled method header and then some literals. The last 2 literals are always a ByteSymbol (message selector) and an association which contains the class. I know the address of this association is at 0x1631470 in my image.
>> But the address stored as literal in the compiled method is 0x4801470. This is 0x31D0000 more then expected.
>> Anyone an idea, where this comes from?
>> Or maybe some help, where to look, to discover this?!?
>
> I'd say look at Interpreter>>readImageFromFile:HeapSize:StartingAt:, the oldBaseAddr is stored in the image header. Could it be 0x31D0000?
Thank you very much. That's it.
> OTOH, how did you get the address of the compiled method in the first place?
I am using a squeak-image-tool written at the Hasso Plattner Institut at 
the university of Potsdam. This tool gives me the address of the 
compiled method. But the tool doesn't translate the content of the 
compiled method. So this is raw data in this byte array and of course I 
have to correct the address with the memory base address!!!
Thanks again :)
> Also, you could look at Dan's Squeak interpreter written in Java.
>
> - Bert -
>
Helmut


More information about the Squeak-dev mailing list