Re: [PATCH 8/8] vm: full exception printing support

2009-07-06 Thread Pekka Enberg
On Mon, 2009-07-06 at 20:28 +0200, Tomek Grabiec wrote: > This introduces vm_throwable_print_stack_trace() which generates > a string which is identical to the one that would be printed > if Throwable.printStackTrace() method is executed. > > Signed-off-by: Tomek Grabiec I applied the series. Th

[PATCH 4/8] jit: make signal_new_exception() functions return success/error information

2009-07-06 Thread Tomek Grabiec
When exception occures during exception allocation then signal_new_exception() functions will return a negative value. If exception occurres after new exception was allocated then new exception is not signalled. Signed-off-by: Tomek Grabiec --- include/jit/exception.h |8 jit/except

[PATCH 3/8] vm: remove trampolines for JNI methods

2009-07-06 Thread Tomek Grabiec
This introduces a better approach for calling JNI methods. The approach is based on assumption that if native method is not a VM native then it is a JNI method. This lets us to prepare JNI call arguments at compilation time. When method is prepared in vm_method_prepare_jit() it is checked whether

[PATCH 2/8] vm: remove unused ->jit_code field

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/method.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/include/vm/method.h b/include/vm/method.h index ebea698..fd19c16 100644 --- a/include/vm/method.h +++ b/include/vm/method.h @@ -36,8 +36,6 @@ struct vm_method {

Re: [PATCH 1/8] x86: fix emitting branches with target pointing to the containing basic block

2009-07-06 Thread Tomek Grabiec
2009/7/6 Tomek Grabiec : > When branch target points to the same basic block that contains that > branch then branch insn will be added to the backpatch list because > target_bb->is_emitted field is false yet. The backpatch list for basic block > is browsed before its instructions are emitted. Ther

[PATCH 8/8] vm: full exception printing support

2009-07-06 Thread Tomek Grabiec
This introduces vm_throwable_print_stack_trace() which generates a string which is identical to the one that would be printed if Throwable.printStackTrace() method is executed. Signed-off-by: Tomek Grabiec --- include/vm/preload.h |9 ++ vm/preload.c | 64 +++- vm/stack

[PATCH 7/8] vm: print method signature on preload failure

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/preload.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/vm/preload.c b/vm/preload.c index f930437..9f8de3f 100644 --- a/vm/preload.c +++ b/vm/preload.c @@ -27,6 +27,7 @@ #include +#include "vm/die.h" #include "vm/classloader

[PATCH 1/8] x86: fix emitting branches with target pointing to the containing basic block

2009-07-06 Thread Tomek Grabiec
When branch target points to the same basic block that contains that branch then branch insn will be added to the backpatch list because target_bb->is_emitted field is false yet. The backpatch list for basic block is browsed before its instructions are emitted. Therefore the branch whose target poi

[PATCH 6/8] vm: implement JNI functions for exception management

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/jni.h |1 + vm/jni-interface.c | 59 ++- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/include/vm/jni.h b/include/vm/jni.h index 8f76ecb..9fbb1a3 100644 --- a/include/vm/jni.h ++

[PATCH 5/8] vm: check in JNI handlers that class objects are instances of java.lang.Class

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jni-interface.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/vm/jni-interface.c b/vm/jni-interface.c index 20a1588..0eff83c 100644 --- a/vm/jni-interface.c +++ b/vm/jni-interface.c @@ -46,6 +46,10 @@ return NULL

Re: [PATCH 1/2] vm: remove unused ->jit_code field

2009-07-06 Thread Tomek Grabiec
2009/7/6 Tomek Grabiec : > > Signed-off-by: Tomek Grabiec > --- >  include/vm/method.h |    2 -- >  1 files changed, 0 insertions(+), 2 deletions(-) > > diff --git a/include/vm/method.h b/include/vm/method.h > index ebea698..fd19c16 100644 > --- a/include/vm/method.h > +++ b/include/vm/method.h >

[PATCH 2/2] vm: assume that non-VM native methods are JNI native methods

2009-07-06 Thread Tomek Grabiec
When method is prepared in vm_method_prepare_jit() it is checked whether native method is one of VM native methods and the address of it is stored in the ->vm_native_ptr field. This field is used to perform a quick check for a JNI method in vm_method_is_jni_method() and to omit vm_native_lookup() i

[PATCH 1/2] vm: remove unused ->jit_code field

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/method.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/include/vm/method.h b/include/vm/method.h index ebea698..fd19c16 100644 --- a/include/vm/method.h +++ b/include/vm/method.h @@ -36,8 +36,6 @@ struct vm_method {

Re: [PATCH] x86: fix emitting branches with target pointing to the containing basic block

2009-07-06 Thread Pekka Enberg
On Mon, 2009-07-06 at 13:27 +0200, Tomek Grabiec wrote: > When branch target points to the same basic block that contains that > branch then branch insn will be added to the backpatch list because > target_bb->is_emitted field is false yet. The backpatch list for basic block > is browsed before its

[PATCH] x86: fix emitting branches with target pointing to the containing basic block

2009-07-06 Thread Tomek Grabiec
When branch target points to the same basic block that contains that branch then branch insn will be added to the backpatch list because target_bb->is_emitted field is false yet. The backpatch list for basic block is browsed before its instructions are emitted. Therefore the branch whose target poi

Re: [PATCH 2/2] x86: fix bug in emit_jni_trampoline()

2009-07-06 Thread Tomek Grabiec
2009/7/6 Pekka Enberg : > On Mon, 2009-07-06 at 01:16 +0200, Tomek Grabiec wrote: >> We cannot overwrite a register which is not saved (ESI) because this >> will lead to a corruption in JIT code. The proper solution is >> to copy the call arguments. >> >> Signed-off-by: Tomek Grabiec > > I'm confu

Re: [PATCH 2/2] x86: fix bug in emit_jni_trampoline()

2009-07-06 Thread Pekka Enberg
On Mon, 2009-07-06 at 01:16 +0200, Tomek Grabiec wrote: > We cannot overwrite a register which is not saved (ESI) because this > will lead to a corruption in JIT code. The proper solution is > to copy the call arguments. > > Signed-off-by: Tomek Grabiec I'm confused. What exactly is the problem

Re: [PATCH 1/2] x86: fix bug in invokeinterface and invokevirtual args cleanup

2009-07-06 Thread Pekka Enberg
On Mon, 2009-07-06 at 01:16 +0200, Tomek Grabiec wrote: > method->args_count should be used to get the size of arguments, > not nr_args(args_list). This bug led to stack overflow with the > following code: > > public class Test { > public void c(long x) { > } > > public static void ma

Re: [PATCH 2/2] vm: fix native_vmobject_getclass()

2009-07-06 Thread Pekka Enberg
On Sun, 2009-07-05 at 22:36 +0200, Tomek Grabiec wrote: > Add missing return after throw_from_native() and put object->class check in > assertion > > Reported-by: Vegard Nossum > Signed-off-by: Tomek Grabiec I applied this but here are some comments: > --- > vm/jato.c |5 - > 1 files

Re: [PATCH 1/2] vm: add license text to jni.c and jni-interface.c

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