< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page
rev 48343 : imported patch JDK-8173382-classfile-version

*** 84,95 **** // We add assert in debug mode when class format is not checked. #define JAVA_CLASSFILE_MAGIC 0xCAFEBABE #define JAVA_MIN_SUPPORTED_VERSION 45 - #define JAVA_MAX_SUPPORTED_VERSION 54 - #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0 // Used for two backward compatibility reasons: // - to check for new additions to the class file format in JDK1.5 // - to check for bug fixes in the format checker in JDK1.5 #define JAVA_1_5_VERSION 49 --- 84,93 ----
*** 108,117 **** --- 106,117 ---- #define JAVA_9_VERSION 53 #define JAVA_10_VERSION 54 + #define JAVA_11_VERSION 55 + void ClassFileParser::set_class_bad_constant_seen(short bad_constant) { assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION, "Unexpected bad constant pool entry"); if (_bad_constant_seen == 0) _bad_constant_seen = bad_constant; }
*** 4640,4654 **** (is_public && is_private) || (is_protected && is_private)); } static bool is_supported_version(u2 major, u2 minor){ ! const u2 max_version = JAVA_MAX_SUPPORTED_VERSION; return (major >= JAVA_MIN_SUPPORTED_VERSION) && (major <= max_version) && ((major != max_version) || ! (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION)); } void ClassFileParser::verify_legal_field_modifiers(jint flags, bool is_interface, TRAPS) const { --- 4640,4654 ---- (is_public && is_private) || (is_protected && is_private)); } static bool is_supported_version(u2 major, u2 minor){ ! const u2 max_version = JVM_CLASSFILE_MAJOR_VERSION; return (major >= JAVA_MIN_SUPPORTED_VERSION) && (major <= max_version) && ((major != max_version) || ! (minor <= JVM_CLASSFILE_MINOR_VERSION)); } void ClassFileParser::verify_legal_field_modifiers(jint flags, bool is_interface, TRAPS) const {
*** 5806,5817 **** "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), " "this version of the Java Runtime only recognizes class file versions up to %u.%u", _class_name->as_C_string(), _major_version, _minor_version, ! JAVA_MAX_SUPPORTED_VERSION, ! JAVA_MAX_SUPPORTED_MINOR_VERSION); return; } stream->guarantee_more(3, CHECK); // length, first cp tag u2 cp_size = stream->get_u2_fast(); --- 5806,5817 ---- "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), " "this version of the Java Runtime only recognizes class file versions up to %u.%u", _class_name->as_C_string(), _major_version, _minor_version, ! JVM_CLASSFILE_MAJOR_VERSION, ! JVM_CLASSFILE_MINOR_VERSION); return; } stream->guarantee_more(3, CHECK); // length, first cp tag u2 cp_size = stream->get_u2_fast();
< prev index next >