harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r598995 - /harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp
Date Wed, 28 Nov 2007 13:34:05 GMT
Author: varlax
Date: Wed Nov 28 05:34:05 2007
New Revision: 598995

URL: http://svn.apache.org/viewvc?rev=598995&view=rev
Log:
Applied HARMONY-5177  [drlvm][jit] Dacapo.eclipse bench failed on 8th iteration

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp?rev=598995&r1=598994&r2=598995&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/throwopt.cpp Wed Nov 28 05:34:05
2007
@@ -78,12 +78,22 @@
 
         if (catch_node) {
             assert(catch_node->isCatchBlock());
-            // Found target block.
-            Node * target_node = catch_node;
-            if (catch_node->getSecondInst() == NULL) {
-                target_node = catch_node->getUnconditionalEdgeTarget();
-            }
             
+            // Find target block and catch instruction.
+            Node * target_node = catch_node;
+            Inst * catch_inst = NULL;
+            do {
+                for (Inst * i = (Inst *)target_node->getSecondInst(); i != NULL; i = i->getNextInst())
{
+                    if (i->getOpcode() == Op_Catch) {
+                        catch_inst = i;
+                        break;
+                    }
+                }
+            } while (catch_inst == NULL && (target_node = target_node->getUnconditionalEdgeTarget())
!= NULL);
+
+            assert(target_node);
+            assert(catch_inst->getOpcode() == Op_Catch);
+
             if (Log::isEnabled()) {
                 Log::out() << "Trying to elimination ";
                 throw_inst->print(Log::out());
@@ -106,10 +116,6 @@
                 continue;
             }
 
-            Inst * catch_inst = (Inst *)target_node->getSecondInst();
-            while (catch_inst->getOpcode() != Op_Catch) {
-                catch_inst = (Inst*)catch_inst->next();
-            }
             Opnd * catch_opnd = catch_inst->getDst();
             VarOpnd * dst_var = NULL;
             Inst * st_inst = NULL;



Mime
View raw message