Skip to content
Permalink
Browse files
8251842: rename ACC_VALUE to ACC_INLINE
Reviewed-by: fparain
  • Loading branch information
Harold Seigel committed Aug 14, 2020
1 parent 2455c8e commit 2c019fdf352d5dc98902afc76bfb79e3450d56e0
Showing with 53 additions and 53 deletions.
  1. +1 −1 src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
  2. +1 −1 src/hotspot/cpu/x86/macroAssembler_x86.cpp
  3. +8 −8 src/hotspot/share/classfile/classFileParser.cpp
  4. +1 −1 src/hotspot/share/opto/library_call.cpp
  5. +2 −2 src/hotspot/share/utilities/accessFlags.hpp
  6. +1 −1 src/java.base/share/classes/jdk/experimental/bytecode/Flag.java
  7. +2 −2 src/java.base/share/native/include/classfile_constants.h.template
  8. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java
  9. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
  10. +2 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
  11. +6 −6 src/jdk.jdeps/share/classes/com/sun/tools/classfile/AccessFlags.java
  12. +4 −4 test/hotspot/jtreg/runtime/valhalla/inlinetypes/classfileparser/BadACCValue.java
  13. +3 −3 test/hotspot/jtreg/runtime/valhalla/inlinetypes/classfileparser/BadInlineTypes.java
  14. +7 −7 test/hotspot/jtreg/runtime/valhalla/inlinetypes/classfileparser/cfpTests.jcod
  15. +5 −5 test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/verifierTests.jcod
  16. +1 −1 test/langtools/tools/javac/valhalla/lworld-values/CheckFlags.java
  17. +2 −2 test/langtools/tools/javac/valhalla/lworld-values/CheckFlattenableSyntheticFields.java
  18. +2 −2 test/langtools/tools/javac/valhalla/lworld-values/CheckLocalClasses.java
  19. +1 −1 test/langtools/tools/javac/valhalla/lworld-values/InnerClassAttributeValuenessTest.java
  20. +1 −1 test/langtools/tools/javac/valhalla/lworld-values/QTypeTest.java
@@ -1501,7 +1501,7 @@ void MacroAssembler::null_check(Register reg, int offset) {

void MacroAssembler::test_klass_is_value(Register klass, Register temp_reg, Label& is_value) {
ldrw(temp_reg, Address(klass, Klass::access_flags_offset()));
andr(temp_reg, temp_reg, JVM_ACC_VALUE);
andr(temp_reg, temp_reg, JVM_ACC_INLINE);
cbnz(temp_reg, is_value);
}

@@ -2619,7 +2619,7 @@ void MacroAssembler::null_check(Register reg, int offset) {

void MacroAssembler::test_klass_is_inline_type(Register klass, Register temp_reg, Label& is_inline_type) {
movl(temp_reg, Address(klass, Klass::access_flags_offset()));
testl(temp_reg, JVM_ACC_VALUE);
testl(temp_reg, JVM_ACC_INLINE);
jcc(Assembler::notZero, is_inline_type);
}

@@ -3287,9 +3287,9 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea
if (_major_version >= JAVA_9_VERSION) {
recognized_modifiers |= JVM_ACC_MODULE;
}
// JVM_ACC_VALUE is defined for class file version 55 and later
// JVM_ACC_INLINE is defined for class file version 55 and later
if (supports_inline_types()) {
recognized_modifiers |= JVM_ACC_VALUE;
recognized_modifiers |= JVM_ACC_INLINE;
}

// Access flags
@@ -4155,7 +4155,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,

if (super_class_index == 0) {
check_property(_class_name == vmSymbols::java_lang_Object()
|| (_access_flags.get_flags() & JVM_ACC_VALUE),
|| (_access_flags.get_flags() & JVM_ACC_INLINE),
"Invalid superclass index %u in class file %s",
super_class_index,
CHECK_NULL);
@@ -5353,9 +5353,9 @@ static void check_illegal_static_method(const InstanceKlass* this_klass, TRAPS)

void ClassFileParser::verify_legal_class_modifiers(jint flags, TRAPS) const {
const bool is_module = (flags & JVM_ACC_MODULE) != 0;
const bool is_inline_type = (flags & JVM_ACC_VALUE) != 0;
const bool is_inline_type = (flags & JVM_ACC_INLINE) != 0;
assert(_major_version >= JAVA_9_VERSION || !is_module, "JVM_ACC_MODULE should not be set");
assert(supports_inline_types() || !is_inline_type, "JVM_ACC_VALUE should not be set");
assert(supports_inline_types() || !is_inline_type, "JVM_ACC_INLINE should not be set");
if (is_module) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
@@ -5371,7 +5371,7 @@ void ClassFileParser::verify_legal_class_modifiers(jint flags, TRAPS) const {
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_ClassFormatError(),
"Class modifier ACC_VALUE in class %s requires option -XX:+EnableValhalla",
"Class modifier ACC_INLINE in class %s requires option -XX:+EnableValhalla",
_class_name->as_C_string()
);
}
@@ -6885,9 +6885,9 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
if (_major_version >= JAVA_9_VERSION) {
recognized_modifiers |= JVM_ACC_MODULE;
}
// JVM_ACC_VALUE is defined for class file version 55 and later
// JVM_ACC_INLINE is defined for class file version 55 and later
if (supports_inline_types()) {
recognized_modifiers |= JVM_ACC_VALUE;
recognized_modifiers |= JVM_ACC_INLINE;
}

// Access flags
@@ -3297,7 +3297,7 @@ Node* LibraryCallKit::generate_hidden_class_guard(Node* kls, RegionNode* region)
}

Node* LibraryCallKit::generate_value_guard(Node* kls, RegionNode* region) {
return generate_access_flags_guard(kls, JVM_ACC_VALUE, 0, region);
return generate_access_flags_guard(kls, JVM_ACC_INLINE, 0, region);
}

//-------------------------inline_native_Class_query-------------------
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ class AccessFlags {
bool is_interface () const { return (_flags & JVM_ACC_INTERFACE ) != 0; }
bool is_abstract () const { return (_flags & JVM_ACC_ABSTRACT ) != 0; }
bool is_strict () const { return (_flags & JVM_ACC_STRICT ) != 0; }
bool is_inline_type () const { return (_flags & JVM_ACC_VALUE ) != 0; }
bool is_inline_type () const { return (_flags & JVM_ACC_INLINE ) != 0; }

// Attribute flags
bool is_synthetic () const { return (_flags & JVM_ACC_SYNTHETIC ) != 0; }
@@ -44,7 +44,7 @@
ACC_SYNCHRONIZED(0x0020),
ACC_BRIDGE(0x0040),
ACC_VARARGS(0x0080),
ACC_VALUE(0x0100),
ACC_INLINE(0x0100),
ACC_NATIVE(0x0100),
ACC_STRICT(0x0800);

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ enum {
JVM_ACC_BRIDGE = 0x0040,
JVM_ACC_TRANSIENT = 0x0080,
JVM_ACC_VARARGS = 0x0080,
JVM_ACC_VALUE = 0x0100,
JVM_ACC_INLINE = 0x0100,
JVM_ACC_NATIVE = 0x0100,
JVM_ACC_INTERFACE = 0x0200,
JVM_ACC_ABSTRACT = 0x0400,
@@ -110,7 +110,7 @@ public static String toString(long flags) {
public static final int ACC_SUPER = 0x0020;
public static final int ACC_BRIDGE = 0x0040;
public static final int ACC_VARARGS = 0x0080;
public static final int ACC_VALUE = 0x0100;
public static final int ACC_INLINE = 0x0100;
public static final int ACC_MODULE = 0x8000;

/*****************************************
@@ -2774,8 +2774,8 @@ long adjustClassFlags(long flags) {
flags &= ~ACC_MODULE;
flags |= MODULE;
}
if ((flags & ACC_VALUE) != 0) {
flags &= ~ACC_VALUE;
if ((flags & ACC_INLINE) != 0) {
flags &= ~ACC_INLINE;
flags |= allowInlineTypes ? VALUE : allowValueBasedClasses ? VALUEBASED : 0;
}
return flags & ~ACC_SUPER; // SUPER and SYNCHRONIZED bits overloaded
@@ -1572,7 +1572,7 @@ public void writeClassFile(OutputStream out, ClassSymbol c)
} else {
flags = adjustFlags(c.flags() & ~DEFAULT);
if ((flags & PROTECTED) != 0) flags |= PUBLIC;
flags = flags & (ClassFlags | ACC_VALUE) & ~STRICTFP;
flags = flags & (ClassFlags | ACC_INLINE) & ~STRICTFP;
if ((flags & INTERFACE) == 0) flags |= ACC_SUPER;
}

@@ -1750,7 +1750,7 @@ int adjustFlags(final long flags) {
if ((flags & DEFAULT) != 0)
result &= ~ABSTRACT;
if ((flags & VALUE) != 0)
result |= ACC_VALUE;
result |= ACC_INLINE;
return result;
}

@@ -49,7 +49,7 @@
public static final int ACC_BRIDGE = 0x0040; // method
public static final int ACC_TRANSIENT = 0x0080; // field
public static final int ACC_VARARGS = 0x0080; // method
public static final int ACC_VALUE = 0x0100; // class
public static final int ACC_INLINE = 0x0100; // class
public static final int ACC_NATIVE = 0x0100; // method
public static final int ACC_INTERFACE = 0x0200; // class, inner
public static final int ACC_ABSTRACT = 0x0400; // class, inner, method
@@ -83,12 +83,12 @@ public int byteLength() {
}

private static final int[] classModifiers = {
ACC_PUBLIC, ACC_FINAL, ACC_ABSTRACT, ACC_VALUE
ACC_PUBLIC, ACC_FINAL, ACC_ABSTRACT, ACC_INLINE
};

private static final int[] classFlags = {
ACC_PUBLIC, ACC_FINAL, ACC_SUPER, ACC_INTERFACE, ACC_ABSTRACT,
ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_MODULE, ACC_VALUE
ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_MODULE, ACC_INLINE
};

public Set<String> getClassModifiers() {
@@ -102,12 +102,12 @@ public int byteLength() {

private static final int[] innerClassModifiers = {
ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
ACC_ABSTRACT, ACC_VALUE
ACC_ABSTRACT, ACC_INLINE
};

private static final int[] innerClassFlags = {
ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_SUPER,
ACC_INTERFACE, ACC_ABSTRACT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_VALUE
ACC_INTERFACE, ACC_ABSTRACT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_INLINE
};

public Set<String> getInnerClassModifiers() {
@@ -236,7 +236,7 @@ private static String flagToName(int flag, Kind t) {
case 0x80:
return (t == Kind.Field ? "ACC_TRANSIENT" : "ACC_VARARGS");
case 0x100:
return (t == Kind.Class || t == Kind.InnerClass) ? "ACC_VALUE" : "ACC_NATIVE";
return (t == Kind.Class || t == Kind.InnerClass) ? "ACC_INLINE" : "ACC_NATIVE";
case ACC_INTERFACE:
return "ACC_INTERFACE";
case ACC_ABSTRACT:
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
*/
/*
* @test
* @summary test that if a class file has ACC_VALUE set then it must be run
* @summary test that if a class file has ACC_INLINE set then it must be run
* with option -XX:+EnableValhalla.
* @compile cfpTests.jcod
* @run main/othervm -XX:-EnableValhalla BadACCValue
@@ -44,8 +44,8 @@ public static void runTest(String test_name, String message) throws Exception {

public static void main(String[] args) throws Exception {

// Test ACC_VALUE causes a CFE unless -XX:+EnableValhalla is specified.
// Test ACC_INLINE causes a CFE unless -XX:+EnableValhalla is specified.
runTest("ValueFieldNotFinal",
"Class modifier ACC_VALUE in class ValueFieldNotFinal requires option -XX:+EnableValhalla");
"Class modifier ACC_INLINE in class ValueFieldNotFinal requires option -XX:+EnableValhalla");
}
}
@@ -44,16 +44,16 @@ public static void runTest(String test_name, String message) throws Exception {

public static void main(String[] args) throws Exception {

// Test that ACC_VALUE with ACC_ABSTRACT is illegal.
// Test that ACC_INLINE with ACC_ABSTRACT is illegal.
runTest("ValueAbstract", "Illegal class modifiers in class ValueAbstract");

// Test that ACC_VALUE with ACC_ENUM is illegal.
// Test that ACC_INLINE with ACC_ENUM is illegal.
runTest("ValueEnum", "Illegal class modifiers in class ValueEnum");

// Test that inline type fields must be final.
runTest("ValueFieldNotFinal", "Illegal field modifiers in class ValueFieldNotFinal");

// Test that ACC_VALUE with ACC_INTERFACE is illegal.
// Test that ACC_INLINE with ACC_INTERFACE is illegal.
runTest("ValueInterface", "Illegal class modifiers in class ValueInterface");

// Test that inline type instance methods cannot be synchronized.
@@ -43,7 +43,7 @@
// }


// Test that class modifiers cannot have both ACC_VALUE and ACC_ABSTRACT set.
// Test that class modifiers cannot have both ACC_INLINE and ACC_ABSTRACT set.
//
class ValueAbstract {
0xCAFEBABE;
@@ -80,7 +80,7 @@ class ValueAbstract {
Utf8 "java/lang/Object"; // #27 at 0xD3
} // Constant Pool

0x0530; // access [ ACC_VALUE ACC_ABSTRACT(bad) ACC_SUPER ACC_FINAL ]
0x0530; // access [ ACC_INLINE ACC_ABSTRACT(bad) ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -199,7 +199,7 @@ class ValueAbstract {

//////////////////////////////////////////////////////////////////////

// Test that class modifiers cannot have both ACC_VALUE and ACC_ENUM set.
// Test that class modifiers cannot have both ACC_INLINE and ACC_ENUM set.
//
class ValueEnum {
0xCAFEBABE;
@@ -236,7 +236,7 @@ class ValueEnum {
Utf8 "java/lang/Object"; // #27 at 0xD3
} // Constant Pool

0x04130; // access [ ACC_VALUE ACC_ENUM(bad) ACC_SUPER ACC_FINAL ]
0x04130; // access [ ACC_INLINE ACC_ENUM(bad) ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -392,7 +392,7 @@ class ValueFieldNotFinal {
Utf8 "java/lang/Object"; // #27 at 0xD3
} // Constant Pool

0x0130; // access [ ACC_VALUE ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -511,7 +511,7 @@ class ValueFieldNotFinal {

//////////////////////////////////////////////////////////////////////

// Test that class modifiers cannot have both ACC_VALUE and ACC_INTERFACE set.
// Test that class modifiers cannot have both ACC_INLINE and ACC_INTERFACE set.
//
class ValueInterface {
0xCAFEBABE;
@@ -547,7 +547,7 @@ class ValueInterface {
Utf8 "java/lang/Object"; // #26 at 0xDA
} // Constant Pool

0x0330; // access [ ACC_VALUE ACC_INTERFACE(bad) ACC_SUPER ACC_FINAL ]
0x0330; // access [ ACC_INLINE ACC_INTERFACE(bad) ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -91,7 +91,7 @@ class defValBadCP {
Utf8 "java/lang/Object"; // #26 at 0xC6
} // Constant Pool

0x0130; // access [ ACC_VALUE ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -192,7 +192,7 @@ class defValBadMajorVersion {
Utf8 "java/lang/Object"; // #26 at 0xC6
} // Constant Pool

0x0130; // access [ ACC_VALUE ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -293,7 +293,7 @@ class defValWrongCPType {
Utf8 "java/lang/Object"; // #26 at 0xC6
} // Constant Pool

0x0130; // access [ ACC_VALUE ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -747,7 +747,7 @@ class wthFldBadMajorVersion {
Utf8 "java/lang/Object"; // #26 at 0xC6
} // Constant Pool

0x0130; // access [ ACC_VALUE ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#7;// super_cpx

@@ -963,7 +963,7 @@ class wthFldObject {

} // Constant Pool

0x0130; // access [ ACC_VALUE, ACC_SUPER ACC_FINAL ]
0x0130; // access [ ACC_INLINE, ACC_SUPER ACC_FINAL ]
#3;// this_cpx
#4;// super_cpx

@@ -37,7 +37,7 @@
public static void main(String[] args) throws Exception {
ClassFile cls = ClassFile.read(CheckFlags.class.getResourceAsStream("Point.class"));

if (!cls.access_flags.is(AccessFlags.ACC_VALUE))
if (!cls.access_flags.is(AccessFlags.ACC_INLINE))
throw new Exception("Value flag not set");

if (!cls.access_flags.is(AccessFlags.ACC_FINAL))
@@ -55,15 +55,15 @@ public Inner(int value2) {
public static void main(String[] args) throws Exception {
ClassFile cls = ClassFile.read(CheckFlattenableSyntheticFields.class.getResourceAsStream("CheckFlattenableSyntheticFields$ValueOuter$Inner.class"));

if (!cls.access_flags.is(AccessFlags.ACC_VALUE))
if (!cls.access_flags.is(AccessFlags.ACC_INLINE))
throw new Exception("Value flag not set");

if (!cls.access_flags.is(AccessFlags.ACC_FINAL))
throw new Exception("Final flag not set");

cls = ClassFile.read(CheckFlattenableSyntheticFields.class.getResourceAsStream("CheckFlattenableSyntheticFields$RefOuter$Inner.class"));

if (!cls.access_flags.is(AccessFlags.ACC_VALUE))
if (!cls.access_flags.is(AccessFlags.ACC_INLINE))
throw new Exception("Value flag not set");

if (!cls.access_flags.is(AccessFlags.ACC_FINAL))

0 comments on commit 2c019fd

Please sign in to comment.