About frame::retrieve_receiver()
Peng Du
imdupeng at gmail.com
Thu Apr 8 13:05:04 PDT 2010
ps. Sorry for cross-posting from hotspot-dev to here. I really couldn't
solve
the problem on my own and no one has responded on hotspot-dev for quite
a while. I need to solve it ASAP for my work to move on.
Please help! Thank you!
~~~~~~~~~~~~~~~~~~
Hi,
I have been fighting with this problem for yet another day with no luck.
The error case happens when both the caller and callee are in compiled
Java frames. The backtrace tells me a SIGSEGV happens at this line:
====
in frame.cpp:1132:
oop r = *caller.oopmapreg_to_location(reg, reg_map)
====
as oopmapreg_to_location() returned a NULL which is dereferenced.
Can someone comment on the error? Thank you!
-Peng
On Wed, Apr 7, 2010 at 2:02 AM, Peng Du <imdupeng at gmail.com> wrote:
> Hello,
>
> What is the right way to get the receiver object of a Java method call in
> the
> VM code, considering both the caller, callee can either be interpreted or
> compiled?
>
> I tried using the "frame" class and it does have many methods for querying
> an interpreted frame, e.g. interpreter_callee_receiver(). But not for
> compiled
> frame.
>
> By learning related code in SharedRuntime, I wrote the following method. It
>
> works for some calls but fails for the others. Can someone point out what
> I have done wrong with the code?
>
> Thanks!
>
> ================
> static oop retrieve_receiver(JavaThread *thread) {
> HandleMark rm(Thread::current());
> frame stub = thread->last_frame();
>
> if (!stub.is_java_frame())
> stub = stub.java_sender();
>
> RegisterMap reg_map(thread);
> frame caller = stub.sender(®_map);
>
> if (caller.is_compiled_frame()) {
> return caller.retrieve_receiver(®_map);
> }
> else { // interpreted
> methodOop method;
> if (stub.is_compiled_frame())
> method = thread->callee_target(); // i2c will set this?
> else
> method = stub.interpreter_frame_method();
>
> return caller.interpreter_callee_receiver(method->signature());
> }
> }
>
>
> - Peng
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20100408/e548c878/attachment.html
More information about the hotspot-runtime-dev
mailing list