Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 82225 invoked from network); 8 Mar 2007 13:49:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Mar 2007 13:49:33 -0000 Received: (qmail 54020 invoked by uid 500); 8 Mar 2007 13:49:41 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 53995 invoked by uid 500); 8 Mar 2007 13:49:41 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 53986 invoked by uid 99); 8 Mar 2007 13:49:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 05:49:41 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2007 05:49:32 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8B89A1A9838; Thu, 8 Mar 2007 05:49:11 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: gshimansky@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070308134911.8B89A1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(®s, in_java); + regs_push_param(®s, in_java, 1/*2nd arg */); // push the exn_class argument onto stack assert(exn_class); - regs_push_param_onto_stack(®s, (POINTER_SIZE_INT)exn_class); + regs_push_param(®s, (POINTER_SIZE_INT)exn_class, 0/* 1st arg */); // imitate return IP on stack - regs_push_param_onto_stack(®s, 0); + regs_push_return_address(®s, 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(®s, (POINTER_SIZE_INT)regs.get_ip()); + regs_push_return_address(®s, 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(®s, (POINTER_SIZE_INT)regs.get_ip()); + regs_push_return_address(®s, 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