src/share/vm/prims/jvmtiRedefineClasses.cpp

Print this page

        

@@ -1588,16 +1588,22 @@
 
   // rewrite constant pool references in the methods:
   for (int i = methods->length() - 1; i >= 0; i--) {
     methodHandle method(THREAD, methods->at(i));
     methodHandle new_method;
-    rewrite_cp_refs_in_method(method, &new_method, CHECK_false);
+    rewrite_cp_refs_in_method(method, &new_method, THREAD);
     if (!new_method.is_null()) {
       // the method has been replaced so save the new method version
+      // even in the case of an exception.  original method is on the
+      // deallocation list.
       methods->at_put(i, new_method());
     }
+    if (HAS_PENDING_EXCEPTION) {
+      CLEAR_PENDING_EXCEPTION;
+      return false;
   }
+  }
 
   return true;
 }
 
 

@@ -1672,15 +1678,12 @@
             methodHandle m;
             {
               Pause_No_Safepoint_Verifier pnsv(&nsv);
 
               // ldc is 2 bytes and ldc_w is 3 bytes
-              m = rc.insert_space_at(bci, 3, inst_buffer, THREAD);
-              if (m.is_null() || HAS_PENDING_EXCEPTION) {
-                guarantee(false, "insert_space_at() failed");
+              m = rc.insert_space_at(bci, 3, inst_buffer, CHECK);
               }
-            }
 
             // return the new method so that the caller can update
             // the containing class
             *new_method_p = method = m;
             // switch our bytecode processing loop from the old method