< prev index next >
src/share/vm/gc/g1/heapRegionRemSet.cpp
Print this page
rev 9830 : [mq]: rev.01
*** 1,7 ****
/*
! * Copyright (c) 2001, 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2001, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 783,801 ****
--- 783,807 ----
// When concurrent readers access the contains() function
// (during the evacuation phase) no removals are allowed.
void HeapRegionRemSet::add_strong_code_root(nmethod* nm) {
assert(nm != NULL, "sanity");
+ assert((!CodeCache_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint()),
+ "should call add_strong_code_root_locked instead");
// Optimistic unlocked contains-check
if (!_code_roots.contains(nm)) {
MutexLockerEx ml(&_m, Mutex::_no_safepoint_check_flag);
add_strong_code_root_locked(nm);
}
}
void HeapRegionRemSet::add_strong_code_root_locked(nmethod* nm) {
assert(nm != NULL, "sanity");
+ assert((CodeCache_lock->owned_by_self() ||
+ (SafepointSynchronize::is_at_safepoint() &&
+ (_m.owned_by_self() || Thread::current()->is_VM_thread()))),
+ "not safely locked");
_code_roots.add(nm);
}
void HeapRegionRemSet::remove_strong_code_root(nmethod* nm) {
assert(nm != NULL, "sanity");
< prev index next >