2009/7/1 Tomek Grabiec <tgrab...@gmail.com>:
>
> Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
> ---
>  include/vm/types.h |    2 ++
>  vm/types.c         |   39 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+), 0 deletions(-)
>
> diff --git a/include/vm/types.h b/include/vm/types.h
> index 1455439..54d2c60 100644
> --- a/include/vm/types.h
> +++ b/include/vm/types.h
> @@ -19,5 +19,7 @@ extern enum vm_type str_to_type(char *);
>  extern enum vm_type get_method_return_type(char *);
>
>  int count_arguments(const char *);
> +enum vm_type bytecode_type_to_vmtype(int);
> +int get_vmtype_size(enum vm_type);
>
>  #endif
> diff --git a/vm/types.c b/vm/types.c
> index 1ff23bd..b21e7a9 100644
> --- a/vm/types.c
> +++ b/vm/types.c
> @@ -1,4 +1,6 @@
>  #include <vm/types.h>
> +#include <vm/die.h>
> +#include <vm/vm.h>
>
>  /* See Table 4.2 in Section 4.3.2 ("Field Descriptors") of the JVM
>    specification.  */
> @@ -132,3 +134,40 @@ int count_arguments(const char *type)
>
>        return args;
>  }
> +
> +static enum vm_type bytecode_type_to_vmtype_map[] = {
> +       [T_BOOLEAN] = J_BOOLEAN,
> +       [T_CHAR] = J_CHAR,
> +       [T_FLOAT] = J_FLOAT,
> +       [T_DOUBLE] = J_DOUBLE,
> +       [T_BYTE] = J_BYTE,
> +       [T_SHORT] = J_SHORT,
> +       [T_INT] = J_INT,
> +       [T_LONG] = J_LONG,
> +};
> +
> +enum vm_type bytecode_type_to_vmtype(int type)
> +{

+ assert(type >= 0 && type < ARRAY_SIZE(bytecode_to_vmtype));

I think :-)

> +       return bytecode_type_to_vmtype_map[type];

Otherwise:

Acked-by: Vegard Nossum <vegard.nos...@gmail.com>


Vegard

------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to