mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
Merge
This commit is contained in:
commit
28ccc9e20c
20 changed files with 77 additions and 76 deletions
|
@ -98,7 +98,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
|
||||||
}
|
}
|
||||||
pop(rax);
|
pop(rax);
|
||||||
#endif
|
#endif
|
||||||
reset_last_Java_frame(thread, true, align_stack);
|
reset_last_Java_frame(thread, true);
|
||||||
|
|
||||||
// discard thread and arguments
|
// discard thread and arguments
|
||||||
NOT_LP64(addptr(rsp, num_rt_args()*BytesPerWord));
|
NOT_LP64(addptr(rsp, num_rt_args()*BytesPerWord));
|
||||||
|
@ -872,7 +872,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
|
||||||
}
|
}
|
||||||
__ pop(rax);
|
__ pop(rax);
|
||||||
#endif
|
#endif
|
||||||
__ reset_last_Java_frame(thread, true, false);
|
__ reset_last_Java_frame(thread, true);
|
||||||
#ifndef _LP64
|
#ifndef _LP64
|
||||||
__ pop(rcx); // discard thread arg
|
__ pop(rcx); // discard thread arg
|
||||||
__ pop(rcx); // discard dummy
|
__ pop(rcx); // discard dummy
|
||||||
|
|
|
@ -337,14 +337,17 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const {
|
||||||
JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
|
JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
|
||||||
assert(!entry_frame_is_first(), "next Java fp must be non zero");
|
assert(!entry_frame_is_first(), "next Java fp must be non zero");
|
||||||
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
|
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
|
||||||
|
// Since we are walking the stack now this nested anchor is obviously walkable
|
||||||
|
// even if it wasn't when it was stacked.
|
||||||
|
if (!jfa->walkable()) {
|
||||||
|
// Capture _last_Java_pc (if needed) and mark anchor walkable.
|
||||||
|
jfa->capture_last_Java_pc();
|
||||||
|
}
|
||||||
map->clear();
|
map->clear();
|
||||||
assert(map->include_argument_oops(), "should be set by clear");
|
assert(map->include_argument_oops(), "should be set by clear");
|
||||||
if (jfa->last_Java_pc() != NULL ) {
|
vmassert(jfa->last_Java_pc() != NULL, "not walkable");
|
||||||
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
|
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
|
||||||
return fr;
|
return fr;
|
||||||
}
|
|
||||||
frame fr(jfa->last_Java_sp(), jfa->last_Java_fp());
|
|
||||||
return fr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -666,3 +669,21 @@ frame::frame(void* sp, void* fp, void* pc) {
|
||||||
init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
|
init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void JavaFrameAnchor::make_walkable(JavaThread* thread) {
|
||||||
|
// last frame set?
|
||||||
|
if (last_Java_sp() == NULL) return;
|
||||||
|
// already walkable?
|
||||||
|
if (walkable()) return;
|
||||||
|
vmassert(Thread::current() == (Thread*)thread, "not current thread");
|
||||||
|
vmassert(last_Java_sp() != NULL, "not called from Java code?");
|
||||||
|
vmassert(last_Java_pc() == NULL, "already walkable");
|
||||||
|
capture_last_Java_pc();
|
||||||
|
vmassert(walkable(), "something went wrong");
|
||||||
|
}
|
||||||
|
|
||||||
|
void JavaFrameAnchor::capture_last_Java_pc() {
|
||||||
|
vmassert(_last_Java_sp != NULL, "no last frame set");
|
||||||
|
vmassert(_last_Java_pc == NULL, "already walkable");
|
||||||
|
_last_Java_pc = (address)_last_Java_sp[-1];
|
||||||
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) {
|
||||||
// call a specialized frame constructor instead of this one.
|
// call a specialized frame constructor instead of this one.
|
||||||
// Then we could use the assert below. However this assert is of somewhat dubious
|
// Then we could use the assert below. However this assert is of somewhat dubious
|
||||||
// value.
|
// value.
|
||||||
|
// UPDATE: this constructor is only used by trace_method_handle_stub() now.
|
||||||
// assert(_pc != NULL, "no pc?");
|
// assert(_pc != NULL, "no pc?");
|
||||||
|
|
||||||
_cb = CodeCache::find_blob(_pc);
|
_cb = CodeCache::find_blob(_pc);
|
||||||
|
|
|
@ -62,10 +62,9 @@ public:
|
||||||
_last_Java_sp = src->_last_Java_sp;
|
_last_Java_sp = src->_last_Java_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always walkable
|
bool walkable(void) { return _last_Java_sp != NULL && _last_Java_pc != NULL; }
|
||||||
bool walkable(void) { return true; }
|
void make_walkable(JavaThread* thread);
|
||||||
// Never any thing to do since we are always walkable and can find address of return addresses
|
void capture_last_Java_pc(void);
|
||||||
void make_walkable(JavaThread* thread) { }
|
|
||||||
|
|
||||||
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
|
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
|
||||||
|
|
||||||
|
|
|
@ -752,8 +752,7 @@ void MacroAssembler::pushptr(AddressLiteral src) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::reset_last_Java_frame(bool clear_fp,
|
void MacroAssembler::reset_last_Java_frame(bool clear_fp) {
|
||||||
bool clear_pc) {
|
|
||||||
// we must set sp to zero to clear frame
|
// we must set sp to zero to clear frame
|
||||||
movptr(Address(r15_thread, JavaThread::last_Java_sp_offset()), NULL_WORD);
|
movptr(Address(r15_thread, JavaThread::last_Java_sp_offset()), NULL_WORD);
|
||||||
// must clear fp, so that compiled frames are not confused; it is
|
// must clear fp, so that compiled frames are not confused; it is
|
||||||
|
@ -762,9 +761,8 @@ void MacroAssembler::reset_last_Java_frame(bool clear_fp,
|
||||||
movptr(Address(r15_thread, JavaThread::last_Java_fp_offset()), NULL_WORD);
|
movptr(Address(r15_thread, JavaThread::last_Java_fp_offset()), NULL_WORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear_pc) {
|
// Always clear the pc because it could have been set by make_walkable()
|
||||||
movptr(Address(r15_thread, JavaThread::last_Java_pc_offset()), NULL_WORD);
|
movptr(Address(r15_thread, JavaThread::last_Java_pc_offset()), NULL_WORD);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||||
|
@ -2531,7 +2529,7 @@ void MacroAssembler::call_VM_base(Register oop_result,
|
||||||
}
|
}
|
||||||
// reset last Java frame
|
// reset last Java frame
|
||||||
// Only interpreter should have to clear fp
|
// Only interpreter should have to clear fp
|
||||||
reset_last_Java_frame(java_thread, true, false);
|
reset_last_Java_frame(java_thread, true);
|
||||||
|
|
||||||
// C++ interp handles this in the interpreter
|
// C++ interp handles this in the interpreter
|
||||||
check_and_handle_popframe(java_thread);
|
check_and_handle_popframe(java_thread);
|
||||||
|
@ -3642,8 +3640,7 @@ void MacroAssembler::push_IU_state() {
|
||||||
pusha();
|
pusha();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp, bool clear_pc) {
|
void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp) { // determine java_thread register
|
||||||
// determine java_thread register
|
|
||||||
if (!java_thread->is_valid()) {
|
if (!java_thread->is_valid()) {
|
||||||
java_thread = rdi;
|
java_thread = rdi;
|
||||||
get_thread(java_thread);
|
get_thread(java_thread);
|
||||||
|
@ -3654,7 +3651,7 @@ void MacroAssembler::reset_last_Java_frame(Register java_thread, bool clear_fp,
|
||||||
movptr(Address(java_thread, JavaThread::last_Java_fp_offset()), NULL_WORD);
|
movptr(Address(java_thread, JavaThread::last_Java_fp_offset()), NULL_WORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear_pc)
|
// Always clear the pc because it could have been set by make_walkable()
|
||||||
movptr(Address(java_thread, JavaThread::last_Java_pc_offset()), NULL_WORD);
|
movptr(Address(java_thread, JavaThread::last_Java_pc_offset()), NULL_WORD);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,10 +288,10 @@ class MacroAssembler: public Assembler {
|
||||||
Register last_java_fp,
|
Register last_java_fp,
|
||||||
address last_java_pc);
|
address last_java_pc);
|
||||||
|
|
||||||
void reset_last_Java_frame(Register thread, bool clear_fp, bool clear_pc);
|
void reset_last_Java_frame(Register thread, bool clear_fp);
|
||||||
|
|
||||||
// thread in the default location (r15_thread on 64bit)
|
// thread in the default location (r15_thread on 64bit)
|
||||||
void reset_last_Java_frame(bool clear_fp, bool clear_pc);
|
void reset_last_Java_frame(bool clear_fp);
|
||||||
|
|
||||||
// Stores
|
// Stores
|
||||||
void store_check(Register obj); // store check for obj - register is destroyed afterwards
|
void store_check(Register obj); // store check for obj - register is destroyed afterwards
|
||||||
|
|
|
@ -117,7 +117,7 @@ void OptoRuntime::generate_exception_blob() {
|
||||||
// No registers to map, rbp is known implicitly
|
// No registers to map, rbp is known implicitly
|
||||||
oop_maps->add_gc_map( __ pc() - start, new OopMap( framesize, 0 ));
|
oop_maps->add_gc_map( __ pc() - start, new OopMap( framesize, 0 ));
|
||||||
__ get_thread(rcx);
|
__ get_thread(rcx);
|
||||||
__ reset_last_Java_frame(rcx, false, false);
|
__ reset_last_Java_frame(rcx, false);
|
||||||
|
|
||||||
// Restore callee-saved registers
|
// Restore callee-saved registers
|
||||||
__ movptr(rbp, Address(rsp, rbp_off * wordSize));
|
__ movptr(rbp, Address(rsp, rbp_off * wordSize));
|
||||||
|
|
|
@ -1330,7 +1330,7 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm,
|
||||||
__ increment(rsp, wordSize);
|
__ increment(rsp, wordSize);
|
||||||
|
|
||||||
__ get_thread(thread);
|
__ get_thread(thread);
|
||||||
__ reset_last_Java_frame(thread, false, true);
|
__ reset_last_Java_frame(thread, false);
|
||||||
|
|
||||||
save_or_restore_arguments(masm, stack_slots, total_in_args,
|
save_or_restore_arguments(masm, stack_slots, total_in_args,
|
||||||
arg_save_area, NULL, in_regs, in_sig_bt);
|
arg_save_area, NULL, in_regs, in_sig_bt);
|
||||||
|
@ -2224,7 +2224,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||||
|
|
||||||
// We can finally stop using that last_Java_frame we setup ages ago
|
// We can finally stop using that last_Java_frame we setup ages ago
|
||||||
|
|
||||||
__ reset_last_Java_frame(thread, false, true);
|
__ reset_last_Java_frame(thread, false);
|
||||||
|
|
||||||
// Unpack oop result
|
// Unpack oop result
|
||||||
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
|
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
|
||||||
|
@ -2553,7 +2553,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||||
__ pop(rcx);
|
__ pop(rcx);
|
||||||
|
|
||||||
__ get_thread(rcx);
|
__ get_thread(rcx);
|
||||||
__ reset_last_Java_frame(rcx, false, false);
|
__ reset_last_Java_frame(rcx, false);
|
||||||
|
|
||||||
// Load UnrollBlock into EDI
|
// Load UnrollBlock into EDI
|
||||||
__ mov(rdi, rax);
|
__ mov(rdi, rax);
|
||||||
|
@ -2702,7 +2702,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||||
__ push(rax);
|
__ push(rax);
|
||||||
|
|
||||||
__ get_thread(rcx);
|
__ get_thread(rcx);
|
||||||
__ reset_last_Java_frame(rcx, false, false);
|
__ reset_last_Java_frame(rcx, false);
|
||||||
|
|
||||||
// Collect return values
|
// Collect return values
|
||||||
__ movptr(rax,Address(rsp, (RegisterSaver::raxOffset() + additional_words + 1)*wordSize));
|
__ movptr(rax,Address(rsp, (RegisterSaver::raxOffset() + additional_words + 1)*wordSize));
|
||||||
|
@ -2806,7 +2806,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||||
|
|
||||||
__ get_thread(rcx);
|
__ get_thread(rcx);
|
||||||
|
|
||||||
__ reset_last_Java_frame(rcx, false, false);
|
__ reset_last_Java_frame(rcx, false);
|
||||||
|
|
||||||
// Load UnrollBlock into EDI
|
// Load UnrollBlock into EDI
|
||||||
__ movptr(rdi, rax);
|
__ movptr(rdi, rax);
|
||||||
|
@ -2912,7 +2912,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||||
oop_maps->add_gc_map( __ pc()-start, new OopMap( framesize, 0 ) );
|
oop_maps->add_gc_map( __ pc()-start, new OopMap( framesize, 0 ) );
|
||||||
|
|
||||||
__ get_thread(rdi);
|
__ get_thread(rdi);
|
||||||
__ reset_last_Java_frame(rdi, true, false);
|
__ reset_last_Java_frame(rdi, true);
|
||||||
|
|
||||||
// Pop self-frame.
|
// Pop self-frame.
|
||||||
__ leave(); // Epilog!
|
__ leave(); // Epilog!
|
||||||
|
@ -3007,7 +3007,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||||
|
|
||||||
// Clear last_Java_sp again
|
// Clear last_Java_sp again
|
||||||
__ get_thread(java_thread);
|
__ get_thread(java_thread);
|
||||||
__ reset_last_Java_frame(java_thread, false, false);
|
__ reset_last_Java_frame(java_thread, false);
|
||||||
|
|
||||||
__ cmpptr(Address(java_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
__ cmpptr(Address(java_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
||||||
__ jcc(Assembler::equal, noException);
|
__ jcc(Assembler::equal, noException);
|
||||||
|
@ -3082,7 +3082,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
|
||||||
__ addptr(rsp, wordSize);
|
__ addptr(rsp, wordSize);
|
||||||
|
|
||||||
// clear last_Java_sp
|
// clear last_Java_sp
|
||||||
__ reset_last_Java_frame(thread, true, false);
|
__ reset_last_Java_frame(thread, true);
|
||||||
// check for pending exceptions
|
// check for pending exceptions
|
||||||
Label pending;
|
Label pending;
|
||||||
__ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
__ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
||||||
|
|
|
@ -1461,7 +1461,7 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm,
|
||||||
__ mov(rsp, r12); // restore sp
|
__ mov(rsp, r12); // restore sp
|
||||||
__ reinit_heapbase();
|
__ reinit_heapbase();
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, true);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
save_or_restore_arguments(masm, stack_slots, total_in_args,
|
save_or_restore_arguments(masm, stack_slots, total_in_args,
|
||||||
arg_save_area, NULL, in_regs, in_sig_bt);
|
arg_save_area, NULL, in_regs, in_sig_bt);
|
||||||
|
@ -2577,7 +2577,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||||
restore_native_result(masm, ret_type, stack_slots);
|
restore_native_result(masm, ret_type, stack_slots);
|
||||||
}
|
}
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, true);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
// Unpack oop result
|
// Unpack oop result
|
||||||
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
|
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
|
||||||
|
@ -2849,7 +2849,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
|
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
|
||||||
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
|
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, false);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
__ jmp(after_fetch_unroll_info_call);
|
__ jmp(after_fetch_unroll_info_call);
|
||||||
} // EnableJVMCI
|
} // EnableJVMCI
|
||||||
|
@ -2939,7 +2939,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||||
// find any register it might need.
|
// find any register it might need.
|
||||||
oop_maps->add_gc_map(__ pc() - start, map);
|
oop_maps->add_gc_map(__ pc() - start, map);
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, false);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
if (EnableJVMCI) {
|
if (EnableJVMCI) {
|
||||||
|
@ -3087,7 +3087,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||||
new OopMap( frame_size_in_words, 0 ));
|
new OopMap( frame_size_in_words, 0 ));
|
||||||
|
|
||||||
// Clear fp AND pc
|
// Clear fp AND pc
|
||||||
__ reset_last_Java_frame(true, true);
|
__ reset_last_Java_frame(true);
|
||||||
|
|
||||||
// Collect return values
|
// Collect return values
|
||||||
__ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes()));
|
__ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes()));
|
||||||
|
@ -3164,7 +3164,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||||
|
|
||||||
oop_maps->add_gc_map(__ pc() - start, map);
|
oop_maps->add_gc_map(__ pc() - start, map);
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, false);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
// Load UnrollBlock* into rdi
|
// Load UnrollBlock* into rdi
|
||||||
__ mov(rdi, rax);
|
__ mov(rdi, rax);
|
||||||
|
@ -3281,7 +3281,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||||
oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
|
oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
|
||||||
|
|
||||||
// Clear fp AND pc
|
// Clear fp AND pc
|
||||||
__ reset_last_Java_frame(true, true);
|
__ reset_last_Java_frame(true);
|
||||||
|
|
||||||
// Pop self-frame.
|
// Pop self-frame.
|
||||||
__ leave(); // Epilog
|
__ leave(); // Epilog
|
||||||
|
@ -3364,7 +3364,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||||
|
|
||||||
Label noException;
|
Label noException;
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, false);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
__ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
__ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
||||||
__ jcc(Assembler::equal, noException);
|
__ jcc(Assembler::equal, noException);
|
||||||
|
@ -3434,7 +3434,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
|
||||||
// rax contains the address we are going to jump to assuming no exception got installed
|
// rax contains the address we are going to jump to assuming no exception got installed
|
||||||
|
|
||||||
// clear last_Java_sp
|
// clear last_Java_sp
|
||||||
__ reset_last_Java_frame(false, false);
|
__ reset_last_Java_frame(false);
|
||||||
// check for pending exceptions
|
// check for pending exceptions
|
||||||
Label pending;
|
Label pending;
|
||||||
__ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
__ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
||||||
|
@ -3809,7 +3809,7 @@ void OptoRuntime::generate_exception_blob() {
|
||||||
|
|
||||||
oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
|
oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
|
||||||
|
|
||||||
__ reset_last_Java_frame(false, true);
|
__ reset_last_Java_frame(false);
|
||||||
|
|
||||||
// Restore callee-saved registers
|
// Restore callee-saved registers
|
||||||
|
|
||||||
|
|
|
@ -3766,7 +3766,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
// however can use the register value directly if it is callee saved.
|
// however can use the register value directly if it is callee saved.
|
||||||
__ get_thread(java_thread);
|
__ get_thread(java_thread);
|
||||||
|
|
||||||
__ reset_last_Java_frame(java_thread, true, false);
|
__ reset_last_Java_frame(java_thread, true);
|
||||||
|
|
||||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||||
|
|
||||||
|
|
|
@ -5018,7 +5018,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||||
|
|
||||||
oop_maps->add_gc_map(the_pc - start, map);
|
oop_maps->add_gc_map(the_pc - start, map);
|
||||||
|
|
||||||
__ reset_last_Java_frame(true, true);
|
__ reset_last_Java_frame(true);
|
||||||
|
|
||||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||||
|
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||||
__ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_Java);
|
__ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_Java);
|
||||||
|
|
||||||
// reset_last_Java_frame
|
// reset_last_Java_frame
|
||||||
__ reset_last_Java_frame(thread, true, true);
|
__ reset_last_Java_frame(thread, true);
|
||||||
|
|
||||||
// reset handle block
|
// reset handle block
|
||||||
__ movptr(t, Address(thread, JavaThread::active_handles_offset()));
|
__ movptr(t, Address(thread, JavaThread::active_handles_offset()));
|
||||||
|
@ -1659,7 +1659,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
||||||
__ set_last_Java_frame(noreg, rbp, __ pc());
|
__ set_last_Java_frame(noreg, rbp, __ pc());
|
||||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), r15_thread, c_rarg1, c_rarg2);
|
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), r15_thread, c_rarg1, c_rarg2);
|
||||||
#endif
|
#endif
|
||||||
__ reset_last_Java_frame(thread, true, true);
|
__ reset_last_Java_frame(thread, true);
|
||||||
|
|
||||||
// Restore the last_sp and null it out
|
// Restore the last_sp and null it out
|
||||||
__ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
|
__ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
|
||||||
|
|
|
@ -45,7 +45,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||||
|
|
||||||
// If we have a last_Java_frame, then we should use it even if
|
// If we have a last_Java_frame, then we should use it even if
|
||||||
// isInJava == true. It should be more reliable than ucontext info.
|
// isInJava == true. It should be more reliable than ucontext info.
|
||||||
if (jt->has_last_Java_frame()) {
|
if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
|
||||||
*fr_addr = jt->pd_last_frame();
|
*fr_addr = jt->pd_last_frame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,8 @@
|
||||||
|
|
||||||
frame pd_last_frame() {
|
frame pd_last_frame() {
|
||||||
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
||||||
if (_anchor.last_Java_pc() != NULL) {
|
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
||||||
} else {
|
|
||||||
// This will pick up pc from sp
|
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -46,7 +46,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||||
|
|
||||||
// If we have a last_Java_frame, then we should use it even if
|
// If we have a last_Java_frame, then we should use it even if
|
||||||
// isInJava == true. It should be more reliable than ucontext info.
|
// isInJava == true. It should be more reliable than ucontext info.
|
||||||
if (jt->has_last_Java_frame()) {
|
if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
|
||||||
*fr_addr = jt->pd_last_frame();
|
*fr_addr = jt->pd_last_frame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,8 @@
|
||||||
|
|
||||||
frame pd_last_frame() {
|
frame pd_last_frame() {
|
||||||
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
||||||
if (_anchor.last_Java_pc() != NULL) {
|
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
||||||
} else {
|
|
||||||
// This will pick up pc from sp
|
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -45,9 +45,8 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr,
|
||||||
assert(this->is_Java_thread(), "must be JavaThread");
|
assert(this->is_Java_thread(), "must be JavaThread");
|
||||||
JavaThread* jt = (JavaThread *)this;
|
JavaThread* jt = (JavaThread *)this;
|
||||||
|
|
||||||
// last_Java_frame is always walkable and safe use it if we have it
|
// There is small window where last_Java_frame is not walkable or safe
|
||||||
|
if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
|
||||||
if (jt->has_last_Java_frame()) {
|
|
||||||
*fr_addr = jt->pd_last_frame();
|
*fr_addr = jt->pd_last_frame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,12 +30,8 @@
|
||||||
|
|
||||||
frame pd_last_frame() {
|
frame pd_last_frame() {
|
||||||
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
||||||
if (_anchor.last_Java_pc() != NULL) {
|
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
||||||
} else {
|
|
||||||
// This will pick up pc from sp
|
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -48,7 +48,7 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
|
||||||
|
|
||||||
// If we have a last_Java_frame, then we should use it even if
|
// If we have a last_Java_frame, then we should use it even if
|
||||||
// isInJava == true. It should be more reliable than CONTEXT info.
|
// isInJava == true. It should be more reliable than CONTEXT info.
|
||||||
if (jt->has_last_Java_frame()) {
|
if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
|
||||||
*fr_addr = jt->pd_last_frame();
|
*fr_addr = jt->pd_last_frame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,8 @@
|
||||||
|
|
||||||
frame pd_last_frame() {
|
frame pd_last_frame() {
|
||||||
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
|
||||||
if (_anchor.last_Java_pc() != NULL) {
|
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
|
||||||
} else {
|
|
||||||
// This will pick up pc from sp
|
|
||||||
return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue