Skip to content

Commit 466ec30

Browse files
committedMay 24, 2023
8302736: Major performance regression in Math.log on aarch64
Reviewed-by: thartmann, dlong, aph
1 parent 05c095c commit 466ec30

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed
 

‎src/hotspot/share/opto/runtime.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -1562,10 +1562,6 @@ address OptoRuntime::handle_exception_C(JavaThread* current) {
15621562
// *THIS IS NOT RECOMMENDED PROGRAMMING STYLE*
15631563
//
15641564
address OptoRuntime::rethrow_C(oopDesc* exception, JavaThread* thread, address ret_pc) {
1565-
1566-
// Enable WXWrite: the function called directly by compiled code.
1567-
MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread));
1568-
15691565
// ret_pc will have been loaded from the stack, so for AArch64 will be signed.
15701566
// This needs authenticating, but to do that here requires the fp of the previous frame.
15711567
// A better way of doing it would be authenticate in the caller by adding a

‎src/hotspot/share/runtime/continuationFreezeThaw.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ static JRT_LEAF(intptr_t*, thaw(JavaThread* thread, int kind))
248248
// JRT_ENTRY instead?
249249
ResetNoHandleMark rnhm;
250250

251+
// we might modify the code cache via BarrierSetNMethod::nmethod_entry_barrier
252+
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, thread));
251253
return ConfigT::thaw(thread, (Continuation::thaw_kind)kind);
252254
JRT_END
253255

‎src/hotspot/share/runtime/interfaceSupport.inline.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ class VMNativeEntryWrapper {
260260

261261
#define VM_LEAF_BASE(result_type, header) \
262262
debug_only(NoHandleMark __hm;) \
263-
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, \
264-
JavaThread::current())); \
265263
os::verify_stack_alignment(); \
266264
/* begin of body */
267265

‎src/hotspot/share/runtime/sharedRuntime.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* curr
479479
return StubRoutines::cont_returnBarrierExc();
480480
}
481481

482+
// write lock needed because we might update the pc desc cache via PcDescCache::add_pc_desc
483+
MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, current));
484+
482485
// The fastest case first
483486
CodeBlob* blob = CodeCache::find_blob(return_address);
484487
CompiledMethod* nm = (blob != nullptr) ? blob->as_compiled_method_or_null() : nullptr;
@@ -2058,6 +2061,9 @@ JRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address cal
20582061
return;
20592062
}
20602063

2064+
// write lock needed because we might update the pc desc cache via PcDescCache::add_pc_desc
2065+
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, JavaThread::current()));
2066+
20612067
CodeBlob* cb = CodeCache::find_blob(caller_pc);
20622068
if (cb == nullptr || !cb->is_compiled() || callee->is_unloading()) {
20632069
return;

0 commit comments

Comments
 (0)