Mercurial > hg > graal-jvmci-8
changeset 23758:ca5c97226d1c
Try to load the MDO on return from frequency_counter_overflow
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 21 Sep 2016 20:15:14 -0700 |
parents | aaed278a9cf1 |
children | 561a3f3a9b99 |
files | src/cpu/x86/vm/templateInterpreter_x86_32.cpp src/cpu/x86/vm/templateInterpreter_x86_64.cpp src/cpu/x86/vm/templateTable_x86_32.cpp src/cpu/x86/vm/templateTable_x86_64.cpp |
diffstat | 4 files changed, 22 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Wed Sep 21 20:14:12 2016 -0700 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Wed Sep 21 20:15:14 2016 -0700 @@ -443,6 +443,7 @@ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax); __ movptr(rbx, Address(rbp, method_offset)); // restore Method* + __ set_method_data_pointer_for_bcp(); // Preserve invariant that rsi/rdi contain bcp/locals of sender frame // and jump to the interpreted entry.
--- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Wed Sep 21 20:14:12 2016 -0700 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Wed Sep 21 20:15:14 2016 -0700 @@ -404,6 +404,7 @@ c_rarg1); __ movptr(rbx, Address(rbp, method_offset)); // restore Method* + __ set_method_data_pointer_for_bcp(); // Preserve invariant that r13/r14 contain bcp/locals of sender frame // and jump to the interpreted entry. __ jmp(*do_continue, relocInfo::none);
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp Wed Sep 21 20:14:12 2016 -0700 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp Wed Sep 21 20:15:14 2016 -0700 @@ -1726,17 +1726,18 @@ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rdx); __ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode - // rax,: osr nmethod (osr ok) or NULL (osr not possible) - // rbx,: target bytecode + Label maybe_load_mdp; + // rax: osr nmethod (osr ok) or NULL (osr not possible) + // rbx: target bytecode // rdx: scratch // rdi: locals pointer // rsi: bcp - __ testptr(rax, rax); // test result - __ jcc(Assembler::zero, dispatch); // no osr if null + __ testptr(rax, rax); // test result + __ jcc(Assembler::zero, maybe_load_mdp); // no osr if null // nmethod may have been invalidated (VM may block upon call_VM return) __ movl(rcx, Address(rax, nmethod::entry_bci_offset())); __ cmpl(rcx, InvalidOSREntryBci); - __ jcc(Assembler::equal, dispatch); + __ jcc(Assembler::equal, maybe_load_mdp); // We have the address of an on stack replacement routine in rax, // We need to prepare to execute the OSR method. First we must @@ -1766,6 +1767,11 @@ // and begin the OSR nmethod __ jmp(Address(rbx, nmethod::osr_entry_point_offset())); + + // Load the MDO in case it was created by frequency_counter_overflow + __ bind(maybe_load_mdp); + __ set_method_data_pointer_for_bcp(); + __ jmp(dispatch); } } }
--- a/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Sep 21 20:14:12 2016 -0700 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Sep 21 20:15:14 2016 -0700 @@ -1753,17 +1753,18 @@ rdx); __ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode + Label maybe_load_mdp; // rax: osr nmethod (osr ok) or NULL (osr not possible) - // ebx: target bytecode + // rbx: target bytecode // rdx: scratch // r14: locals pointer // r13: bcp __ testptr(rax, rax); // test result - __ jcc(Assembler::zero, dispatch); // no osr if null + __ jcc(Assembler::zero, maybe_load_mdp); // no osr if null // nmethod may have been invalidated (VM may block upon call_VM return) __ movl(rcx, Address(rax, nmethod::entry_bci_offset())); __ cmpl(rcx, InvalidOSREntryBci); - __ jcc(Assembler::equal, dispatch); + __ jcc(Assembler::equal, maybe_load_mdp); // We have the address of an on stack replacement routine in eax // We need to prepare to execute the OSR method. First we must @@ -1799,6 +1800,11 @@ // and begin the OSR nmethod __ jmp(Address(r13, nmethod::osr_entry_point_offset())); + + // Load the MDO in case it was created by frequency_counter_overflow + __ bind(maybe_load_mdp); + __ set_method_data_pointer_for_bcp(); + __ jmp(dispatch); } } }