From 194bceca3a4d13d4528b86359ee9d5eead3ce7ac Mon Sep 17 00:00:00 2001 From: Per Liden Date: Mon, 3 May 2021 13:34:49 +0000 Subject: [PATCH] 8265984: Concurrent GC: Some tests fail "assert(is_frame_safe(f)) failed: Frame must be safe" Reviewed-by: eosterlund, stefank, zgu --- src/hotspot/share/gc/z/zBarrierSetNMethod.cpp | 5 ++++- src/hotspot/share/opto/runtime.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp b/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp index 7047830305ec8..9916178cc2c54 100644 --- a/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp +++ b/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "gc/z/zNMethod.hpp" #include "gc/z/zThreadLocalData.hpp" #include "logging/log.hpp" +#include "runtime/threadWXSetters.inline.hpp" bool ZBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) { ZLocker locker(ZNMethod::lock_for_nmethod(nm)); @@ -40,6 +41,8 @@ bool ZBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) { return true; } + MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current())); + if (nm->is_unloading()) { // We don't need to take the lock when unlinking nmethods from // the Method, because it is only concurrently unlinked by diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index 538181acbb13f..f7d8328005973 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -1377,7 +1377,7 @@ address OptoRuntime::handle_exception_C(JavaThread* current) { // deoptimized frame if (nm != NULL) { - RegisterMap map(current, false /* update_map */, false /* process_frames */); + RegisterMap map(current, false); frame caller = current->last_frame().sender(&map); #ifdef ASSERT assert(caller.is_compiled_frame(), "must be");