harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r446788 - in /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src: jni/jni.cpp thread/mon_enter_exit.cpp util/em64t/base/compile_em64t.cpp util/ia32/base/compile_IA32.cpp
Date Fri, 15 Sep 2006 23:51:04 GMT
Author: geirm
Date: Fri Sep 15 16:51:03 2006
New Revision: 446788

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

Fix missed exception from compilation stage

When native code throwing exception during compilation (example, VerifyError), VM missing
catch handler in java 
frame.

tested on ubuntu - smoke and c-unit passed, still failures on kernel


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/mon_enter_exit.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp?view=diff&rev=446788&r1=446787&r2=446788
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp Fri Sep 15 16:51:03 2006
@@ -1016,6 +1016,8 @@
 
 jint JNICALL MonitorExit(JNIEnv * UNREF env, jobject obj)
 {
+    ASSERT_RAISE_AREA;
+
     TRACE2("jni", "MonitorExit called");
     assert(hythread_is_suspend_enabled());
     jthread_monitor_exit(obj);

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/mon_enter_exit.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/mon_enter_exit.cpp?view=diff&rev=446788&r1=446787&r2=446788
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/mon_enter_exit.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/mon_enter_exit.cpp Fri Sep
15 16:51:03 2006
@@ -86,6 +86,8 @@
 
 static void vm_monitor_exit_default(ManagedObject *p_obj)
 {
+    ASSERT_RAISE_AREA;
+
     assert(managed_object_is_valid(p_obj));
     //
     assert(!hythread_is_suspend_enabled());

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp?view=diff&rev=446788&r1=446787&r2=446788
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
Fri Sep 15 16:51:03 2006
@@ -29,6 +29,8 @@
 #include "nogc.h"
 #include "m2n.h"
 #include "../m2n_em64t_internal.h"
+#include "exceptions.h"
+#include "exceptions_jit.h"
 
 #define LOG_DOMAIN "vm.helpers"
 #include "cxxlog.h"
@@ -146,7 +148,7 @@
         return addr;
     }
 
-    const int STUB_SIZE = 350;
+    const int STUB_SIZE = 357;
     char * stub = (char *) malloc_fixed_code_for_jit(STUB_SIZE,
         DEFAULT_CODE_ALIGNMENT, CODE_BLOCK_HEAT_DEFAULT, CAA_Allocate);
     addr = stub;
@@ -183,6 +185,12 @@
     stub = mov(stub, rdi_opnd, M_Base_Opnd(rsp_reg, 0));
     // compile the method
     stub = call(stub, (char *)&compile_jit_a_method);
+
+    // rethrow exception if it panding
+    stub = push(stub, rax_opnd);
+    stub = call(stub, (char *)&exn_rethrow_if_pending);
+    stub = pop(stub, rax_opnd);
+
     // restore gp inputs from the stack
     // NOTE: m2n_gen_pop_m2n must not destroy inputs
     stub = pop(stub, rdi_opnd);

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp?view=diff&rev=446788&r1=446787&r2=446788
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp Fri
Sep 15 16:51:03 2006
@@ -174,14 +174,16 @@
     stub = push(stub, ecx_opnd);
     // compile the method
     stub = call(stub, (char *)&compile_jit_a_method);
+
+    // rethrow exception if it panding
+    stub = push(stub, eax_opnd);
+    stub = call(stub, (char *)&exn_rethrow_if_pending);
+    stub = pop(stub, eax_opnd);
+
     // remove ecx from the stack
     stub = pop(stub, ecx_opnd);
     // pop m2n from the stack
     stub = m2n_gen_pop_m2n(stub, false, 0, 0, 1);
-    stub = push(stub, eax_opnd);
-    // rethrow exception if
-    stub = call(stub, (char *)&exn_rethrow_if_pending);
-    stub = pop(stub, eax_opnd);
     // transfer control to the compiled code
     stub = jump(stub, eax_opnd);
     



Mime
View raw message