x86 address generation / jump-targets
Peter Helfer
peter.helfer.java at gmail.com
Fri Jan 11 08:55:49 PST 2008
Hi all
I need to generate some return address, which is within a RuntimeStub I'm
creating. But the return address created as InternalAddress does show up as
0x00009BE9 - this seems not to be ok.. Is this the right approach ?
Regards, Peter
[do some stuff]
__ jmp(done) // jumps over next segment
//==============================================
Label exitadapter;
address returnpc_for_interpreter = __ pc();
__ jmp(exitadapter); // jump over next segment
//==============================================
__ bind(done);
__ mov32(rcx, InternalAddress(returnpc_for_interpreter)); // lets hope we've
got the right one
__ xchg(rcx, Address(rbp, frame::return_addr_offset * wordSize) // replace
current returnpc with new one
... stackdump done here
__ jmp(rcx); // but still go once into the old entry..
//==============================================
__ bind(exitadapter);
// stack dump
[AD759F30] = 0817BC00.%edi
[AD759F34] = 00000000.%esi
[AD759F38] = AD759F74.%ebp
[AD759F3C] = AD759F50.%esp before pushad
[AD759F40] = B7F7AFF4.%ebx
[AD759F44] = 0817BC00.%edx
[AD759F48] = B5C002B0.%ecx
[AD759F4C] = D00DFACE.%eax
[AD759F50] = ADBB36E8.
[AD759F54] = AD759F54.
[AD759F58] = B1D5506F.
[AD759F5C] = AD759FA0.
[AD759F60] = B1D55380.
[AD759F64] = 00000000.
[AD759F68] = B1D55188.
[AD759F6C] = 00000000.
[AD759F70] = B5C06752.
[AD759F74] = AD759FA8 <-- rbp
[AD759F78] = 00009BE9 <-- returnpc
.. and zeros after that..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20080111/b2f3840f/attachment.html
More information about the hotspot-runtime-dev
mailing list