Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8252854: [lworld] Buffering in C1 entry can trigger safepoint before nmethod entry barrier has been executed #180

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -366,13 +366,14 @@ void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_by

build_frame_helper(frame_size_in_bytes, 0, needs_stack_repair);

BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(this);

if (needs_stack_repair && verified_inline_entry_label != NULL) {
// Jump here from the scalarized entry points that require additional stack space
// for packing scalarized arguments and therefore already created the frame.
bind(*verified_inline_entry_label);
}
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(this);
}

void C1_MacroAssembler::verified_entry() {
@@ -427,6 +428,10 @@ int C1_MacroAssembler::scalarized_entry(const CompiledEntrySignature* ces, int f
// Initialize orig_pc to detect deoptimization during buffering in below runtime call
movptr(Address(rsp, sp_offset_for_orig_pc), 0);

// The runtime call might safepoint, make sure nmethod entry barrier is executed
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(this);

// FIXME -- call runtime only if we cannot in-line allocate all the incoming inline type args.
movptr(rbx, (intptr_t)(ces->method()));
if (is_inline_ro_entry) {