changeset 987:cdb8b7c37ac1

6875329: fix for 6795465 broke exception handler cloning Reviewed-by: kvn
author never
date Mon, 24 Aug 2009 22:26:15 -0700
parents 82bd76d4d7f2
children aba04734b61e
files src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Mon Aug 24 11:13:46 2009 -0700
+++ b/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Mon Aug 24 22:26:15 2009 -0700
@@ -950,15 +950,17 @@
   }
 
   // Evaluate state_for early since it may emit code.
-  CodeEmitInfo* info = state_for(x, x->state());
   CodeEmitInfo* patching_info = NULL;
   if (!x->klass()->is_loaded() || PatchALot) {
     patching_info = state_for(x, x->state_before());
 
     // cannot re-use same xhandlers for multiple CodeEmitInfos, so
-    // clone all handlers.
+    // clone all handlers.  This is handled transparently in other
+    // places by the CodeEmitInfo cloning logic but is handled
+    // specially here because a stub isn't being used.
     x->set_exception_handlers(new XHandlers(x->exception_handlers()));
   }
+  CodeEmitInfo* info = state_for(x, x->state());
 
   i = dims->length();
   while (i-- > 0) {
--- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Mon Aug 24 11:13:46 2009 -0700
+++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Mon Aug 24 22:26:15 2009 -0700
@@ -1047,16 +1047,17 @@
     items->at_put(i, size);
   }
 
-  // need to get the info before, as the items may become invalid through item_free
+  // Evaluate state_for early since it may emit code.
   CodeEmitInfo* patching_info = NULL;
   if (!x->klass()->is_loaded() || PatchALot) {
     patching_info = state_for(x, x->state_before());
 
     // cannot re-use same xhandlers for multiple CodeEmitInfos, so
-    // clone all handlers.
+    // clone all handlers.  This is handled transparently in other
+    // places by the CodeEmitInfo cloning logic but is handled
+    // specially here because a stub isn't being used.
     x->set_exception_handlers(new XHandlers(x->exception_handlers()));
   }
-
   CodeEmitInfo* info = state_for(x, x->state());
 
   i = dims->length();