This implements the STMT_ARRAY_CHECK(array_check) rule according to the x86-64 ABI.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro> --- arch/x86/insn-selector.brg | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index 44e8154..34d11fc 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg @@ -2592,6 +2592,7 @@ array_check: EXPR_ARRAY_DEREF(reg, reg) 2 select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG, state_index, index)); } +%ifdef CONFIG_X86_32 stmt: STMT_ARRAY_CHECK(array_check) { struct var_info *ref, *index; @@ -2605,6 +2606,24 @@ stmt: STMT_ARRAY_CHECK(array_check) method_args_cleanup(s, tree, 2); select_exception_test(s, tree); } +%else +stmt: STMT_ARRAY_CHECK(array_check) +{ + struct var_info *ref, *index, *rdi, *rsi; + + ref = state->left->reg1; + index = state->left->reg2; + + rdi = get_fixed_var(s->b_parent, MACH_REG_RDI); + rsi = get_fixed_var(s->b_parent, MACH_REG_RSI); + + select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG, ref, rdi)); + select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG, index, rsi)); + select_insn(s, tree, rel_insn(INSN_CALL_REL, (unsigned long) vm_object_check_array)); + + select_exception_test(s, tree); +} +%endif stmt: STMT_IF(reg) { -- 1.6.0.6 ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel