8265984: Concurrent GC: Some tests fail "assert(is_frame_safe(f)) failed: Frame must be safe"

Reviewed-by: eosterlund, stefank, zgu
This commit is contained in:
Per Liden 2021-05-03 13:34:49 +00:00
parent 1d9ea3ae0f
commit 194bceca3a
2 changed files with 5 additions and 2 deletions

View File

@ -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<ZReentrantLock> 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

View File

@ -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");