Skip to content

Commit d586e57

Browse files
stefankfparain
authored andcommitted
8373864: [lworld] Hide and rename InstanceKlassFixedBlock
Reviewed-by: phubner, fparain
1 parent 718779d commit d586e57

15 files changed

+169
-124
lines changed

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) {
511511

512512
// Load fields from a buffered value with an inline class specific handler
513513
__ load_klass(rscratch1 /*dst*/, r0 /*src*/);
514-
__ ldr(rscratch1, Address(rscratch1, InstanceKlass::adr_inlineklass_fixed_block_offset()));
514+
__ ldr(rscratch1, Address(rscratch1, InlineKlass::adr_members_offset()));
515515
__ ldr(rscratch1, Address(rscratch1, InlineKlass::unpack_handler_offset()));
516516
// Unpack handler can be null if inline type is not scalarizable in returns
517517
__ cbz(rscratch1, skip);

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
771771

772772
// Load fields from a buffered value with an inline class specific handler
773773
load_klass(rscratch1 /*dst*/, r0 /*src*/);
774-
ldr(rscratch1, Address(rscratch1, InstanceKlass::adr_inlineklass_fixed_block_offset()));
774+
ldr(rscratch1, Address(rscratch1, InlineKlass::adr_members_offset()));
775775
ldr(rscratch1, Address(rscratch1, InlineKlass::unpack_handler_offset()));
776776
// Unpack handler can be null if inline type is not scalarizable in returns
777777
cbz(rscratch1, skip);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5543,7 +5543,7 @@ void MacroAssembler::flat_field_copy(DecoratorSet decorators, Register src, Regi
55435543
}
55445544

55455545
void MacroAssembler::payload_offset(Register inline_klass, Register offset) {
5546-
ldr(offset, Address(inline_klass, InstanceKlass::adr_inlineklass_fixed_block_offset()));
5546+
ldr(offset, Address(inline_klass, InlineKlass::adr_members_offset()));
55475547
ldrw(offset, Address(offset, InlineKlass::payload_offset_offset()));
55485548
}
55495549

@@ -7037,7 +7037,7 @@ int MacroAssembler::store_inline_type_fields_to_buf(ciInlineKlass* vk, bool from
70377037
if (vk != nullptr) {
70387038
far_call(RuntimeAddress(vk->pack_handler())); // no need for call info as this will not safepoint.
70397039
} else {
7040-
ldr(tmp1, Address(klass, InstanceKlass::adr_inlineklass_fixed_block_offset()));
7040+
ldr(tmp1, Address(klass, InlineKlass::adr_members_offset()));
70417041
ldr(tmp1, Address(tmp1, InlineKlass::pack_handler_offset()));
70427042
blr(tmp1);
70437043
}

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class StubGenerator: public StubCodeGenerator {
404404
__ tbz(r0, 0, is_long);
405405
// Load pack handler address
406406
__ andr(rscratch1, r0, -2);
407-
__ ldr(rscratch1, Address(rscratch1, InstanceKlass::adr_inlineklass_fixed_block_offset()));
407+
__ ldr(rscratch1, Address(rscratch1, InlineKlass::adr_members_offset()));
408408
__ ldr(rscratch1, Address(rscratch1, InlineKlass::pack_handler_jobject_offset()));
409409
__ blr(rscratch1);
410410
__ b(exit);

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) {
508508

509509
// Load fields from a buffered value with an inline class specific handler
510510
__ load_klass(rdi, rax, rscratch1);
511-
__ movptr(rdi, Address(rdi, InstanceKlass::adr_inlineklass_fixed_block_offset()));
511+
__ movptr(rdi, Address(rdi, InlineKlass::adr_members_offset()));
512512
__ movptr(rdi, Address(rdi, InlineKlass::unpack_handler_offset()));
513513
// Unpack handler can be null if inline type is not scalarizable in returns
514514
__ testptr(rdi, rdi);

src/hotspot/cpu/x86/interp_masm_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
10811081
#else
10821082
// Load fields from a buffered value with an inline class specific handler
10831083
load_klass(rdi, rax, rscratch1);
1084-
movptr(rdi, Address(rdi, InstanceKlass::adr_inlineklass_fixed_block_offset()));
1084+
movptr(rdi, Address(rdi, InlineKlass::adr_members_offset()));
10851085
movptr(rdi, Address(rdi, InlineKlass::unpack_handler_offset()));
10861086
// Unpack handler can be null if inline type is not scalarizable in returns
10871087
testptr(rdi, rdi);

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5524,7 +5524,7 @@ void MacroAssembler::flat_field_copy(DecoratorSet decorators, Register src, Regi
55245524
}
55255525

55265526
void MacroAssembler::payload_offset(Register inline_klass, Register offset) {
5527-
movptr(offset, Address(inline_klass, InstanceKlass::adr_inlineklass_fixed_block_offset()));
5527+
movptr(offset, Address(inline_klass, InlineKlass::adr_members_offset()));
55285528
movl(offset, Address(offset, InlineKlass::payload_offset_offset()));
55295529
}
55305530

@@ -5977,7 +5977,7 @@ int MacroAssembler::store_inline_type_fields_to_buf(ciInlineKlass* vk, bool from
59775977
if (vk != nullptr) {
59785978
call(RuntimeAddress(vk->pack_handler())); // no need for call info as this will not safepoint.
59795979
} else {
5980-
movptr(rbx, Address(klass, InstanceKlass::adr_inlineklass_fixed_block_offset()));
5980+
movptr(rbx, Address(klass, InlineKlass::adr_members_offset()));
59815981
movptr(rbx, Address(rbx, InlineKlass::pack_handler_offset()));
59825982
call(rbx);
59835983
}

src/hotspot/cpu/x86/stubGenerator_x86_64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ address StubGenerator::generate_call_stub(address& return_address) {
392392
__ jcc(Assembler::zero, is_long);
393393
// Load pack handler address
394394
__ andptr(rax, -2);
395-
__ movptr(rax, Address(rax, InstanceKlass::adr_inlineklass_fixed_block_offset()));
395+
__ movptr(rax, Address(rax, InlineKlass::adr_members_offset()));
396396
__ movptr(rbx, Address(rax, InlineKlass::pack_handler_jobject_offset()));
397397
// Call pack handler to initialize the buffer
398398
__ call(rbx);

src/hotspot/share/ci/ciMethod.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class MethodLiveness;
4141
class Arena;
4242
class BCEscapeAnalyzer;
4343
class InlineTree;
44+
class SigEntry;
4445
class xmlStream;
4546

4647
// Whether profiling found an oop to be always, never or sometimes

src/hotspot/share/oops/inlineKlass.cpp

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,45 @@
5353
#include "utilities/copy.hpp"
5454
#include "utilities/stringUtils.hpp"
5555

56+
InlineKlass::Members::Members()
57+
: _extended_sig(nullptr),
58+
_return_regs(nullptr),
59+
_pack_handler(nullptr),
60+
_pack_handler_jobject(nullptr),
61+
_unpack_handler(nullptr),
62+
_null_reset_value_offset(0),
63+
_payload_offset(-1),
64+
_payload_size_in_bytes(-1),
65+
_payload_alignment(-1),
66+
_non_atomic_size_in_bytes(-1),
67+
_non_atomic_alignment(-1),
68+
_atomic_size_in_bytes(-1),
69+
_nullable_size_in_bytes(-1),
70+
_null_marker_offset(-1) {
71+
}
72+
5673
InlineKlass::InlineKlass() {
5774
assert(CDSConfig::is_dumping_archive() || UseSharedSpaces, "only for CDS");
5875
}
5976

60-
// Constructor
77+
// Constructor
6178
InlineKlass::InlineKlass(const ClassFileParser& parser)
6279
: InstanceKlass(parser, InlineKlass::Kind, markWord::inline_type_prototype()) {
6380
assert(is_inline_klass(), "sanity");
6481
assert(prototype_header().is_inline_type(), "sanity");
6582

66-
// Set up the offset to the InstanceKlassFixedBlock of this klass
67-
_adr_inlineklass_fixed_block = new (calculate_fixed_block_address()) InlineKlassFixedBlock;
83+
// Set up the offset to the members of this klass
84+
_adr_inline_klass_members = calculate_members_address();
6885

69-
// Addresses used for inline type calling convention
70-
set_extended_sig(nullptr);
71-
set_return_regs(nullptr);
72-
set_pack_handler(nullptr);
73-
set_pack_handler_jobject(nullptr);
74-
set_unpack_handler(nullptr);
86+
// Placement install the members
87+
new (_adr_inline_klass_members) Members();
7588

89+
// Sanity check construction of the members
7690
assert(pack_handler() == nullptr, "pack handler not null");
77-
78-
set_null_reset_value_offset(0);
79-
set_payload_offset(-1);
80-
set_payload_size_in_bytes(-1);
81-
set_payload_alignment(-1);
82-
set_non_atomic_size_in_bytes(-1);
83-
set_non_atomic_alignment(-1);
84-
set_atomic_size_in_bytes(-1);
85-
set_nullable_size_in_bytes(-1);
86-
set_null_marker_offset(-1);
8791
}
8892

89-
address InlineKlass::calculate_fixed_block_address() const {
90-
// The fix block is placed after all other fields inherited from the InstanceKlass
93+
address InlineKlass::calculate_members_address() const {
94+
// The members are placed after all other contents inherited from the InstanceKlass
9195
return end_of_instance_klass();
9296
}
9397

@@ -429,11 +433,11 @@ void InlineKlass::initialize_calling_convention(TRAPS) {
429433

430434
void InlineKlass::deallocate_contents(ClassLoaderData* loader_data) {
431435
if (extended_sig() != nullptr) {
432-
MetadataFactory::free_array<SigEntry>(loader_data, fixed_block()._extended_sig);
436+
MetadataFactory::free_array<SigEntry>(loader_data, members()._extended_sig);
433437
set_extended_sig(nullptr);
434438
}
435439
if (return_regs() != nullptr) {
436-
MetadataFactory::free_array<VMRegPair>(loader_data, fixed_block()._return_regs);
440+
MetadataFactory::free_array<VMRegPair>(loader_data, members()._return_regs);
437441
set_return_regs(nullptr);
438442
}
439443
cleanup_blobs();
@@ -651,8 +655,8 @@ void InlineKlass::remove_unshareable_info() {
651655
InstanceKlass::remove_unshareable_info();
652656

653657
// update it to point to the "buffered" copy of this class.
654-
_adr_inlineklass_fixed_block = reinterpret_cast<InlineKlassFixedBlock*>(calculate_fixed_block_address());
655-
ArchivePtrMarker::mark_pointer((address*)&_adr_inlineklass_fixed_block);
658+
_adr_inline_klass_members = calculate_members_address();
659+
ArchivePtrMarker::mark_pointer(&_adr_inline_klass_members);
656660

657661
set_extended_sig(nullptr);
658662
set_return_regs(nullptr);

0 commit comments

Comments
 (0)