From d173ca2062821e988c40152622d335a926c96d1f Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Sun, 26 Nov 2006 16:34:26 +0000 Subject: [PATCH] patch #5278 --- ChangeLog | 7 ++++++- jit/jit-rules-x86.ins | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index df1ec09..e92ee7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-26 Kirill Kononenko + + * jit/jit-rules-x86.ins: if JIT_USE_SIGNALS is defined do not emit + explicit division by zero check (patch #5278). + 2006-11-26 Aleksey Demakov * jit/jit-reg-alloc.c (choose_output_register): fix global register @@ -261,7 +266,7 @@ * jit/Makefile.am: add jit/jit-signal.c; * jit/jit-signal.c, jit/jit-internal.h: add _jit_signal_init(); * jit/jit-init.c: call _jit_signal_init() if JIT_USE_SIGNALS is - defined. + defined. (patch #5278.) 2006-08-11 Thomas Cort diff --git a/jit/jit-rules-x86.ins b/jit/jit-rules-x86.ins index f69d9f5..3a3bf47 100644 --- a/jit/jit-rules-x86.ins +++ b/jit/jit-rules-x86.ins @@ -550,11 +550,13 @@ JIT_OP_IDIV: more_space } [reg("eax"), reg, scratch("edx")] -> { unsigned char *patch, *patch2; +#ifndef JIT_USE_SIGNALS x86_alu_reg_reg(inst, X86_OR, $2, $2); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); inst = throw_builtin(inst, func, JIT_RESULT_DIVISION_BY_ZERO); x86_patch(patch, inst); +#endif x86_alu_reg_imm(inst, X86_CMP, $2, -1); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); @@ -589,12 +591,14 @@ JIT_OP_IDIV_UN: more_space x86_div_reg(inst, $3, 0); } [reg("eax"), reg, scratch("edx")] -> { +#ifndef JIT_USE_SIGNALS unsigned char *patch; x86_alu_reg_reg(inst, X86_OR, $2, $2); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); inst = throw_builtin(inst, func, JIT_RESULT_DIVISION_BY_ZERO); x86_patch(patch, inst); +#endif x86_clear_reg(inst, X86_EDX); x86_div_reg(inst, $2, 0); } @@ -624,11 +628,13 @@ JIT_OP_IREM: more_space } [=reg("edx"), *reg("eax"), reg, scratch("edx")] -> { unsigned char *patch, *patch2; +#ifndef JIT_USE_SIGNALS x86_alu_reg_reg(inst, X86_OR, $3, $3); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); inst = throw_builtin(inst, func, JIT_RESULT_DIVISION_BY_ZERO); x86_patch(patch, inst); +#endif x86_alu_reg_imm(inst, X86_CMP, $3, -1); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); @@ -659,12 +665,14 @@ JIT_OP_IREM_UN: more_space x86_div_reg(inst, $4, 0); } [=reg("edx"), *reg("eax"), reg, scratch("edx")] -> { +#ifndef JIT_USE_SIGNALS unsigned char *patch; x86_alu_reg_reg(inst, X86_OR, $3, $3); patch = inst; x86_branch8(inst, X86_CC_NE, 0, 0); inst = throw_builtin(inst, func, JIT_RESULT_DIVISION_BY_ZERO); x86_patch(patch, inst); +#endif x86_clear_reg(inst, X86_EDX); x86_div_reg(inst, $3, 0); } -- 2.47.3