This implements STMT_ARRAY_STORE_CHECK(reg, reg) according to the x86-64
ABI.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro>
---
 arch/x86/insn-selector.brg |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
index 34d11fc..5536d8f 100644
--- a/arch/x86/insn-selector.brg
+++ b/arch/x86/insn-selector.brg
@@ -2498,6 +2498,7 @@ stmt:     STMT_STORE(freg, array_deref)
                select_insn(s, tree, 
memindex_reg_insn(INSN_MOV_64_MEMINDEX_XMM, base, index, scale, dest));
 }
 
+%ifdef CONFIG_X86_32
 stmt:  STMT_ARRAY_STORE_CHECK(reg, reg) 1
 {
        struct expression *src_expr;
@@ -2519,6 +2520,36 @@ stmt:    STMT_ARRAY_STORE_CHECK(reg, reg) 1
        method_args_cleanup(s, tree, 2);
        select_exception_test(s, tree);
 }
+%else
+stmt:  STMT_ARRAY_STORE_CHECK(reg, reg) 1
+{
+       struct expression *src_expr;
+       struct statement *stmt;
+       struct var_info *rdi, *rsi;
+
+       stmt = to_stmt(tree);
+       src_expr = to_expr(stmt->store_check_src);
+
+       rdi = get_fixed_var(s->b_parent, MACH_REG_RDI);
+       rsi = get_fixed_var(s->b_parent, MACH_REG_RSI);
+
+       if (src_expr->vm_type == J_REFERENCE) {
+               select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG,
+                                                 state->right->reg1, rdi));
+               select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG,
+                                                 state->left->reg1, rsi));
+               select_insn(s, tree, rel_insn(INSN_CALL_REL, (unsigned long) 
array_store_check));
+       } else {
+               select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG,
+                                                 state->right->reg1, rdi));
+               select_insn(s, tree, imm_reg_insn(INSN_MOV_IMM_REG,
+                                                 src_expr->vm_type, rsi));
+               select_insn(s, tree, rel_insn(INSN_CALL_REL, (unsigned long) 
array_store_check_vmtype));
+       }
+
+       select_exception_test(s, tree);
+}
+%endif
 
 stmt:  STMT_ARRAY_STORE_CHECK(freg, reg) 1
 {
-- 
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

Reply via email to