From 1e274b6593554d2fa0b6288f578d0cffd23a49f1 Mon Sep 17 00:00:00 2001 From: Klaus Treichel Date: Sun, 4 May 2008 16:53:08 +0000 Subject: [PATCH] Emit the check for null only if the value to check is nint constant != 0 in jit_insn_check_null. --- ChangeLog | 3 +++ jit/jit-insn.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index e57dfda..7dae313 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ register inhibited regardless if the value was already in the register or not. + * jit/jit-insn.c (jit_insn_check_null): Emit the check only if the + value to check is no nint constant != 0. + 2008-04-22 Aleksey Demakov * configure.in: update to modern autoconf, rename to configure.ac. diff --git a/jit/jit-insn.c b/jit/jit-insn.c index b9c47b7..7ad8f33 100644 --- a/jit/jit-insn.c +++ b/jit/jit-insn.c @@ -1850,6 +1850,11 @@ int jit_insn_check_null(jit_function_t func, jit_value_t value) { return 0; } + /* Do the check only if the value is no not Null constant */ + if(value->is_nint_constant && (value->address != 0)) + { + return 1; + } func->builder->may_throw = 1; return create_unary_note(func, JIT_OP_CHECK_NULL, value); } -- 2.47.3