Mercurial > hg > truffle
comparison src/share/vm/classfile/classFileParser.cpp @ 176:6b648fefb395
6705523: Fix for 6695506 will violate spec when used in JDK6
Summary: Make max classfile version number dependent on JDK version
Reviewed-by: acorn, never
author | kamg |
---|---|
date | Thu, 22 May 2008 13:03:52 -0400 |
parents | 7f3a69574470 |
children | 1f809e010142 |
comparison
equal
deleted
inserted
replaced
148:7a0a921a1a8c | 176:6b648fefb395 |
---|---|
42 // - to check for bug fixes in the format checker in JDK1.5 | 42 // - to check for bug fixes in the format checker in JDK1.5 |
43 #define JAVA_1_5_VERSION 49 | 43 #define JAVA_1_5_VERSION 49 |
44 | 44 |
45 // Used for backward compatibility reasons: | 45 // Used for backward compatibility reasons: |
46 // - to check for javac bug fixes that happened after 1.5 | 46 // - to check for javac bug fixes that happened after 1.5 |
47 // - also used as the max version when running in jdk6 | |
47 #define JAVA_6_VERSION 50 | 48 #define JAVA_6_VERSION 50 |
48 | 49 |
49 | 50 |
50 void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS) { | 51 void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS) { |
51 // Use a local copy of ClassFileStream. It helps the C++ compiler to optimize | 52 // Use a local copy of ClassFileStream. It helps the C++ compiler to optimize |
3514 (is_public && is_private) || | 3515 (is_public && is_private) || |
3515 (is_protected && is_private)); | 3516 (is_protected && is_private)); |
3516 } | 3517 } |
3517 | 3518 |
3518 bool ClassFileParser::is_supported_version(u2 major, u2 minor) { | 3519 bool ClassFileParser::is_supported_version(u2 major, u2 minor) { |
3520 u2 max_version = JDK_Version::is_gte_jdk17x_version() ? | |
3521 JAVA_MAX_SUPPORTED_VERSION : JAVA_6_VERSION; | |
3519 return (major >= JAVA_MIN_SUPPORTED_VERSION) && | 3522 return (major >= JAVA_MIN_SUPPORTED_VERSION) && |
3520 (major <= JAVA_MAX_SUPPORTED_VERSION) && | 3523 (major <= max_version) && |
3521 ((major != JAVA_MAX_SUPPORTED_VERSION) || | 3524 ((major != max_version) || |
3522 (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION)); | 3525 (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION)); |
3523 } | 3526 } |
3524 | 3527 |
3525 void ClassFileParser::verify_legal_field_modifiers( | 3528 void ClassFileParser::verify_legal_field_modifiers( |
3526 jint flags, bool is_interface, TRAPS) { | 3529 jint flags, bool is_interface, TRAPS) { |