Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHeidinga committed Apr 17, 2024
1 parent 93e154e commit b370cd1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Expand Up @@ -3611,7 +3611,7 @@ void TemplateTable::_new() {
__ ldrw(r3,
Address(r4,
Klass::layout_helper_offset()));
// test to see if it has a finalizer or is malformed in some way
// test to see if it is malformed in some way
__ tbnz(r3, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);

// Allocate the instance:
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/arm/templateTable_arm.cpp
Expand Up @@ -3971,7 +3971,7 @@ void TemplateTable::_new() {
__ b(slow_case, ne);
__ load_resolved_klass_at_offset(Rcpool, Rindex, Rklass);

// make sure klass is initialized & doesn't have finalizer
// make sure klass is initialized
// make sure klass is fully initialized
__ ldrb(Rtemp, Address(Rklass, InstanceKlass::init_state_offset()));
__ cmp(Rtemp, InstanceKlass::fully_initialized);
Expand All @@ -3980,7 +3980,7 @@ void TemplateTable::_new() {
// get instance_size in InstanceKlass (scaled to a count of bytes)
__ ldr_u32(Rsize, Address(Rklass, Klass::layout_helper_offset()));

// test to see if it has a finalizer or is malformed in some way
// test to see if it is malformed in some way
// Klass::_lh_instance_slow_path_bit is really a bit mask, not bit number
__ tbnz(Rsize, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/templateTable_riscv.cpp
Expand Up @@ -3554,7 +3554,7 @@ void TemplateTable::_new() {

// get instance_size in InstanceKlass (scaled to a count of bytes)
__ lwu(x13, Address(x14, Klass::layout_helper_offset()));
// test to see if it has a finalizer or is malformed in some way
// test to see if is malformed in some way
__ test_bit(t0, x13, exact_log2(Klass::_lh_instance_slow_path_bit));
__ bnez(t0, slow_case);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/cpu/x86/templateTable_x86.cpp
Expand Up @@ -4057,10 +4057,9 @@ void TemplateTable::_new() {
__ jcc(Assembler::notEqual, slow_case);
#endif

// make sure klass doesn't have finalizer
// get instance_size in InstanceKlass (scaled to a count of bytes)
__ movl(rdx, Address(rcx, Klass::layout_helper_offset()));
// test to see if it has a finalizer or is malformed in some way
// test to see if it is malformed in some way
__ testl(rdx, Klass::_lh_instance_slow_path_bit);
__ jcc(Assembler::notZero, slow_case);

Expand Down
6 changes: 1 addition & 5 deletions src/hotspot/share/oops/instanceKlass.cpp
Expand Up @@ -1511,11 +1511,7 @@ instanceOop InstanceKlass::register_finalizer(instanceOop i, TRAPS) {
instanceOop InstanceKlass::allocate_instance(TRAPS) {
bool has_finalizer_flag = has_finalizer(); // Query before possible GC
size_t size = size_helper(); // Query before forming handle.

instanceOop i;

i = (instanceOop)Universe::heap()->obj_allocate(this, size, CHECK_NULL);
return i;
return (instanceOop)Universe::heap()->obj_allocate(this, size, CHECK_NULL);
}

instanceOop InstanceKlass::allocate_instance(oop java_class, TRAPS) {
Expand Down

0 comments on commit b370cd1

Please sign in to comment.