8133749: os::current_frame() is not returning the proper frame on ARM and solaris-x64

Need to go up one extra frame to be consistent with other platforms.

Reviewed-by: dholmes, zgu
This commit is contained in:
Chris Plummer 2016-08-15 13:06:50 -07:00
parent d57ddc21e8
commit 2a46a44214

View File

@ -292,15 +292,19 @@ extern "C" intptr_t *_get_current_fp(); // in .il file
frame os::current_frame() { frame os::current_frame() {
intptr_t* fp = _get_current_fp(); // it's inlined so want current fp intptr_t* fp = _get_current_fp(); // it's inlined so want current fp
// fp is for os::current_frame. We want the fp for our caller.
frame myframe((intptr_t*)os::current_stack_pointer(), frame myframe((intptr_t*)os::current_stack_pointer(),
(intptr_t*)fp, (intptr_t*)fp,
CAST_FROM_FN_PTR(address, os::current_frame)); CAST_FROM_FN_PTR(address, os::current_frame));
if (os::is_first_C_frame(&myframe)) { frame caller_frame = os::get_sender_for_C_frame(&myframe);
if (os::is_first_C_frame(&caller_frame)) {
// stack is not walkable // stack is not walkable
frame ret; // This will be a null useless frame frame ret; // This will be a null useless frame
return ret; return ret;
} else { } else {
return os::get_sender_for_C_frame(&myframe); // return frame for our caller's caller
return os::get_sender_for_C_frame(&caller_frame);
} }
} }