Some code needs to know the Java type of the arguments and it is not
enough to know the assigned registers. Therefore we also record the
vm_type.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro>
---
 arch/x86/args.c     |    7 ++++++-
 include/vm/method.h |    1 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/args.c b/arch/x86/args.c
index c6835a1..9b93f18 100644
--- a/arch/x86/args.c
+++ b/arch/x86/args.c
@@ -78,6 +78,7 @@ int args_map_init(struct vm_method *method)
                map = &method->args_map[0];
                map->reg = args_map_alloc_gpr(gpr_count++);
                map->stack_index = -1;
+               map->type = J_REFERENCE;
                idx = 1;
        } else
                idx = 0;
@@ -112,6 +113,8 @@ int args_map_init(struct vm_method *method)
                        break;
                }
 
+               map->type = vm_type;
+
                idx++;
 
                if (gpr_count == 6)
@@ -119,11 +122,13 @@ int args_map_init(struct vm_method *method)
        }
 
        /* We're out of GPRs, so the remaining args go on the stack. */
-       for (; idx < method->args_count; idx++) {
+       for (; type && idx < method->args_count; idx++) {
                map = &method->args_map[idx];
+               type = parse_method_args(type, &vm_type, NULL);
 
                map->reg = MACH_REG_UNASSIGNED;
                map->stack_index = stack_count++;
+               map->type = vm_type;
        }
 
        method->reg_args_count = gpr_count;
diff --git a/include/vm/method.h b/include/vm/method.h
index 7c9e0d7..13fa88d 100644
--- a/include/vm/method.h
+++ b/include/vm/method.h
@@ -23,6 +23,7 @@ struct vm_class;
 struct vm_args_map {
        int                     reg;
        int                     stack_index;
+       enum vm_type            type;
 };
 #endif
 
-- 
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