harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r516041 - in /harmony/enhanced/drlvm/trunk/vm: port/src/lil/em64t/pim/ vmcore/src/util/win/em64t/ vmcore/src/util/win/ia32/ vmcore/src/util/win/ia32_em64t/ vmcore/src/util/win/include/
Date Thu, 08 Mar 2007 13:49:11 GMT
Author: gshimansky
Date: Thu Mar  8 05:49:10 2007
New Revision: 516041

URL: http://svn.apache.org/viewvc?view=rev&rev=516041
Log:
Applied HARMONY-3331  [drlvm][winx64] Fixed exception processing


Modified:
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/stack_iterator_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/stack_iterator_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/stack_iterator_em64t.cpp?view=diff&rev=516041&r1=516040&r2=516041
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/stack_iterator_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/stack_iterator_em64t.cpp Thu Mar
 8 05:49:10 2007
@@ -334,9 +334,8 @@
 
     Global_Env *env = VM_Global_State::loader_env;
     // Setup current frame
+    // It's possible that registers represent native code and res->cci==NULL
     si->cci = env->vm_methods->find((NativeCodePtr)regs->rip, is_ip_past);
-    assert(si->cci);
-
     init_context_from_registers(si->jit_frame_context, *regs, is_ip_past);
     
     si->m2n_frame = lm2nf;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp?view=diff&rev=516041&r1=516040&r2=516041
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp Thu
Mar  8 05:49:10 2007
@@ -106,8 +106,28 @@
     return (void*)pregs->rsp;
 }
 
-void regs_push_param_onto_stack(Registers* pregs, POINTER_SIZE_INT param)
+// Max. 4 arguments can be set up
+void regs_push_param(Registers* pregs, POINTER_SIZE_INT param, int num)
+{ // RCX, RDX, R8, R9
+    switch (num)
+    {
+    case 0:
+        pregs->rcx = param;
+        return;
+    case 1:
+        pregs->rdx = param;
+        return;
+    case 2:
+        pregs->r8 = param;
+        return;
+    case 3:
+        pregs->r9 = param;
+        return;
+    }
+}
+
+void regs_push_return_address(Registers* pregs, void* ret_addr)
 {
     pregs->rsp = pregs->rsp - 8;
-    *((uint64*)pregs->rsp) = param;
+    *((void**)pregs->rsp) = ret_addr;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp?view=diff&rev=516041&r1=516040&r2=516041
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp Thu Mar
 8 05:49:10 2007
@@ -155,8 +155,14 @@
     return (void*)pregs->esp;
 }
 
-void regs_push_param_onto_stack(Registers* pregs, POINTER_SIZE_INT param)
+void regs_push_param(Registers* pregs, POINTER_SIZE_INT param, int UNREF num)
 {
     pregs->esp = pregs->esp - 4;
     *((uint32*)pregs->esp) = param;
+}
+
+void regs_push_return_address(Registers* pregs, void* ret_addr)
+{
+    pregs->esp = pregs->esp - 4;
+    *((void**)pregs->esp) = ret_addr;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp?view=diff&rev=516041&r1=516040&r2=516041
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp
Thu Mar  8 05:49:10 2007
@@ -321,12 +321,12 @@
 
     // __cdecl <=> push parameters in the reversed order
     // push in_java argument onto stack
-    regs_push_param_onto_stack(&regs, in_java);
+    regs_push_param(&regs, in_java, 1/*2nd arg */);
     // push the exn_class argument onto stack
     assert(exn_class);
-    regs_push_param_onto_stack(&regs, (POINTER_SIZE_INT)exn_class);
+    regs_push_param(&regs, (POINTER_SIZE_INT)exn_class, 0/* 1st arg */);
     // imitate return IP on stack
-    regs_push_param_onto_stack(&regs, 0);
+    regs_push_return_address(&regs, NULL);
 
     // set up the real exception handler address
     regs.set_ip(asm_c_exception_handler);
@@ -356,12 +356,12 @@
 
     if (ti->get_global_capability(DebugUtilsTI::TI_GC_ENABLE_EXCEPTION_EVENT)) {
         // Set return address to current IP
-        regs_push_param_onto_stack(&regs, (POINTER_SIZE_INT)regs.get_ip());
+        regs_push_return_address(&regs, regs.get_ip());
         // Set IP to callback address
         regs.set_ip(asm_jvmti_exception_catch_callback);
     } else if (p_TLS_vmthread->restore_guard_page) {
         // Set return address to current IP
-        regs_push_param_onto_stack(&regs, (POINTER_SIZE_INT)regs.get_ip());
+        regs_push_return_address(&regs, regs.get_ip());
         // Set IP to callback address
         regs.set_ip(asm_exception_catch_callback);
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h?view=diff&rev=516041&r1=516040&r2=516041
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h Thu Mar
 8 05:49:10 2007
@@ -62,7 +62,8 @@
 
 // Fuctions to manipulate with Registers structure
 void* regs_get_sp(Registers* pregs);
-void regs_push_param_onto_stack(Registers* pregs, POINTER_SIZE_INT param);
+void regs_push_param(Registers* pregs, POINTER_SIZE_INT param, int num);
+void regs_push_return_address(Registers* pregs, void* ret_addr);
 
 
 #endif // nt_exception_filter_h



Mime
View raw message