Re: [PATCH] vm, x86: fix fixup_vtable()

2009-07-01 Thread Pekka Enberg
On Thu, 2009-07-02 at 08:24 +0200, Vegard Nossum wrote: > 2009/7/2 Tomek Grabiec : > > fixup_vtable() was using old ->method_index field which is no longer valid. > > > > Signed-off-by: Tomek Grabiec > > Acked-by: Vegard Nossum > > Sorry about that! > > The ->method_index refers to the method'

Re: [PATCH] vm, x86: fix fixup_vtable()

2009-07-01 Thread Vegard Nossum
2009/7/2 Tomek Grabiec : > fixup_vtable() was using old ->method_index field which is no longer valid. > > Signed-off-by: Tomek Grabiec Acked-by: Vegard Nossum Sorry about that! The ->method_index refers to the method's index in the class' ->methods array. So yeah, it doesn't _usually_ form a

Re: [PATCH 01/19] vm: use java/lang/Class.vmdata field to store the class pointer

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > > Signed-off-by: Tomek Grabiec > --- >  include/vm/java_lang.h |    1 + >  include/vm/object.h    |    4 >  vm/class.c             |    4 +++- >  vm/jato.c              |    5 - >  4 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/include/vm/java

[PATCH] vm, x86: fix fixup_vtable()

2009-07-01 Thread Tomek Grabiec
fixup_vtable() was using old ->method_index field which is no longer valid. Signed-off-by: Tomek Grabiec --- arch/x86/emit-code.c |2 +- vm/class.c |4 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index a348ab3.

[PATCH 1/2] vm: implement array_store_check()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/object.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/vm/object.c b/vm/object.c index 0f96e62..b5b1afc 100644 --- a/vm/object.c +++ b/vm/object.c @@ -317,22 +317,24 @@ void vm_object_check_array(struct vm_object *obj

Re: [PATCH 2/4] jit: add -Xtrace:invoke for tracing method invocations (v2)

2009-07-01 Thread Pekka Enberg
On Wed, 2009-07-01 at 10:38 +0200, Vegard Nossum wrote: > @@ -783,6 +783,17 @@ void emit_prolog(struct buffer *buf, unsigned long > nr_locals) > __emit_sub_imm_reg(buf, nr_locals * sizeof(unsigned long), > REG_ESP); > } > > +void emit_trace_invoke(struct buffer *buf, > + cons

Re: [PATCH 1/9] x86: added REG_MEMDISP instruction

2009-07-01 Thread Pekka Enberg
applied, thanks! -- ___ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Re: [PATCH] jit: temporaries for mimic stack spilling are now recursively propagated

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 16:27 +0200, Arthur Huillet wrote: > Hi, > > On Tue, 30 Jun 2009 16:04:33 +0200 > Arthur Huillet wrote: > > > please don't apply right now, I have a test that breaks. > > Please apply this patch, it is OK. > The test wasn't. :) Applied, thanks!

Re: [PATCH] x86: make code generated for EXPR_INVOKEVIRTUAL shorter

2009-07-01 Thread Pekka Enberg
On Mon, 2009-06-29 at 19:41 +0200, Tomek Grabiec wrote: > We do not have to load object reference from stack with this instruction: > > mov 0(%esp), %reg > > Before we select the code for EXPR_INVOKEVIRTUAL code for call arguments > is selected so we know what register was allocated to the argume

Re: [PATCH 8/8] vm: fix putstatic/getstatic/invokestatic

2009-07-01 Thread Pekka Enberg
On Mon, 2009-06-29 at 19:40 +0200, Vegard Nossum wrote: > In accordance with the JVM specification, we should only initialize > classes when the putstatic/getstatic/invokestatic instructions are > _executed_ (there are a few other cases too, but the main point is > that we cannot do this at method

Re: [PATCH] vm: don't initialize preloaded classes

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 00:01 +0200, Vegard Nossum wrote: > Alas, we cannot initialize these classes; the JVM spec. forbids it. > > Signed-off-by: Vegard Nossum > --- > vm/jato.c |9 - > 1 files changed, 0 insertions(+), 9 deletions(-) > > diff --git a/vm/jato.c b/vm/jato.c > index 6f

Re: [PATCH] jit: add more class/field names to tree-printer

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 09:08 +0200, Vegard Nossum wrote: > 08:59 < penberg_home> vegard: cool. > 08:59 < penberg_home> vegard: but doesn't that make debugging too easy? > > Signed-off-by: Vegard Nossum Applied, thanks!

Re: [PATCH] vm: fix method vtables

2009-07-01 Thread Pekka Enberg
On Mon, 2009-06-29 at 22:58 +0200, Vegard Nossum wrote: > We used to simply append the subclass' methods to the end of the > vtable of the superclass. > > With this patch, we only append those methods which are not defined in > the superclass; the methods which are defined in the superclass are >

Re: [PATCH] vm: initialize static fields (completely) to null

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 23:53 +0200, Vegard Nossum wrote: > We need to initialize static fields to zero even before the class > initializer runs (since the initializer may refer to static fields). > > This still needs a lot of work, but here is a preliminary fix that > initializes a whole pointer in

Re: [PATCH] jit: use OP_FADD OP_FSUB OP_FDIV OP_FMUL

2009-07-01 Thread Pekka Enberg
Applied, thanks! -- ___ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Re: [RFC][PATCH] jit: add -Xtrace:invoke for tracing method invocations

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 23:24 +0200, Vegard Nossum wrote: > + if (opt_trace_invoke) { > + emit_trace_invoke(cu->objcode, cu->method->class->name, > + cu->method->name, cu->method->type); > + } Please implement a jit_trace_function(struct compilation_unit *cu)

Re: [PATCH] jit: fix method_real_argument_count

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 19:55 +0200, Vegard Nossum wrote: > We're scanning the method signature to determine the number of "real" > arguments to pass for an "invoke" opcode. We use the function > method_real_argument_count() for this. But it doesn't skip class names, > so if there is an uppercase J o

Re: [PATCH] x86: add INSN_GPR_TO_XMM for floating point immediate values using SSE

2009-07-01 Thread Pekka Enberg
Applied, thanks! -- ___ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Re: [RFC][PATCH] jit: add more class/field names to tree-printer (v2)

2009-07-01 Thread Pekka Enberg
On Tue, 2009-06-30 at 19:31 +0200, Vegard Nossum wrote: > Here, second try. You may or may not like the new style; I think it > improves the overall readability (and mutability) quite a lot. > > 08:59 < penberg_home> vegard: cool. > 08:59 < penberg_home> vegard: but doesn't that make debugging too

[PATCH 2/2] jato: set system property 'java.vm.name' to 'jato'

2009-07-01 Thread Vegard Nossum
This is a requirement of GNU classpath (otherwise we crash with a NullPointerException). Signed-off-by: Vegard Nossum --- vm/jato.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 565754c..f7838ba 100644 --- a/vm/jato.c +++ b/vm/jato

[PATCH 1/2] vm: preload java.util.Properties

2009-07-01 Thread Vegard Nossum
Needed for VMSystemProperties initialisation. Signed-off-by: Vegard Nossum --- include/vm/java_lang.h |4 vm/jato.c | 34 ++ 2 files changed, 38 insertions(+), 0 deletions(-) diff --git a/include/vm/java_lang.h b/include/vm/java_lang.h ind

[PATCH 1/3] vm: preload java.util.Properties

2009-07-01 Thread Vegard Nossum
Needed for VMSystemProperties initialisation. Signed-off-by: Vegard Nossum --- include/vm/java_lang.h |4 +++ vm/jato.c | 51 --- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/include/vm/java_lang.h b/include/vm/jav

[PATCH 2/3] jato: set system property 'java.vm.name' to 'jato'

2009-07-01 Thread Vegard Nossum
This is a requirement of GNU classpath (otherwise we crash with a NullPointerException). Signed-off-by: Vegard Nossum --- vm/jato.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index fb47173..05239ac 100644 --- a/vm/jato.c +++ b/vm/jato

[PATCH 3/3] runtime: remove VMSystemProperties

2009-07-01 Thread Vegard Nossum
We'd better just use the one that ships with GNU Classpath. Signed-off-by: Vegard Nossum --- Makefile |3 +-- .../gnu/classpath/VMSystemProperties.java | 10 -- 2 files changed, 1 insertions(+), 12 deletions(-) delete mode 100644

[PATCH] regression: add test for string concatenation

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/StringTest.java | 14 +- regression/jvm/TestCase.java |4 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/regression/jvm/StringTest.java b/regression/jvm/StringTest.java index 3a9e0d0..dc69195 100644 --- a/r

[PATCH] vm: implement VMSystem.arraycopy()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c | 60 +--- 1 files changed, 57 insertions(+), 3 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index c7c6e17..12badf2 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -86,10 +86,64 @@ static void __vm

[PATCH] vm: use array_(set|get)_field_*() to access array elements

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/object.h | 12 vm/object.c |9 - vm/utf8.c |7 +++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/vm/object.h b/include/vm/object.h index 6fcdfa0..a38a1d3 100644 --- a/includ

[PATCH] build: add Makefile in regression/ as a dev process speedup

2009-07-01 Thread Arthur Huillet
Signed-off-by: Arthur Huillet --- regression/Makefile |5 + 1 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 regression/Makefile diff --git a/regression/Makefile b/regression/Makefile new file mode 100644 index 000..4883b97 --- /dev/null +++ b/regression/Makefile

[PATCH 2/2] regression: enable fixed exceptions test for array store

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/ArrayExceptionsTest.java |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regression/jvm/ArrayExceptionsTest.java b/regression/jvm/ArrayExceptionsTest.java index d1a726d..3d5300e 100644 --- a/regression/jvm/ArrayExceptio

[PATCH] vm: allocate enough memory for inherited fields, amendment #2

2009-07-01 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector_32.brg |7 --- vm/class.c| 15 --- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg index 6346454..9b918f6 100644 --- a/ar

[PATCH 5/9] vm: fix typo in include/vm/class.h

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/class.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/vm/class.h b/include/vm/class.h index 4693e3e..6782ae5 100644 --- a/include/vm/class.h +++ b/include/vm/class.h @@ -52,7 +52,7 @@ struct vm_class { struct

[PATCH] x86: add FPU->GPR conversion, and FADD

2009-07-01 Thread Arthur Huillet
Signed-off-by: Arthur Huillet --- arch/x86/emit-code.c| 18 ++ arch/x86/include/arch/instruction.h |2 ++ arch/x86/insn-selector_32.brg | 34 +- arch/x86/lir-printer.c | 14 ++ arch/x86/use-de

[PATCH 4/9] vm: use J_VOID instead of explicit 0 in vm_object_alloc_native_array()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/object.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm/object.c b/vm/object.c index f3a738f..7ed883d 100644 --- a/vm/object.c +++ b/vm/object.c @@ -46,7 +46,7 @@ struct vm_object *vm_object_alloc_native_array(int type, int count

[PATCH 8/9] vm: move 'kind' field to the top of struct vm_class definition

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/class.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/vm/class.h b/include/vm/class.h index 6782ae5..c84efe5 100644 --- a/include/vm/class.h +++ b/include/vm/class.h @@ -25,10 +25,11 @@ enum vm_class_kind { }; s

[PATCH 7/9] vm: use array and loop approach to preload primitive type classes

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c | 34 ++ 1 files changed, 26 insertions(+), 8 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 27f816a..c7c6e17 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -199,6 +199,17 @@ static const struct preload_entry preload

[PATCH 2/9] vm: use classloader_load_primitive() to load primitive type classes

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index ec46b15..27f816a 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -141,7 +141,7 @@ native_vmclassloader_getprimitiveclass(int type) primitive_class_

[PATCH 3/9] vm: remove unnecessary function vm_class_is_equal_to()

2009-07-01 Thread Tomek Grabiec
Every class has egzactly one vm_class struct in VM. Signed-off-by: Tomek Grabiec --- include/vm/class.h |1 - vm/class.c | 29 + 2 files changed, 1 insertions(+), 29 deletions(-) diff --git a/include/vm/class.h b/include/vm/class.h index bbee5c0..4693e3

[PATCH 6/9] vm: set ->static_size field in vm_class_link_bogus_class()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/class.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vm/class.c b/vm/class.c index fae5562..c69b721 100644 --- a/vm/class.c +++ b/vm/class.c @@ -263,6 +263,7 @@ int vm_class_link_bogus_class(struct vm_class *vmc, const char *class_

[PATCH 9/9] vm: use strndup() in vm_class_get_array_element_class_name()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/class.c | 15 ++- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/vm/class.c b/vm/class.c index c69b721..6629393 100644 --- a/vm/class.c +++ b/vm/class.c @@ -573,20 +573,9 @@ char *vm_class_get_array_element_class_name(const char

[PATCH 1/9] vm: use cache for primitive type classes

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/types.h |1 + vm/classloader.c | 12 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/vm/types.h b/include/vm/types.h index c1b650e..f5bf6e7 100644 --- a/include/vm/types.h +++ b/include/vm/types.h @@ -13,6 +

[RFC][PATCH] vm: allocate enough memory for inherited fields, amendment

2009-07-01 Thread Vegard Nossum
Please check whether this fixes your crash with PrintTest. (It should crash in monoburg now instead). If it does, you can apply it, I think :-) Signed-off-by: Vegard Nossum --- vm/class.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/vm/class.c b/vm/clas

Re: [PATCH 10/19] vm: rewrite array class loading

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > This also introduces vm_class.array_element_class field which points > to the class of array element for array classes. This field is set > during array class loading. Array element class is initialized on > demand, when vm_class_get_array_element_class() is called. > > S

Re: [PATCH 09/19] vm: introduce struct vm_class.kind field

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > This field allows to distinguish between regular classes, array classes and > primitive type classes. > > Signed-off-by: Tomek Grabiec > --- >  include/vm/class.h |   14 +- >  vm/class.c         |    1 + >  vm/classloader.c   |    3 +++ >  3 files changed, 17

Re: [PATCH 08/19] vm: implement primitive type classes support in classloader

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > ---intro private vmtype > > Signed-off-by: Tomek Grabiec > --- >  include/vm/class.h       |    5 +++ >  include/vm/classloader.h |    1 + >  include/vm/java_lang.h   |    8 ++ >  vm/classloader.c         |   63 ++--- >  vm/jat

Re: [PATCH 06/19] vm: allocate correct size in vm_object_alloc_native_array()

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > > Signed-off-by: Tomek Grabiec > --- >  vm/object.c |    8 ++-- >  1 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/vm/object.c b/vm/object.c > index 26b1f76..aaf4606 100644 > --- a/vm/object.c > +++ b/vm/object.c > @@ -14,6 +14,7 @@ >  #include >  

Re: [PATCH 04/19] vm: introduce bytecode type to VM type mapping

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > > Signed-off-by: Tomek Grabiec > --- >  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..54d2c6

Re: [PATCH 15/19] vm: introduce vm_class_is_equal_to() to compare classes

2009-07-01 Thread Vegard Nossum
2009/7/1 Tomek Grabiec : > Classes can be equal even if the pointers are not equal. > That's because array classes are not cached and the same class may > be represented by different copies of struct vm_class. > > The proper soultion would be to cache array types also but it is > not something that

[PATCH 04/19] vm: introduce bytecode type to VM type mapping

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- 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/i

[PATCH 02/19] add myself to AUTHORS

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- AUTHORS |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/AUTHORS b/AUTHORS index 729a92f..6fd4a2f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,3 +13,8 @@ E: vegard.nos...@gmail.com W: http://folk.uio.no/vegardno/ D: Class loading (GSoC

[PATCH 09/19] vm: introduce struct vm_class.kind field

2009-07-01 Thread Tomek Grabiec
This field allows to distinguish between regular classes, array classes and primitive type classes. Signed-off-by: Tomek Grabiec --- include/vm/class.h | 14 +- vm/class.c |1 + vm/classloader.c |3 +++ 3 files changed, 17 insertions(+), 1 deletions(-) diff --git

Re: [PATCH 2/4] jit: add -Xtrace:invoke for tracing method invocations (v2)

2009-07-01 Thread Arthur HUILLET
Hi, > +void emit_trace_invoke(struct buffer *buf, > + const char *class, const char *method, const char *type) > +{ > + __emit_push_imm(buf, (unsigned long) type); > + __emit_push_imm(buf, (unsigned long) method); > + __emit_push_imm(buf, (unsigned long) class); > + __emit_push

[PATCH 17/19] regression: test array class handling

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/ArrayTest.java | 14 ++ regression/jvm/TestCase.java |4 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/regression/jvm/ArrayTest.java b/regression/jvm/ArrayTest.java index 44c87d7..9f4354f 100644 --- a/regre

[PATCH 18/19] vm: throw NullPointerException from VMObject.getClass()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 06c8b8f..ec46b15 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -113,6 +113,11 @@ native_vmthrowable_fill_in_stack_trace(struct vm_object *message) sta

[PATCH 14/19] vm: introduce vm_class_get_storage_vmtype()

2009-07-01 Thread Tomek Grabiec
It returns the vm_type of storage that should be used for instances of given class. Signed-off-by: Tomek Grabiec --- include/vm/class.h |2 ++ vm/class.c |8 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/vm/class.h b/include/vm/class.h index eba

[PATCH 11/19] vm: use str_to_type() in vm/classloader.c

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/types.h |2 +- vm/classloader.c | 31 ++- vm/types.c |2 +- 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/include/vm/types.h b/include/vm/types.h index 54d2c60..c1b650e 100644 --- a/incl

[PATCH 19/19] vm: struct vm_object.array_length should be of type int

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/object.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/vm/object.h b/include/vm/object.h index dd0905d..6fcdfa0 100644 --- a/include/vm/object.h +++ b/include/vm/object.h @@ -18,7 +18,7 @@ struct vm_object {

[PATCH 08/19] vm: implement primitive type classes support in classloader

2009-07-01 Thread Tomek Grabiec
---intro private vmtype Signed-off-by: Tomek Grabiec --- include/vm/class.h |5 +++ include/vm/classloader.h |1 + include/vm/java_lang.h |8 ++ vm/classloader.c | 63 ++--- vm/jato.c| 17 5

[PATCH 13/19] vm: implement VMClassLoader.getPrimitiveClass()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 1968be5..06c8b8f 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -128,6 +128,20 @@ native_vmclass_getname(struct vm_object *object) re

[PATCH 12/19] vm: fix vm_object_alloc_multi_array()

2009-07-01 Thread Tomek Grabiec
Allocate subarrays of sub-array class not the super array's class Signed-off-by: Tomek Grabiec --- vm/object.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/vm/object.c b/vm/object.c index aaf4606..f3a738f 100644 --- a/vm/object.c +++ b/vm/object.c @@ -130,8 +130,

[PATCH 10/19] vm: rewrite array class loading

2009-07-01 Thread Tomek Grabiec
This also introduces vm_class.array_element_class field which points to the class of array element for array classes. This field is set during array class loading. Array element class is initialized on demand, when vm_class_get_array_element_class() is called. Signed-off-by: Tomek Grabiec --- in

[PATCH 07/19] regression: add tests for correctness of array load/store operations

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/ArrayTest.java | 80 + 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/regression/jvm/ArrayTest.java b/regression/jvm/ArrayTest.java index 8616b40..44c87d7 100644 --- a/regression/jvm/ArrayT

[PATCH 05/19] x86: make type_to_scale() use get_vmtype_size()

2009-07-01 Thread Tomek Grabiec
This fixes a bug in type_to_scale() where for element types less than word size it returned 0 or 1 scale exponent. This caused that during store to an array element the following elements were overwriten. This caused that this code didn't work: { byte x[] = new byte[2]; x[1] =

[PATCH 01/19] vm: use java/lang/Class.vmdata field to store the class pointer

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/java_lang.h |1 + include/vm/object.h|4 vm/class.c |4 +++- vm/jato.c |5 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/vm/java_lang.h b/include/vm/java_lang.h index e3e2

[PATCH 06/19] vm: allocate correct size in vm_object_alloc_native_array()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/object.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vm/object.c b/vm/object.c index 26b1f76..aaf4606 100644 --- a/vm/object.c +++ b/vm/object.c @@ -14,6 +14,7 @@ #include #include #include +#include #include str

[PATCH 03/19] x86: remove unnecessary register move in EXPR_ARRAY_DEREF

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- arch/x86/insn-selector_32.brg |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg index 39303ba..2d50ea6 100644 --- a/arch/x86/insn-selector_32.brg +++ b/arch/x86/insn-select

[PATCH 15/19] vm: introduce vm_class_is_equal_to() to compare classes

2009-07-01 Thread Tomek Grabiec
Classes can be equal even if the pointers are not equal. That's because array classes are not cached and the same class may be represented by different copies of struct vm_class. The proper soultion would be to cache array types also but it is not something that can be easily done now. Signed-off

[PATCH 16/19] vm: link array and primitvie type classes

2009-07-01 Thread Tomek Grabiec
Those classes must have the same vtable as their super class - java.lang.Object Signed-off-by: Tomek Grabiec --- include/vm/class.h |1 + vm/class.c | 19 +++ vm/classloader.c | 26 ++ 3 files changed, 30 insertions(+), 16 deletions(-) d

[PATCH] vm: allocate enough memory for inherited fields

2009-07-01 Thread Vegard Nossum
Fixes a memory corruption when loading classes that inherit static fields. Signed-off-by: Vegard Nossum --- vm/class.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm/class.c b/vm/class.c index ec76c69..eaacbda 100644 --- a/vm/class.c +++ b/vm/class.c @@ -194,7 +194,

[PATCH] x86: XMM register spilling and reloading using movss

2009-07-01 Thread Arthur Huillet
Signed-off-by: Arthur Huillet --- arch/x86/emit-code.c| 38 +++ arch/x86/include/arch/instruction.h | 16 - arch/x86/lir-printer.c | 14 arch/x86/use-def.c |2 + 4 files changed, 68 in

[PATCH] jit: get_fixed_var now properly sets var type (GPR or FPU)

2009-07-01 Thread Arthur Huillet
Signed-off-by: Arthur Huillet --- jit/compilation-unit.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/jit/compilation-unit.c b/jit/compilation-unit.c index 793924f..2c2212e 100644 --- a/jit/compilation-unit.c +++ b/jit/compilation-unit.c @@ -144,6 +144,7 @@ struct var_

[PATCH] jit: add -Xtrace:invoke for tracing method invocations (v3)

2009-07-01 Thread Vegard Nossum
This patch adds a new command-line flag, -Xtrace:invoke, which will output a line whenever a method is called, saying which method of which class that was invoked. Note that the print-out happens from inside the JIT-compiled code itself, so we are certain to get the message every time the function

Re: [PATCH 2/4] jit: add -Xtrace:invoke for tracing method invocations (v2)

2009-07-01 Thread Vegard Nossum
2009/7/1 Arthur HUILLET : > Hi, > >> +void emit_trace_invoke(struct buffer *buf, >> +     const char *class, const char *method, const char *type) >> +{ >> +     __emit_push_imm(buf, (unsigned long) type); >> +     __emit_push_imm(buf, (unsigned long) method); >> +     __emit_push_imm(buf, (unsigne

[PATCH 3/4] test/jit: fix a warning in tree-printer-test

2009-07-01 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- test/jit/tree-printer-test.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/jit/tree-printer-test.c b/test/jit/tree-printer-test.c index 1664b87..734adbe 100644 --- a/test/jit/tree-printer-test.c +++ b/test/jit/tree-printer-test.c @

[PATCH 4/4] vm: fix string allocation warnings

2009-07-01 Thread Vegard Nossum
We actually need two functions for allocating strings -- one that converts from the class-format UTF-8 variant and one that converts from regular UTF-8. The second one is what we would use from C programs. Note: We don't actually support code points >= 0x80 in the C variant (regular UTF-8) yet. S

[PATCH 2/4] jit: add -Xtrace:invoke for tracing method invocations (v2)

2009-07-01 Thread Vegard Nossum
This patch adds a new command-line flag, -Xtrace:invoke, which will output a line whenever a method is called, saying which method of which class that was invoked. Note that the print-out happens from inside the JIT-compiled code itself, so we are certain to get the message every time the function

[PATCH 1/4] insn-selector: emit traps for static final fields

2009-07-01 Thread Vegard Nossum
A sentence in the JVM spec gave me the impression that accessing a final class field should not trigger class initialization, but this appears to be wrong. It appears that this sentence was intended for the compiler, since GNU classpath's System.out is in fact static final and without this patch, w