Skip to content

Commit 94cca4b

Browse files
fparainTobiHartmanncoleenpliachMatias Saavedra Silva
committed
8366705: [lworld] Re-work of arrays meta-data
Co-authored-by: Tobias Hartmann <[email protected]> Co-authored-by: Coleen Phillimore <[email protected]> Co-authored-by: Chen Liang <[email protected]> Co-authored-by: Matias Saavedra Silva <[email protected]> Reviewed-by: coleenp, thartmann, dsimms
1 parent b53b049 commit 94cca4b

File tree

164 files changed

+3599
-1726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+3599
-1726
lines changed

make/modules/java.base/gensrc/GensrcVarHandles.gmk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@ define GenerateVarHandle
7171
$1_ARGS += -KReference
7272
$1_ARGS += -KNonPlainAccess
7373
$1_ARGS += -KStatic
74-
$1_ARGS += -KArray
7574
endif
7675

7776
ifeq ($$($1_InputType), NonAtomicReference)
7877
$1_ARGS += -KReference
7978
$1_ARGS += -KStatic
8079
$1_Type := Reference
81-
$1_ARGS += -KArray
8280
endif
8381

8482
ifeq ($$($1_InputType), FlatValue)

make/test/BuildMicrobenchmark.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
9494
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
9595
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
9696
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
97+
--add-exports java.base/jdk.internal.value=ALL-UNNAMED \
9798
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
9899
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
99100
--add-exports java.base/sun.security.util=ALL-UNNAMED \

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
12481248
Register len = op->len()->as_register();
12491249
__ uxtw(len, len);
12501250

1251-
if (UseSlowPath || op->is_null_free() ||
1251+
if (UseSlowPath || op->always_slow_path() ||
12521252
(!UseFastNewObjectArray && is_reference_type(op->type())) ||
12531253
(!UseFastNewTypeArray && !is_reference_type(op->type()))) {
12541254
__ b(*op->stub()->entry());

src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,14 +1204,19 @@ void LIRGenerator::do_NewObjectArray(NewObjectArray* x) {
12041204
length.load_item_force(FrameMap::r19_opr);
12051205
LIR_Opr len = length.result();
12061206

1207-
ciKlass* obj = (ciKlass*) x->exact_type();
1208-
CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info, x->is_null_free());
1207+
ciKlass* obj = ciArrayKlass::make(x->klass(), false, true, true);
1208+
1209+
// TODO 8265122 Implement a fast path for this
1210+
bool is_flat = obj->is_loaded() && obj->is_flat_array_klass();
1211+
bool is_null_free = obj->is_loaded() && obj->as_array_klass()->is_elem_null_free();
1212+
1213+
CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info, is_null_free);
12091214
if (obj == ciEnv::unloaded_ciobjarrayklass()) {
12101215
BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error");
12111216
}
12121217

12131218
klass2reg_with_patching(klass_reg, obj, patching_info);
1214-
__ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path, true, x->is_null_free());
1219+
__ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path, true, is_null_free || is_flat);
12151220

12161221
LIR_Opr result = rlock_result(x);
12171222
__ move(reg, result);
@@ -1287,9 +1292,6 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
12871292
CodeEmitInfo* info_for_exception =
12881293
(x->needs_exception_state() ? state_for(x) :
12891294
state_for(x, x->state_before(), true /*ignore_xhandler*/));
1290-
if (x->is_null_free()) {
1291-
__ null_check(obj.result(), new CodeEmitInfo(info_for_exception));
1292-
}
12931295

12941296
CodeStub* stub;
12951297
if (x->is_incompatible_class_change_check()) {

src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,16 +747,16 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
747747
__ stop("assert(is a type array klass)");
748748
break;
749749
case C1StubId::new_object_array_id:
750-
__ cmpw(t0, Klass::_lh_array_tag_obj_value); // new "[Ljava/lang/Object;"
750+
__ cmpw(t0, Klass::_lh_array_tag_ref_value); // new "[Ljava/lang/Object;"
751751
__ br(Assembler::EQ, ok);
752-
__ cmpw(t0, Klass::_lh_array_tag_vt_value); // new "[LVT;"
752+
__ cmpw(t0, Klass::_lh_array_tag_flat_value); // new "[LVT;"
753753
__ br(Assembler::EQ, ok);
754754
__ stop("assert(is an object or inline type array klass)");
755755
break;
756756
case C1StubId::new_null_free_array_id:
757-
__ cmpw(t0, Klass::_lh_array_tag_vt_value); // the array can be a flat array.
757+
__ cmpw(t0, Klass::_lh_array_tag_flat_value); // the array can be a flat array.
758758
__ br(Assembler::EQ, ok);
759-
__ cmpw(t0, Klass::_lh_array_tag_obj_value); // the array cannot be a flat array (due to InlineArrayElementMaxFlatSize, etc)
759+
__ cmpw(t0, Klass::_lh_array_tag_ref_value); // the array cannot be a flat array (due to the InlineArrayElementMaxFlatSize, etc.)
760760
__ br(Assembler::EQ, ok);
761761
__ stop("assert(is an object or inline type array klass)");
762762
break;

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,12 +2265,6 @@ void MacroAssembler::test_markword_is_inline_type(Register markword, Label& is_i
22652265
br(Assembler::EQ, is_inline_type);
22662266
}
22672267

2268-
void MacroAssembler::test_klass_is_inline_type(Register klass, Register temp_reg, Label& is_inline_type) {
2269-
ldrh(temp_reg, Address(klass, Klass::access_flags_offset()));
2270-
andr(temp_reg, temp_reg, JVM_ACC_IDENTITY);
2271-
cbz(temp_reg, is_inline_type);
2272-
}
2273-
22742268
void MacroAssembler::test_oop_is_not_inline_type(Register object, Register tmp, Label& not_inline_type, bool can_be_null) {
22752269
assert_different_registers(tmp, rscratch1);
22762270
if (can_be_null) {

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ class MacroAssembler: public Assembler {
680680
void test_markword_is_inline_type(Register markword, Label& is_inline_type);
681681

682682
// inlineKlass queries, kills temp_reg
683-
void test_klass_is_inline_type(Register klass, Register temp_reg, Label& is_inline_type);
684683
void test_oop_is_not_inline_type(Register object, Register tmp, Label& not_inline_type, bool can_be_null = true);
685684

686685
void test_field_is_null_free_inline_type(Register flags, Register temp_reg, Label& is_null_free);

src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
442442
#ifdef ASSERT
443443
// Assert object type is really an array of the proper kind.
444444
{
445-
int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value;
445+
int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value;
446446
Label ok;
447447
__ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2);
448448
__ srawi(R0, R0, Klass::_lh_array_tag_shift);

src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
753753
Register tmp = obj;
754754
__ lwu(tmp, Address(klass, Klass::layout_helper_offset()));
755755
__ sraiw(tmp, tmp, Klass::_lh_array_tag_shift);
756-
int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value);
756+
int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value);
757757
__ mv(t0, tag);
758758
__ beq(t0, tmp, ok);
759759
__ stop("assert(is an array klass)");

src/hotspot/cpu/s390/c1_Runtime1_s390.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
396396
__ mem2reg_opt(t0, Address(klass, Klass::layout_helper_offset()), false);
397397
__ z_sra(t0, Klass::_lh_array_tag_shift);
398398
int tag = ((id == C1StubId::new_type_array_id)
399-
? Klass::_lh_array_tag_type_value
400-
: Klass::_lh_array_tag_obj_value);
399+
? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_ref_value);
401400
__ compare32_and_branch(t0, tag, Assembler::bcondEqual, ok);
402401
__ stop("assert(is an array klass)");
403402
__ should_not_reach_here();

0 commit comments

Comments
 (0)