59 #endif |
59 #endif |
60 #ifdef TARGET_ARCH_ppc |
60 #ifdef TARGET_ARCH_ppc |
61 # include "bytes_ppc.hpp" |
61 # include "bytes_ppc.hpp" |
62 #endif |
62 #endif |
63 |
63 |
64 #define NOFAILOVER_MAJOR_VERSION 51 |
64 #define NOFAILOVER_MAJOR_VERSION 51 |
65 #define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52 |
65 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51 |
|
66 #define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52 |
66 |
67 |
67 // Access to external entry for VerifyClassCodes - old byte code verifier |
68 // Access to external entry for VerifyClassCodes - old byte code verifier |
68 |
69 |
69 extern "C" { |
70 extern "C" { |
70 typedef jboolean (*verify_byte_codes_fn_t)(JNIEnv *, jclass, char *, jint); |
71 typedef jboolean (*verify_byte_codes_fn_t)(JNIEnv *, jclass, char *, jint); |
2025 StackMapFrame* current_frame, StackMapTable* stackmap_table, TRAPS) { |
2026 StackMapFrame* current_frame, StackMapTable* stackmap_table, TRAPS) { |
2026 int bci = bcs->bci(); |
2027 int bci = bcs->bci(); |
2027 address bcp = bcs->bcp(); |
2028 address bcp = bcs->bcp(); |
2028 address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize); |
2029 address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize); |
2029 |
2030 |
2030 // 4639449 & 4647081: padding bytes must be 0 |
2031 if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) { |
2031 u2 padding_offset = 1; |
2032 // 4639449 & 4647081: padding bytes must be 0 |
2032 while ((bcp + padding_offset) < aligned_bcp) { |
2033 u2 padding_offset = 1; |
2033 if(*(bcp + padding_offset) != 0) { |
2034 while ((bcp + padding_offset) < aligned_bcp) { |
2034 verify_error(ErrorContext::bad_code(bci), |
2035 if(*(bcp + padding_offset) != 0) { |
2035 "Nonzero padding byte in lookswitch or tableswitch"); |
2036 verify_error(ErrorContext::bad_code(bci), |
2036 return; |
2037 "Nonzero padding byte in lookswitch or tableswitch"); |
2037 } |
2038 return; |
2038 padding_offset++; |
2039 } |
2039 } |
2040 padding_offset++; |
|
2041 } |
|
2042 } |
|
2043 |
2040 int default_offset = (int) Bytes::get_Java_u4(aligned_bcp); |
2044 int default_offset = (int) Bytes::get_Java_u4(aligned_bcp); |
2041 int keys, delta; |
2045 int keys, delta; |
2042 current_frame->pop_stack( |
2046 current_frame->pop_stack( |
2043 VerificationType::integer_type(), CHECK_VERIFY(this)); |
2047 VerificationType::integer_type(), CHECK_VERIFY(this)); |
2044 if (bcs->raw_code() == Bytecodes::_tableswitch) { |
2048 if (bcs->raw_code() == Bytecodes::_tableswitch) { |