Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- include/jit/args.h | 1 - include/vm/types.h | 1 + jit/args.c | 54 ---------------------------------------------------- vm/types.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/include/jit/args.h b/include/jit/args.h index 5728048..8e9bceb 100644 --- a/include/jit/args.h +++ b/include/jit/args.h @@ -17,7 +17,6 @@ struct expression *convert_args(struct stack *mimic_stack, struct vm_method *method); struct expression *convert_native_args(struct stack *mimic_stack, unsigned long nr_args); -const char *parse_method_args(const char *type_str, enum vm_type *vmtype, char **name_p); #ifndef CONFIG_ARGS_MAP static inline int args_map_init(struct vm_method *method) diff --git a/include/vm/types.h b/include/vm/types.h index e7b3c42..cf2bc03 100644 --- a/include/vm/types.h +++ b/include/vm/types.h @@ -42,6 +42,7 @@ enum vm_type bytecode_type_to_vmtype(int); int vmtype_to_bytecode_type(enum vm_type); int get_vmtype_size(enum vm_type); const char *get_vm_type_name(enum vm_type); +const char *parse_method_args(const char *, enum vm_type *, char **); static inline bool vm_type_is_float(enum vm_type type) { diff --git a/jit/args.c b/jit/args.c index deed9c0..f054c5c 100644 --- a/jit/args.c +++ b/jit/args.c @@ -146,57 +146,3 @@ convert_native_args(struct stack *mimic_stack, unsigned long nr_args) out: return args_list; } - -const char *parse_method_args(const char *type_str, enum vm_type *vmtype, - char **name_p) -{ - const char *type_name_start; - - if (*type_str == '(') - type_str++; - - type_name_start = type_str; - - if (name_p) - *name_p = NULL; - - if (*type_str == ')') - return NULL; - - if (*type_str == '[') { - *vmtype = J_REFERENCE; - type_str++; - - if (*type_str != 'L') { - type_str++; - goto out; - } - } - - if (*type_str == 'L') { - ++type_name_start; - ++type_str; - while (*(type_str++) != ';') - ; - *vmtype = J_REFERENCE; - } else { - char primitive_name[2]; - - primitive_name[0] = *(type_str++); - primitive_name[1] = 0; - - *vmtype = str_to_type(primitive_name); - } - - out: - if (name_p) { - size_t size = (size_t) type_str - (size_t) type_name_start; - - if (*vmtype == J_REFERENCE) - size--; - - *name_p = strndup(type_name_start, size); - } - - return type_str; -} diff --git a/vm/types.c b/vm/types.c index 27f5c3c..2ff98de 100644 --- a/vm/types.c +++ b/vm/types.c @@ -160,3 +160,57 @@ const char *get_vm_type_name(enum vm_type type) { return vm_type_names[type]; } + +const char *parse_method_args(const char *type_str, enum vm_type *vmtype, + char **name_p) +{ + const char *type_name_start; + + if (*type_str == '(') + type_str++; + + type_name_start = type_str; + + if (name_p) + *name_p = NULL; + + if (*type_str == ')') + return NULL; + + if (*type_str == '[') { + *vmtype = J_REFERENCE; + type_str++; + + if (*type_str != 'L') { + type_str++; + goto out; + } + } + + if (*type_str == 'L') { + ++type_name_start; + ++type_str; + while (*(type_str++) != ';') + ; + *vmtype = J_REFERENCE; + } else { + char primitive_name[2]; + + primitive_name[0] = *(type_str++); + primitive_name[1] = 0; + + *vmtype = str_to_type(primitive_name); + } + + out: + if (name_p) { + size_t size = (size_t) type_str - (size_t) type_name_start; + + if (*vmtype == J_REFERENCE) + size--; + + *name_p = strndup(type_name_start, size); + } + + return type_str; +} -- 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