harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r453668 - in /incubator/harmony/enhanced/drlvm/trunk/vm: jitrino/src/jet/bcproc.cpp jitrino/src/jet/cg_regs.cpp vmcore/include/version_svn_tag.h
Date Fri, 06 Oct 2006 16:36:49 GMT
Author: geirm
Date: Fri Oct  6 09:36:48 2006
New Revision: 453668

URL: http://svn.apache.org/viewvc?view=rev&rev=453668
Log:
HARMONY-1681

The problem:
Implementation of set/get local variable in .jet only operates with
the local variables in method's stack frame (in memory). It does not
work if a variable is stored on a register.

Normaly, Jitrino.JET does not allocate registers for local variables
globally when running under JVMTI.
However, many operations may reuest temporary register and store a
value on it. For example:

    INVOKExxx foo()I ; returned value is now in EAX
    ISTORE_x ; local#x is now on EAX
    <do_something> ; <=get_local_var(x) will get a wrong value here

The solution:
To handle such situations, code generator must spill out all registers
after each bytecode instruction.

The attached fix does it. 

Ubuntu 6, smoke, c-unit, ~kernel


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp?view=diff&rev=453668&r1=453667&r2=453668
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp Fri Oct  6 09:36:48
2006
@@ -81,6 +81,12 @@
         gen_dbg_check_stack(false);
     }
 
+    if (g_jvmtiMode) {
+        // Do not allow values to cross instruction boundaries
+        // on a temporary registers
+        vpark();
+    }
+
     const bool has_fall_through = !(jinst.flags & OPF_DEAD_END);
     if (last && has_fall_through && jinst.get_num_targets() == 0) {
         gen_bb_leave(jinst.next);

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=453668&r1=453667&r2=453668
==============================================================================
--- 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 Fri Oct  6 09:36:48
2006
@@ -582,10 +582,12 @@
     if (is_set(DBG_TRACE_CG)) { dbg(";;>bb_leave to %d\n", to); }
     unsigned ref_count;
     bool to_eh;
-    if (to == NOTHING || m_pc == 0) {
+    if (to == NOTHING || m_pc == 0 || g_jvmtiMode) {
         // leaving JSR block - act as if were leaving to multiref block
         // Also, special processing for 0th BB - see also gen_bb_enter() 
         // 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;
         to_eh = false;
     }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h?view=diff&rev=453668&r1=453667&r2=453668
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h Fri Oct  6
09:36:48 2006
@@ -18,6 +18,6 @@
 #ifndef _VERSION_SVN_TAG_
 #define _VERSION_SVN_TAG_
 
-#define VERSION_SVN_TAG  "453287"
+#define VERSION_SVN_TAG  "453599"
 
 #endif // _VERSION_SVN_TAG_



Mime
View raw message