We can now trace all types of return values.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 arch/x86/insn-selector.brg |    7 +++++++
 jit/trace-jit.c            |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
index fedf194..65bc5d1 100644
--- a/arch/x86/insn-selector.brg
+++ b/arch/x86/insn-selector.brg
@@ -2869,6 +2869,7 @@ static void select_trace_return_value(struct basic_block 
*s,
                                      struct vm_method *vmm)
 {
        struct var_info *eax = get_fixed_var(s->b_parent, MACH_REG_xAX);
+       struct var_info *edx = get_fixed_var(s->b_parent, MACH_REG_xDX);
        struct var_info *esp = get_fixed_var(s->b_parent, MACH_REG_xSP);
 
        enum vm_type ret_vm_type = method_return_type(vmm);
@@ -2879,6 +2880,9 @@ static void select_trace_return_value(struct basic_block 
*s,
        } else if (ret_vm_type == J_DOUBLE) {
                select_insn(s, tree, imm_reg_insn(INSN_SUB_IMM_REG, 8, esp));
                select_insn(s, tree, membase_insn(INSN_FSTP_64_MEMBASE, esp, 
0));
+       } else if (ret_vm_type == J_LONG) {
+               select_insn(s, tree, reg_insn(INSN_PUSH_REG, edx));
+               select_insn(s, tree, reg_insn(INSN_PUSH_REG, eax));
        } else {
                select_insn(s, tree, reg_insn(INSN_PUSH_REG, eax));
        }
@@ -2894,6 +2898,9 @@ static void select_trace_return_value(struct basic_block 
*s,
        } else if (ret_vm_type == J_DOUBLE) {
                select_insn(s, tree, membase_insn(INSN_FLD_64_MEMBASE, esp, 0));
                select_insn(s, tree, imm_reg_insn(INSN_ADD_IMM_REG, 8, esp));
+       } else if (ret_vm_type == J_LONG) {
+               select_insn(s, tree, reg_insn(INSN_POP_REG, eax));
+               select_insn(s, tree, reg_insn(INSN_POP_REG, edx));
        } else {
                select_insn(s, tree, reg_insn(INSN_POP_REG, eax));
        }
diff --git a/jit/trace-jit.c b/jit/trace-jit.c
index 84edea3..9615cb5 100644
--- a/jit/trace-jit.c
+++ b/jit/trace-jit.c
@@ -733,7 +733,7 @@ void trace_return_value(struct vm_method *vmm, unsigned 
long long value)
 
        trace_printf("trace return: %s.%s%s\n", vmm->class->name, vmm->name,
                     vmm->type);
-       if (type == J_VOID || type == J_LONG)
+       if (type == J_VOID)
                return;
 
        trace_printf("%12s: ", get_vm_type_name(type));
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to