You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/03/12 13:01:02 UTC

svn commit: r517187 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet: compiler.cpp jframe.h trace.cpp

Author: varlax
Date: Mon Mar 12 05:01:01 2007
New Revision: 517187

URL: http://svn.apache.org/viewvc?view=rev&rev=517187
Log:
Applied HARMONY-3035 [drlvm][jit] EUT coreruntime suit crash in JIT
Tested on SLES10@ia32 & SLES9@x64

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jframe.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?view=diff&rev=517187&r1=517186&r2=517187
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Mon Mar 12 05:01:01 2007
@@ -17,7 +17,6 @@
  */
 /**
  * @author Alexander Astapchuk
- * @version $Revision$
  */
  /**
   * @file
@@ -827,7 +826,10 @@
             unsigned next = lastInst.next;
             // If last inst was JSR, then when generating fall through,
             // specify the JSR leader as 'parent PC', so the BBState 
-            // to inherit will be taken the JSR's one.
+            // to inherit will be taken from the JSR's one. This also 
+            // processed in a special way in comp_gen_insts() - when we see 
+            // that a block's parent is JSR lead, we take the state from 
+            // m_jsrStates, rather than from the m_bbStates.
             unsigned h = lastInst.is_jsr() ? lastInst.get_target(0): head;
             if (lastInst.single_suc() && !m_bbs[next].processed) {
                 // If instruction has only one successor, so its BBState 
@@ -883,7 +885,25 @@
         return false;
     }
     BBState* pState = m_bbStates[pc];
-    BBState * parentState = m_bbStates[parentPC];
+    BBState * parentState;
+    {
+        const BBInfo& parentBB = m_bbs[parentPC];
+        // If we see that parent block was a JSR subroutine, this in fact 
+        // means that the parent block ended with a JSR call, and then 
+        // 'parentPC' of this block was substituted (see the appropriate 
+        // code in comp_gen_code_bb()).
+        // So, in this block we must use the state after the JSR subroutine.
+        // The 'jsr_lead != parentPC' prevents from taking state from m_jsrStates
+        // when the parentPC is the real parent, that is in a JSR subroutine
+        // with several blocks.
+        if (parentBB.jsr_target && jsr_lead != parentPC) {
+            assert(m_jsrStates.find(parentPC) != m_jsrStates.end());
+            parentState = m_jsrStates[parentPC];
+        }
+        else {
+            parentState = m_bbStates[parentPC];
+        }
+    }
 
     JInst& bbhead = m_insts[pc];
     if (pc != parentPC) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jframe.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jframe.h?view=diff&rev=517187&r1=517186&r2=517187
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jframe.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jframe.h Mon Mar 12 05:01:01 2007
@@ -50,6 +50,7 @@
     {
         m_stack = m_vars = NULL;
         max_stack = num_locals = 0;
+        m_top = -1;
     };
     ~JFrame()
     {
@@ -64,6 +65,7 @@
     {
         m_stack = m_vars = NULL;
         max_stack = num_locals = 0;
+        m_top = -1;
         *this = that;
     }
 public:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp?view=diff&rev=517187&r1=517186&r2=517187
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp Mon Mar 12 05:01:01 2007
@@ -629,19 +629,21 @@
         dbg(" %s", toStr2(s, true).c_str());
         dbg("\n;;  ");
     }
-    dbg("\n;;\n");
-    dbg(";; regs: ");
-    bool not_first = false;
-    for (unsigned i=0; i<ar_num; i++) {
-        AR ar = _ar(i);
-        if (rrefs(ar) != 0 || rlocks(ar) != 0) {
-            if (not_first) {
-                dbg(",");
+    if (m_bbstate == pState) {
+        dbg("\n;;\n");
+        dbg(";; regs: ");
+        bool not_first = false;
+        for (unsigned i=0; i<ar_num; i++) {
+            AR ar = _ar(i);
+            if (rrefs(ar) != 0 || rlocks(ar) != 0) {
+                if (not_first) {
+                    dbg(",");
+                }
+                if (rlocks(ar)!=0) { dbg(">"); }
+                dbg("%s[%d]", Encoder::to_str(ar).c_str(), rrefs(ar));
+                if (rlocks(ar)!=0) { dbg("<,%d", rlocks(ar)); }
+                not_first = true;
             }
-            if (rlocks(ar)!=0) { dbg(">"); }
-            dbg("%s[%d]", Encoder::to_str(ar).c_str(), rrefs(ar));
-            if (rlocks(ar)!=0) { dbg("<,%d", rlocks(ar)); }
-            not_first = true;
         }
     }
     dbg("\n;;\n");