Skip to content

Commit e1c58f8

Browse files
committed
8360540: nmethod entry barriers of new nmethods should be disarmed
Reviewed-by: eosterlund, tschatzl
1 parent f0498c2 commit e1c58f8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#include "gc/g1/g1VMOperations.hpp"
7575
#include "gc/g1/g1YoungCollector.hpp"
7676
#include "gc/g1/g1YoungGCAllocationFailureInjector.hpp"
77+
#include "gc/shared/barrierSetNMethod.hpp"
7778
#include "gc/shared/classUnloadingContext.hpp"
7879
#include "gc/shared/concurrentGCBreakpoints.hpp"
7980
#include "gc/shared/fullGCForwarding.hpp"
@@ -3079,6 +3080,8 @@ void G1CollectedHeap::register_nmethod(nmethod* nm) {
30793080
guarantee(nm != nullptr, "sanity");
30803081
RegisterNMethodOopClosure reg_cl(this, nm);
30813082
nm->oops_do(&reg_cl);
3083+
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
3084+
bs_nm->disarm(nm);
30823085
}
30833086

30843087
void G1CollectedHeap::unregister_nmethod(nmethod* nm) {

src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "gc/parallel/psPromotionManager.hpp"
3333
#include "gc/parallel/psScavenge.hpp"
3434
#include "gc/parallel/psVMOperations.hpp"
35+
#include "gc/shared/barrierSetNMethod.hpp"
3536
#include "gc/shared/fullGCForwarding.inline.hpp"
3637
#include "gc/shared/gcHeapSummary.hpp"
3738
#include "gc/shared/gcLocker.inline.hpp"
@@ -861,6 +862,8 @@ void ParallelScavengeHeap::complete_loaded_archive_space(MemRegion archive_space
861862

862863
void ParallelScavengeHeap::register_nmethod(nmethod* nm) {
863864
ScavengableNMethods::register_nmethod(nm);
865+
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
866+
bs_nm->disarm(nm);
864867
}
865868

866869
void ParallelScavengeHeap::unregister_nmethod(nmethod* nm) {

src/hotspot/share/gc/serial/serialHeap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "gc/serial/serialMemoryPools.hpp"
3535
#include "gc/serial/serialVMOperations.hpp"
3636
#include "gc/serial/tenuredGeneration.inline.hpp"
37+
#include "gc/shared/barrierSetNMethod.hpp"
3738
#include "gc/shared/cardTableBarrierSet.hpp"
3839
#include "gc/shared/classUnloadingContext.hpp"
3940
#include "gc/shared/collectedHeap.inline.hpp"
@@ -432,6 +433,8 @@ bool SerialHeap::do_young_collection(bool clear_soft_refs) {
432433

433434
void SerialHeap::register_nmethod(nmethod* nm) {
434435
ScavengableNMethods::register_nmethod(nm);
436+
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
437+
bs_nm->disarm(nm);
435438
}
436439

437440
void SerialHeap::unregister_nmethod(nmethod* nm) {

0 commit comments

Comments
 (0)