src/share/vm/runtime/sharedRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
JDK-8022494 Cdiff src/share/vm/runtime/sharedRuntime.cpp
src/share/vm/runtime/sharedRuntime.cpp
Print this page
*** 2561,2575 ****
return true;
}
#endif
! // Create a native wrapper for this native method. The wrapper converts the
! // java compiled calling convention to the native convention, handlizes
! // arguments, and transitions to native. On return from the native we transition
! // back to java blocking if a safepoint is in progress.
! nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method, int compile_id) {
ResourceMark rm;
nmethod* nm = NULL;
assert(method->is_native(), "must be native");
assert(method->is_method_handle_intrinsic() ||
--- 2561,2577 ----
return true;
}
#endif
! /**
! * Create a native wrapper for this native method. The wrapper converts the
! * Java-compiled calling convention to the native convention, handles
! * arguments, and transitions to native. On return from the native we transition
! * back to java blocking if a safepoint is in progress.
! */
! void AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
ResourceMark rm;
nmethod* nm = NULL;
assert(method->is_native(), "must be native");
assert(method->is_method_handle_intrinsic() ||
*** 2578,2593 ****
{
// perform the work while holding the lock, but perform any printing outside the lock
MutexLocker mu(AdapterHandlerLibrary_lock);
// See if somebody beat us to it
nm = method->code();
! if (nm) {
! return nm;
}
- ResourceMark rm;
BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
if (buf != NULL) {
CodeBuffer buffer(buf);
double locs_buf[20];
buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
--- 2580,2606 ----
{
// perform the work while holding the lock, but perform any printing outside the lock
MutexLocker mu(AdapterHandlerLibrary_lock);
// See if somebody beat us to it
nm = method->code();
! if (nm != NULL) {
! return;
! }
!
! const int compile_id = CompileBroker::assign_compile_id(method, CompileBroker::standard_entry_bci);
! if (compile_id == 0) {
! // The compilation falls outside the allowed range. Note that this can only happen in debug
! // build if the cIStart(OSR) and CIStop(OSR) flags at are specified. Since currently this wrapper
! // must be generated for method handle intrinsics (8026407), print out a warning.
! if (method->is_method_handle_intrinsic()) {
! warning("Must generate wrapper for method handle intrinsic");
! return;
! }
}
+ ResourceMark rm;
BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
if (buf != NULL) {
CodeBuffer buffer(buf);
double locs_buf[20];
buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
*** 2615,2648 ****
// are just trampolines so the argument registers must be outgoing ones.
const bool is_outgoing = method->is_method_handle_intrinsic();
int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, is_outgoing);
// Generate the compiled-to-native wrapper code
! nm = SharedRuntime::generate_native_wrapper(&_masm,
! method,
! compile_id,
! sig_bt,
! regs,
! ret_type);
}
}
- // Must unlock before calling set_code
// Install the generated code.
if (nm != NULL) {
if (PrintCompilation) {
ttyLocker ttyl;
CompileTask::print_compilation(tty, nm, method->is_static() ? "(static)" : "");
}
- method->set_code(method, nm);
nm->post_compiled_method_load_event();
} else {
// CodeCache is full, disable compilation
CompileBroker::handle_full_code_cache();
}
! return nm;
}
JRT_ENTRY_NO_ASYNC(void, SharedRuntime::block_for_jni_critical(JavaThread* thread))
assert(thread == JavaThread::current(), "must be");
// The code is about to enter a JNI lazy critical native method and
--- 2628,2658 ----
// are just trampolines so the argument registers must be outgoing ones.
const bool is_outgoing = method->is_method_handle_intrinsic();
int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, is_outgoing);
// Generate the compiled-to-native wrapper code
! nm = SharedRuntime::generate_native_wrapper(&_masm, method, compile_id, sig_bt, regs, ret_type);
!
! if (nm != NULL) {
! method->set_code(method, nm);
}
}
+ } // Unlock AdapterHandlerLibrary_lock
// Install the generated code.
if (nm != NULL) {
if (PrintCompilation) {
ttyLocker ttyl;
CompileTask::print_compilation(tty, nm, method->is_static() ? "(static)" : "");
}
nm->post_compiled_method_load_event();
} else {
// CodeCache is full, disable compilation
CompileBroker::handle_full_code_cache();
}
! return;
}
JRT_ENTRY_NO_ASYNC(void, SharedRuntime::block_for_jni_critical(JavaThread* thread))
assert(thread == JavaThread::current(), "must be");
// The code is about to enter a JNI lazy critical native method and
src/share/vm/runtime/sharedRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File