Skip to content

Commit e504cbf

Browse files
committed
Runtime batch.
1 parent 1c0ae54 commit e504cbf

17 files changed

+62
-38
lines changed

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5727,7 +5727,8 @@ void MacroAssembler::allocate_instance(Register klass, Register new_obj,
57275727
bind(initialize_header);
57285728
pop(klass);
57295729
Register mark_word = t2;
5730-
if (UseCompactObjectHeaders || EnableValhalla) {
5730+
// EnableValhalla legacy
5731+
if (UseCompactObjectHeaders || Arguments::enable_preview()) {
57315732
ldr(mark_word, Address(klass, Klass::prototype_header_offset()));
57325733
str(mark_word, Address(new_obj, oopDesc::mark_offset_in_bytes()));
57335734
} else {

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,8 @@ void TemplateTable::aastore() {
11831183

11841184
// Have a null in r0, r3=array, r2=index. Store null at ary[idx]
11851185
__ bind(is_null);
1186-
if (EnableValhalla) {
1186+
// EnableValhalla legacy
1187+
if (Arguments::enable_preview()) {
11871188
Label is_null_into_value_array_npe, store_null;
11881189

11891190
if (UseArrayFlattening) {
@@ -2031,7 +2032,8 @@ void TemplateTable::if_acmp(Condition cc) {
20312032
Register is_inline_type_mask = rscratch1;
20322033
__ mov(is_inline_type_mask, markWord::inline_type_pattern);
20332034

2034-
if (EnableValhalla) {
2035+
// EnableValhalla legacy
2036+
if (Arguments::enable_preview()) {
20352037
__ cmp(r1, r0);
20362038
__ br(Assembler::EQ, (cc == equal) ? taken : not_taken);
20372039

@@ -2782,7 +2784,8 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
27822784
__ cmp(tos_state, (u1)atos);
27832785
__ br(Assembler::NE, notObj);
27842786
// atos
2785-
if (!EnableValhalla) {
2787+
// EnableValhalla legacy
2788+
if (!Arguments::enable_preview()) {
27862789
do_oop_load(_masm, field, r0, IN_HEAP);
27872790
__ push(atos);
27882791
if (rc == may_rewrite) {
@@ -3036,7 +3039,8 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
30363039

30373040
// atos
30383041
{
3039-
if (!EnableValhalla) {
3042+
// EnableValhalla legacy
3043+
if (!Arguments::enable_preview()) {
30403044
__ pop(atos);
30413045
if (!is_static) pop_and_check_object(obj);
30423046
// Store into the field

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3647,7 +3647,8 @@ void MacroAssembler::allocate_instance(Register klass, Register new_obj,
36473647

36483648
// initialize object header only.
36493649
bind(initialize_header);
3650-
if (UseCompactObjectHeaders || EnableValhalla) {
3650+
// EnableValhalla legacy
3651+
if (UseCompactObjectHeaders || Arguments::enable_preview()) {
36513652
pop(klass);
36523653
Register mark_word = t2;
36533654
movptr(mark_word, Address(klass, Klass::prototype_header_offset()));

src/hotspot/cpu/x86/templateTable_x86.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,8 @@ void TemplateTable::aastore() {
11311131

11321132
// Have a null in rax, rdx=array, ecx=index. Store null at ary[idx]
11331133
__ bind(is_null);
1134-
if (EnableValhalla) {
1134+
// EnableValhalla legacy
1135+
if (Arguments::enable_preview()) {
11351136
Label write_null_to_null_free_array, store_null;
11361137

11371138
// Move array class to rdi
@@ -1957,7 +1958,8 @@ void TemplateTable::if_acmp(Condition cc) {
19571958
__ profile_acmp(rbx, rdx, rax, rcx);
19581959

19591960
const int is_inline_type_mask = markWord::inline_type_pattern;
1960-
if (EnableValhalla) {
1961+
// EnableValhalla legacy
1962+
if (Arguments::enable_preview()) {
19611963
__ cmpoop(rdx, rax);
19621964
__ jcc(Assembler::equal, (cc == equal) ? taken : not_taken);
19631965

@@ -2679,7 +2681,8 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
26792681
__ cmpl(tos_state, atos);
26802682
__ jcc(Assembler::notEqual, notObj);
26812683
// atos
2682-
if (!EnableValhalla) {
2684+
// EnableValhalla legacy
2685+
if (!Arguments::enable_preview()) {
26832686
if (!is_static) pop_and_check_object(obj);
26842687
do_oop_load(_masm, field, rax);
26852688
__ push(atos);
@@ -2957,7 +2960,8 @@ void TemplateTable::putfield_or_static_helper(int byte_no, bool is_static, Rewri
29572960

29582961
// atos
29592962
{
2960-
if (!EnableValhalla) {
2963+
// EnableValhalla legacy
2964+
if (!Arguments::enable_preview()) {
29612965
__ pop(atos);
29622966
if (!is_static) pop_and_check_object(obj);
29632967
// Store into the field

src/hotspot/share/cds/archiveHeapWriter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ objArrayOop ArchiveHeapWriter::allocate_root_segment(size_t offset, int element_
235235
if (UseCompactObjectHeaders) {
236236
oopDesc::release_set_mark(mem, Universe::objectArrayKlass()->prototype_header());
237237
} else {
238-
assert(!EnableValhalla || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
238+
// EnableValhalla legacy
239+
assert(!Arguments::enable_preview() || Universe::objectArrayKlass()->prototype_header() == markWord::prototype(), "should be the same");
239240
oopDesc::set_mark(mem, markWord::prototype());
240241
oopDesc::release_set_klass(mem, Universe::objectArrayKlass());
241242
}
@@ -638,11 +639,12 @@ void ArchiveHeapWriter::update_header_for_requested_obj(oop requested_obj, oop s
638639
}
639640
// We need to retain the identity_hash, because it may have been used by some hashtables
640641
// in the shared heap.
641-
if (!src_obj->fast_no_hash_check() && (!(EnableValhalla && src_obj->mark().is_inline_type()))) {
642+
// EnableValhalla legacy
643+
if (!src_obj->fast_no_hash_check() && (!(Arguments::enable_preview() && src_obj->mark().is_inline_type()))) {
642644
intptr_t src_hash = src_obj->identity_hash();
643645
if (UseCompactObjectHeaders) {
644646
fake_oop->set_mark(markWord::prototype().set_narrow_klass(nk).copy_set_hash(src_hash));
645-
} else if (EnableValhalla) {
647+
} else if (Arguments::enable_preview()) { // EnablePreview legacy
646648
fake_oop->set_mark(src_klass->prototype_header().copy_set_hash(src_hash));
647649
} else {
648650
fake_oop->set_mark(markWord::prototype().copy_set_hash(src_hash));

src/hotspot/share/cds/cdsConfig.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,8 @@ class CDSConfig : public AllStatic {
207207
static void stop_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
208208
static void stop_using_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
209209

210-
static bool is_valhalla_preview() {
211-
return Arguments::enable_preview() && EnableValhalla;
212-
}
210+
// EnablePreview legacy
211+
static bool is_valhalla_preview() { return Arguments::enable_preview(); }
213212

214213
// --- AOT code
215214

src/hotspot/share/cds/filemap.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,8 @@ bool FileMapHeader::validate() {
21412141
}
21422142
}
21432143
if (err != nullptr) {
2144-
log_warning(cds)("This archive was %s with --enable-preview -XX:+EnableValhalla. It is "
2144+
// EnableValhalla legacy
2145+
log_warning(cds)("This archive was %s with --enable-preview. It is "
21452146
"incompatible with the current JVM setting", err);
21462147
return false;
21472148
}

src/hotspot/share/cds/filemap.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class FileMapRegion: private CDSFileMapRegion {
100100
};
101101

102102
#define CDS_MUST_MATCH_FLAGS_DO(f) \
103-
f(EnableValhalla) \
104103
f(UseArrayFlattening) \
105104
f(UseFieldFlattening) \
106105
f(InlineTypePassFieldsAsArgs) \
@@ -171,7 +170,7 @@ class FileMapHeader: private CDSFileMapHeaderBase {
171170
// some expensive operations.
172171
bool _has_aot_linked_classes; // Was the CDS archive created with -XX:+AOTClassLinking
173172
bool _has_full_module_graph; // Does this CDS archive contain the full archived module graph?
174-
bool _has_valhalla_patched_classes; // Is this archived dumped with --enable-preview -XX:+EnableValhalla?
173+
bool _has_valhalla_patched_classes; // Is this archived dumped with --enable-preview
175174
CDSMustMatchFlags _must_match; // These flags must be the same between dumptime and runtime
176175
HeapRootSegments _heap_root_segments; // Heap root segments info
177176
size_t _heap_oopmap_start_pos; // The first bit in the oopmap corresponds to this position in the heap.

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,7 +2267,8 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
22672267
return nullptr;
22682268
}
22692269

2270-
if (EnableValhalla) {
2270+
// EnableValhalla legacy
2271+
if (Arguments::enable_preview()) {
22712272
if (((flags & JVM_ACC_SYNCHRONIZED) == JVM_ACC_SYNCHRONIZED)
22722273
&& ((flags & JVM_ACC_STATIC) == 0 )
22732274
&& !_access_flags.is_identity_class()) {
@@ -3786,7 +3787,8 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
37863787
permitted_subclasses_attribute_start = cfs->current();
37873788
permitted_subclasses_attribute_length = attribute_length;
37883789
}
3789-
if (EnableValhalla && tag == vmSymbols::tag_loadable_descriptors()) {
3790+
// EnableValhalla legacy
3791+
if (Arguments::enable_preview() && tag == vmSymbols::tag_loadable_descriptors()) {
37903792
if (parsed_loadable_descriptors_attribute) {
37913793
classfile_parse_error("Multiple LoadableDescriptors attributes in class file %s", CHECK);
37923794
return;
@@ -5542,7 +5544,8 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik,
55425544
vk->initialize_calling_convention(CHECK);
55435545
}
55445546

5545-
if (EnableValhalla && !access_flags().is_identity_class() && !access_flags().is_interface()
5547+
// EnableValhalla legacy
5548+
if (Arguments::enable_preview() && !access_flags().is_identity_class() && !access_flags().is_interface()
55465549
&& _class_name != vmSymbols::java_lang_Object() && UseAltSubstitutabilityMethod) {
55475550
// Both abstract and concrete value classes need a field map for acmp
55485551
ik->set_acmp_maps_offset(_layout_info->_acmp_maps_offset);
@@ -6143,7 +6146,8 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
61436146
return;
61446147
}
61456148

6146-
if (EnableValhalla) {
6149+
// EnableValhalla legacy
6150+
if (Arguments::enable_preview()) {
61476151
check_identity_and_value_modifiers(this, _super_klass, CHECK);
61486152
}
61496153

@@ -6159,7 +6163,8 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
61596163
}
61606164

61616165
// Determining is the class allows tearing or not (default is not)
6162-
if (EnableValhalla && !_access_flags.is_identity_class()) {
6166+
// EnableValhalla legacy
6167+
if (Arguments::enable_preview() && !_access_flags.is_identity_class()) {
61636168
if (_parsed_annotations->has_annotation(ClassAnnotationCollector::_jdk_internal_LooselyConsistentValue)
61646169
&& (_super_klass == vmClasses::Object_klass() || !_super_klass->must_be_atomic())) {
61656170
// Conditions above are not sufficient to determine atomicity requirements,
@@ -6212,7 +6217,8 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
62126217
interf->class_in_module_of_loader()));
62136218
}
62146219

6215-
if (EnableValhalla) {
6220+
// EnableValhalla legacy
6221+
if (Arguments::enable_preview()) {
62166222
// Check modifiers and set carries_identity_modifier/carries_value_modifier flags
62176223
check_identity_and_value_modifiers(this, InstanceKlass::cast(interf), CHECK);
62186224
}
@@ -6257,7 +6263,8 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
62576263

62586264
assert(_parsed_annotations != nullptr, "invariant");
62596265

6260-
if (EnableValhalla) {
6266+
// EnableValhalla legacy
6267+
if (Arguments::enable_preview()) {
62616268
_inline_layout_info_array = MetadataFactory::new_array<InlineLayoutInfo>(_loader_data,
62626269
java_fields_count(),
62636270
CHECK);

src/hotspot/share/interpreter/abstractInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
156156
// No need to use the method kind with a memory barrier on entry
157157
// because the method is empty and already has a memory barrier on return
158158
return zerolocals;
159-
} else if (EnableValhalla) {
159+
} else if (Arguments::enable_preview()) { // EnableValhalla legacy
160160
// For non-empty Object constructors, we need a memory barrier
161161
// when entering the method to ensure correctness of strict fields
162162
return object_init;

0 commit comments

Comments
 (0)