< prev index next >
src/cpu/x86/vm/runtime_x86_64.cpp
Print this page
*** 36,46 ****
--- 36,86 ----
#include "runtime/vframeArray.hpp"
#include "utilities/globalDefinitions.hpp"
#include "vmreg_x86.inline.hpp"
#endif
+ #define __ masm->
+
+ #ifdef COMPILER2
+
+ // A wrapper for complete_monitor_unlocking_C() which sets last_Java_sp and _pc
+ // to reasonable values so stack walks become possible.
+ void OptoRuntime::generate_complete_monitor_unlocking_wrapper() {
+ // Allocate space for the code
+ ResourceMark rm;
+ // Setup code generation tools
+ CodeBuffer buffer("complete_monitor_unlocking_wrapper", 256, 128);
+ MacroAssembler* masm = new MacroAssembler(&buffer);
+
+ address start = __ pc();
+
+ assert_different_registers(rscratch1, c_rarg0, c_rarg1); // don't touch arguments
+
+ __ lea(rscratch1, Address(rsp, wordSize));
+ __ movptr(Address(r15_thread, JavaThread::last_Java_sp_offset()), rscratch1);
+
+ __ movptr(rscratch1, Address(rsp, 0));
+ __ movptr(Address(r15_thread, JavaThread::last_Java_pc_offset()), rscratch1);
+
+ __ subptr(rsp, wordSize); // align stack for call
+ __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C)));
+ __ addptr(rsp, wordSize);
+
+ __ reset_last_Java_frame(false, true);
+
+ __ ret(0);
+
+ // Make sure all code is generated
+ masm->flush();
+
+ // Set exception blob
+ _complete_monitor_unlocking_wrapper = RuntimeStub::new_runtime_stub(
+ buffer.name(), &buffer, CodeOffsets::frame_never_safe, 2 * wordSize, NULL, false);
+ }
// This file should really contain the code for generating the OptoRuntime
// exception_blob. However that code uses SimpleRuntimeFrame which only
// exists in sharedRuntime_x86_64.cpp. When there is a sharedRuntime_<arch>.hpp
// file and SimpleRuntimeFrame is able to move there then the exception_blob
// code will move here where it belongs.
+
+ #endif // COMPILER2
< prev index next >