Skip to content

Commit

Permalink
8324125: Improve class initialization barrier in TemplateTable::_new …
Browse files Browse the repository at this point in the history
…for RISC-V

Reviewed-by: fyang, rehn
  • Loading branch information
zifeihan authored and RealFYang committed Jan 30, 2024
1 parent b6d364a commit a1d65eb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/hotspot/cpu/riscv/templateTable_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3547,11 +3547,10 @@ void TemplateTable::_new() {
// get InstanceKlass
__ load_resolved_klass_at_offset(x14, x13, x14, t0);

// make sure klass is initialized & doesn't have finalizer
// make sure klass is fully initialized
__ lbu(t0, Address(x14, InstanceKlass::init_state_offset()));
__ sub(t1, t0, (u1)InstanceKlass::fully_initialized);
__ bnez(t1, slow_case);
// make sure klass is initialized
assert(VM_Version::supports_fast_class_init_checks(),
"Optimization requires support for fast class initialization checks");
__ clinit_barrier(x14, t0, nullptr /*L_fast_path*/, &slow_case);

// get instance_size in InstanceKlass (scaled to a count of bytes)
__ lwu(x13, Address(x14, Klass::layout_helper_offset()));
Expand Down

1 comment on commit a1d65eb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.