Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/jvmtiRedefineClasses.cpp @ 12209:0d3ff4d36a31
8024346: ~CautiouslyPreserveExceptionMark - assert(!_thread->has_pending_exception()) failed: unexpected exception generated
Summary: Pending exceptions must be handled properly after a call to the JVMTI merge_cp_and_rewrite
Reviewed-by: coleenp, dholmes
Contributed-by: serguei.spitsyn@oracle.com
author | sspitsyn |
---|---|
date | Fri, 13 Sep 2013 12:48:50 -0700 |
parents | ce5ee9de50ce |
children | da051ce490eb 4f9a42c33738 |
comparison
equal
deleted
inserted
replaced
12208:ce5ee9de50ce | 12209:0d3ff4d36a31 |
---|---|
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; |