hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 19962 a1ff113a3e74
parent 19961 04405a08613f
child 20059 c26474fd5ac0
child 20022 e6e3f5ff6d73
equal deleted inserted replaced
19961:04405a08613f 19962:a1ff113a3e74
  1070         return JVMTI_ERROR_FAILS_VERIFICATION;
  1070         return JVMTI_ERROR_FAILS_VERIFICATION;
  1071       }
  1071       }
  1072     }
  1072     }
  1073 
  1073 
  1074     res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
  1074     res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
  1075     if (res != JVMTI_ERROR_NONE) {
  1075     if (HAS_PENDING_EXCEPTION) {
  1076       return res;
  1076       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
       
  1077       // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
       
  1078       RC_TRACE_WITH_THREAD(0x00000002, THREAD,
       
  1079         ("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string()));
       
  1080       CLEAR_PENDING_EXCEPTION;
       
  1081       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
       
  1082         return JVMTI_ERROR_OUT_OF_MEMORY;
       
  1083       } else {
       
  1084         return JVMTI_ERROR_INTERNAL;
       
  1085       }
  1077     }
  1086     }
  1078 
  1087 
  1079     if (VerifyMergedCPBytecodes) {
  1088     if (VerifyMergedCPBytecodes) {
  1080       // verify what we have done during constant pool merging
  1089       // verify what we have done during constant pool merging
  1081       {
  1090       {
  1103     if (!HAS_PENDING_EXCEPTION) {
  1112     if (!HAS_PENDING_EXCEPTION) {
  1104       scratch_class->link_methods(THREAD);
  1113       scratch_class->link_methods(THREAD);
  1105     }
  1114     }
  1106     if (HAS_PENDING_EXCEPTION) {
  1115     if (HAS_PENDING_EXCEPTION) {
  1107       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
  1116       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
       
  1117       // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
       
  1118       RC_TRACE_WITH_THREAD(0x00000002, THREAD,
       
  1119         ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string()));
  1108       CLEAR_PENDING_EXCEPTION;
  1120       CLEAR_PENDING_EXCEPTION;
  1109       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
  1121       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
  1110         return JVMTI_ERROR_OUT_OF_MEMORY;
  1122         return JVMTI_ERROR_OUT_OF_MEMORY;
  1111       } else {
  1123       } else {
  1112         return JVMTI_ERROR_INTERNAL;
  1124         return JVMTI_ERROR_INTERNAL;