@@ -1348,7 +1348,7 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
13481348 if (PreserveFramePointer) { st->print("sub fp, sp, #%d\n\t", 2 * wordSize); }
13491349 st->print("sub sp, sp, #%d\n\t", framesize);
13501350
1351- if (C->stub_function() == nullptr && BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr ) {
1351+ if (C->stub_function() == nullptr) {
13521352 st->print("ld t0, [guard]\n\t");
13531353 st->print("membar LoadLoad\n\t");
13541354 st->print("ld t1, [xthread, #thread_disarmed_guard_value_offset]\n\t");
@@ -1398,25 +1398,23 @@ void MachPrologNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
13981398
13991399 if (C->stub_function() == nullptr) {
14001400 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1401- if (BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
1402- // Dummy labels for just measuring the code size
1403- Label dummy_slow_path;
1404- Label dummy_continuation;
1405- Label dummy_guard;
1406- Label* slow_path = &dummy_slow_path;
1407- Label* continuation = &dummy_continuation;
1408- Label* guard = &dummy_guard;
1409- if (!Compile::current()->output()->in_scratch_emit_size()) {
1410- // Use real labels from actual stub when not emitting code for purpose of measuring its size
1411- C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
1412- Compile::current()->output()->add_stub(stub);
1413- slow_path = &stub->entry();
1414- continuation = &stub->continuation();
1415- guard = &stub->guard();
1416- }
1417- // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
1418- bs->nmethod_entry_barrier(masm, slow_path, continuation, guard);
1401+ // Dummy labels for just measuring the code size
1402+ Label dummy_slow_path;
1403+ Label dummy_continuation;
1404+ Label dummy_guard;
1405+ Label* slow_path = &dummy_slow_path;
1406+ Label* continuation = &dummy_continuation;
1407+ Label* guard = &dummy_guard;
1408+ if (!Compile::current()->output()->in_scratch_emit_size()) {
1409+ // Use real labels from actual stub when not emitting code for purpose of measuring its size
1410+ C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
1411+ Compile::current()->output()->add_stub(stub);
1412+ slow_path = &stub->entry();
1413+ continuation = &stub->continuation();
1414+ guard = &stub->guard();
14191415 }
1416+ // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
1417+ bs->nmethod_entry_barrier(masm, slow_path, continuation, guard);
14201418 }
14211419
14221420 if (VerifyStackAtCalls) {
0 commit comments