src/share/vm/prims/jvmtiRedefineClasses.cpp

Print this page




1055       RedefineVerifyMark rvm(&the_class, &scratch_class, state);
1056       Verifier::verify(
1057         scratch_class, Verifier::ThrowException, true, THREAD);
1058     }
1059 
1060     if (HAS_PENDING_EXCEPTION) {
1061       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
1062       // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
1063       RC_TRACE_WITH_THREAD(0x00000002, THREAD,
1064         ("verify_byte_codes exception: '%s'", ex_name->as_C_string()));
1065       CLEAR_PENDING_EXCEPTION;
1066       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
1067         return JVMTI_ERROR_OUT_OF_MEMORY;
1068       } else {
1069         // tell the caller the bytecodes are bad
1070         return JVMTI_ERROR_FAILS_VERIFICATION;
1071       }
1072     }
1073 
1074     res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
1075     if (res != JVMTI_ERROR_NONE) {
1076       return res;





1077     }

1078 
1079     if (VerifyMergedCPBytecodes) {
1080       // verify what we have done during constant pool merging
1081       {
1082         RedefineVerifyMark rvm(&the_class, &scratch_class, state);
1083         Verifier::verify(scratch_class, Verifier::ThrowException, true, THREAD);
1084       }
1085 
1086       if (HAS_PENDING_EXCEPTION) {
1087         Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
1088         // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
1089         RC_TRACE_WITH_THREAD(0x00000002, THREAD,
1090           ("verify_byte_codes post merge-CP exception: '%s'",
1091           ex_name->as_C_string()));
1092         CLEAR_PENDING_EXCEPTION;
1093         if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
1094           return JVMTI_ERROR_OUT_OF_MEMORY;
1095         } else {
1096           // tell the caller that constant pool merging screwed up
1097           return JVMTI_ERROR_INTERNAL;




1055       RedefineVerifyMark rvm(&the_class, &scratch_class, state);
1056       Verifier::verify(
1057         scratch_class, Verifier::ThrowException, true, THREAD);
1058     }
1059 
1060     if (HAS_PENDING_EXCEPTION) {
1061       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
1062       // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
1063       RC_TRACE_WITH_THREAD(0x00000002, THREAD,
1064         ("verify_byte_codes exception: '%s'", ex_name->as_C_string()));
1065       CLEAR_PENDING_EXCEPTION;
1066       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
1067         return JVMTI_ERROR_OUT_OF_MEMORY;
1068       } else {
1069         // tell the caller the bytecodes are bad
1070         return JVMTI_ERROR_FAILS_VERIFICATION;
1071       }
1072     }
1073 
1074     res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
1075     if (HAS_PENDING_EXCEPTION) {
1076       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
1077       CLEAR_PENDING_EXCEPTION;
1078       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
1079         return JVMTI_ERROR_OUT_OF_MEMORY;
1080       } else {
1081         return JVMTI_ERROR_INTERNAL;
1082       }
1083     }
1084 
1085     if (VerifyMergedCPBytecodes) {
1086       // verify what we have done during constant pool merging
1087       {
1088         RedefineVerifyMark rvm(&the_class, &scratch_class, state);
1089         Verifier::verify(scratch_class, Verifier::ThrowException, true, THREAD);
1090       }
1091 
1092       if (HAS_PENDING_EXCEPTION) {
1093         Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
1094         // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
1095         RC_TRACE_WITH_THREAD(0x00000002, THREAD,
1096           ("verify_byte_codes post merge-CP exception: '%s'",
1097           ex_name->as_C_string()));
1098         CLEAR_PENDING_EXCEPTION;
1099         if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
1100           return JVMTI_ERROR_OUT_OF_MEMORY;
1101         } else {
1102           // tell the caller that constant pool merging screwed up
1103           return JVMTI_ERROR_INTERNAL;