--- old/src/hotspot/share/runtime/javaCalls.cpp 2019-07-17 11:42:54.277311130 -0400 +++ new/src/hotspot/share/runtime/javaCalls.cpp 2019-07-17 11:42:54.053311138 -0400 @@ -346,9 +346,6 @@ assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation"); assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here"); - - CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();) - #if INCLUDE_JVMCI // Gets the nmethod (if any) that should be called instead of normal target nmethod* alternative_target = args->alternative_target(); @@ -395,10 +392,6 @@ BasicType result_type = runtime_type_from(result); bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY); - // NOTE: if we move the computation of the result_val_address inside - // the call to call_stub, the optimizer produces wrong code. - intptr_t* result_val_address = (intptr_t*)(result->get_value_addr()); - // Find receiver Handle receiver = (!method->is_static()) ? args->receiver() : Handle(); @@ -436,6 +429,11 @@ { JavaCallWrapper link(method, receiver, result, CHECK); { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner + // NOTE: if we move the computation of the result_val_address inside + // the call to call_stub, the optimizer produces wrong code. + intptr_t* result_val_address = (intptr_t*)(result->get_value_addr()); + intptr_t* parameter_address = args->parameters(); + StubRoutines::call_stub()( (address)&link, // (intptr_t*)&(result->_value), // see NOTE above (compiler problem) @@ -443,7 +441,7 @@ result_type, method(), entry_point, - args->parameters(), + parameter_address, args->size_of_parameters(), CHECK );