harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r462758 - /incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp
Date Wed, 11 Oct 2006 10:28:55 GMT
Author: mloenko
Date: Wed Oct 11 03:28:54 2006
New Revision: 462758

URL: http://svn.apache.org/viewvc?view=rev&rev=462758
Log:
applied patch from HARMONY-1678
[DRLVM] junit test o.a.h.crypto.tests.javax.crypto.EncryptedPrivateKeyInfoTest fails

Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp?view=diff&rev=462758&r1=462757&r2=462758
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp Wed Oct 11 03:28:54
2006
@@ -580,7 +580,7 @@
 void Compiler::gen_bb_leave(unsigned to)
 {
     if (is_set(DBG_TRACE_CG)) { dbg(";;>bb_leave to %d\n", to); }
-    unsigned ref_count;
+    bool targetIsMultiRef = false;
     bool to_eh;
     if (to == NOTHING || m_pc == 0 || g_jvmtiMode) {
         // leaving JSR block - act as if were leaving to multiref block
@@ -588,19 +588,32 @@
         // and gen_prolog().
         // The same for JVMTI mode - do not allow a thing to be transferred
         // on a temporary register between basic blocks
-        ref_count = 2;
+        targetIsMultiRef = true;
         to_eh = false;
     }
     else {
-        ref_count = m_insts[to].ref_count;
         const BBInfo& bbto = m_bbs[to];
         // Must be BB
         assert(m_bbs.find(to) != m_bbs.end());
         // Jumps to ehandler ?
         to_eh = bbto.ehandler;
+         // Now, check where the control flow may be transferred from the 
+         // current instruction. If *any* of the targets is multi-ref, then
+         // perform a full sync.
+         const JInst& jinst = *m_curr_inst;
+         for (unsigned i=0; i<jinst.get_num_targets(); i++) {
+             unsigned targetPC = jinst.get_target(i);
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
+         if (jinst.is_switch()) {
+             unsigned targetPC = jinst.get_def_target();
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
+         if (!jinst.is_set(OPF_DEAD_END)) {
+             unsigned targetPC  = jinst.next;
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
     }
-    // Must be reachable
-    assert(ref_count != 0);
     
     if (to_eh) {
         // we're generating a 'goto/fall through/if_' to a basic block
@@ -614,7 +627,7 @@
         assert(m_jframe->dip(0).is_reg() && m_jframe->dip(0).reg() == gr_ret);
     }
     
-    if (ref_count == 1 && !to_eh) {
+    if (!targetIsMultiRef && !to_eh) {
         // nothing to do anymore
         if (is_set(DBG_TRACE_CG)) { dbg(";;>~bb_leave\n"); }
         return;



Mime
View raw message