@@ -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);
0 commit comments