changeset 1542:b94634952902

Why???
author Gary Benson <gbenson@redhat.com>
date Thu, 20 May 2010 08:55:55 +0100
parents 62259ae1ff0e
children 747e36a87ea8
files src/share/vm/shark/sharkTopLevelBlock.cpp
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/shark/sharkTopLevelBlock.cpp	Thu May 20 08:45:55 2010 +0100
+++ b/src/share/vm/shark/sharkTopLevelBlock.cpp	Thu May 20 08:55:55 2010 +0100
@@ -455,7 +455,10 @@
       break;
     _exc_handlers->append(handler);
 
-    // Try and get this exception's handler from typeflow
+    // Try and get this exception's handler from typeflow.  We should
+    // do it this way always, really, except that typeflow sometimes
+    // doesn't record exceptions, even loaded ones, and sometimes it
+    // returns them with a different handler bci.  Why???
     SharkTopLevelBlock *block = NULL;
     ciInstanceKlass* klass;
     if (handler->is_catch_all()) {
@@ -467,8 +470,10 @@
     for (int i = 0; i < ciblock()->exceptions()->length(); i++) {
       if (klass == ciblock()->exc_klasses()->at(i)) {
         block = function()->block(ciblock()->exceptions()->at(i)->pre_order());
-        assert(block->start() == handler->handler_bci(), "should do");
-        break;
+        if (block->start() == handler->handler_bci())
+          break;
+        else
+          block = NULL;
       }
     }