Re: [RFC PATCH 3/3] WIP bits for control flow resolution

2009-07-23 Thread Arthur Huillet
Hi, if you apply this series, you can help me work on the bug. On Thu, 23 Jul 2009 23:24:50 +0200 Arthur HUILLET wrote: > From: Arthur Huillet > > DO NOT MERGE THIS !!! > > Signed-off-by: Arthur Huillet > diff --git a/Makefile b/Makefile > index 58ad9db..55de435 100644 > --- a/Makefile > +

[RFC PATCH 1/3] jit: add bb_first_insn and bb_last_insn

2009-07-23 Thread Arthur HUILLET
From: Arthur Huillet Those functions are to be used by the register allocator when resolving control flow. Signed-off-by: Arthur Huillet --- include/jit/basic-block.h |2 ++ jit/basic-block.c | 10 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include

[PATCH 2/3] jit: add vreg_start_interval and interval_child_at

2009-07-23 Thread Arthur HUILLET
From: Arthur Huillet Those functions will be used by the register allocator when doing control flow resolution. Signed-off-by: Arthur Huillet --- include/jit/vars.h |4 +++- jit/interval.c | 33 + 2 files changed, 36 insertions(+), 1 deletions(-) diff

[RFC PATCH 3/3] WIP bits for control flow resolution

2009-07-23 Thread Arthur HUILLET
From: Arthur Huillet DO NOT MERGE THIS !!! Signed-off-by: Arthur Huillet diff --git a/Makefile b/Makefile index 58ad9db..55de435 100644 --- a/Makefile +++ b/Makefile @@ -256,6 +256,7 @@ REGRESSION_TEST_SUITE_CLASSES = \ regression/jvm/PutstaticTest.class \ regression/jvm/Registe

[PATCH 2/2] vm: println(null) should print "null\n" instead of throwing NullPointerException

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index b37ace4..636f6a9 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -214,8 +214,7 @@ native_vmruntime_native_load(struct vm_object *name, static void native_v

[PATCH 1/2] vm: add jato/internal/VM.throwNullPointerException()

2009-07-23 Thread Tomek Grabiec
It's needed for testing stack trace creation from VM native methods. Signed-off-by: Tomek Grabiec --- regression/jato/internal/VM.java |1 + regression/jvm/StackTraceTest.java |4 ++-- vm/jato.c |8 3 files changed, 11 insertions(+), 2 deletions(-)

[PATCH 3/5] test/jit: remove jamvm stubs

2009-07-23 Thread Vegard Nossum
Jam VM is no longer used. Signed-off-by: Vegard Nossum --- test/jit/Makefile |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/test/jit/Makefile b/test/jit/Makefile index 80151f7..b5444d0 100644 --- a/test/jit/Makefile +++ b/test/jit/Makefile @@ -59,10 +59,6 @@ OBJS = \

[PATCH 2/5] test/jit: fix warnings in object-bc-test

2009-07-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- test/jit/object-bc-test.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jit/object-bc-test.c b/test/jit/object-bc-test.c index 02cda9f..3cee10f 100644 --- a/test/jit/object-bc-test.c +++ b/test/jit/object-bc-test.c @@ -439,7

[PATCH 4/5] test/arch-x86: remove insn-selector tests from the tree

2009-07-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- test/arch-x86/insn-selector-test_32.c | 1530 - 1 files changed, 0 insertions(+), 1530 deletions(-) delete mode 100644 test/arch-x86/insn-selector-test_32.c diff --git a/test/arch-x86/insn-selector-test_32.c b/test/arch-x86/insn-

[PATCH 5/5] test: don't recompile everything every time

2009-07-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- scripts/build/test.mk | 40 +++--- test/arch-x86/Makefile | 142 +++- test/jit/Makefile | 132 +++-- test/vm/Makefile | 33 ++-- 4 files changed,

[PATCH 1/5] test/jit: fix warning in bc-test-utils

2009-07-23 Thread Vegard Nossum
In fact, we were dereferencing "class" which was not initialized to point to a valid cafebabe class, so it was a real error. Signed-off-by: Vegard Nossum --- test/jit/bc-test-utils.c | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/jit/bc-test-utils.c b/te

[PATCH] regression: fix formatting in jvm/StackTraceTest.java

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/StackTraceTest.java | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/regression/jvm/StackTraceTest.java b/regression/jvm/StackTraceTest.java index 6900d6c..a2aa3fd 100644 --- a/regression/jvm/StackTra

[PATCH 13/13] regression: add test for UnsatisfiedLinkError stack trace.

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- regression/jvm/StackTraceTest.java | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/regression/jvm/StackTraceTest.java b/regression/jvm/StackTraceTest.java index dd364ca..6900d6c 100644 --- a/regression/jvm/StackT

[PATCH 12/13] jit: fix bug in throw_from_native()

2009-07-23 Thread Tomek Grabiec
We should compare vm_native_stack_get_frame() with _current_ frame not the caller's frame. Signed-off-by: Tomek Grabiec --- include/jit/exception.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/jit/exception.h b/include/jit/exception.h index 68a1da1..3185cce

[PATCH 11/13] jit: rename jit_native_trampoline() to jit_jni_trampoline()

2009-07-23 Thread Tomek Grabiec
VM natives no longer have trampolines because they are linked when their method object is initialized. Signed-off-by: Tomek Grabiec --- jit/trampoline.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jit/trampoline.c b/jit/trampoline.c index 369da6d..ba1a495 100644

[PATCH 10/13] regression: introduce jvm/StackTraceTest.java

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- Makefile |1 + regression/jvm/ExceptionsTest.java | 25 -- regression/jvm/StackTraceTest.java | 90 regression/jvm/TestCase.java | 18 +++ regression/run-suite.sh

[PATCH 09/13] vm: test for null pointer in native_vmruntime_println()

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/jato.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index ef4b2e2..02f060d 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -213,6 +213,12 @@ native_vmruntime_native_load(struct vm_object *name, static void na

[PATCH 08/13] vm: put body of enter_vm_from_jni macro in do { } while(0)

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- include/vm/stack-trace.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vm/stack-trace.h b/include/vm/stack-trace.h index f6db886..f326c41 100644 --- a/include/vm/stack-trace.h +++ b/include/vm/stack-trace.h @@ -82,10 +82,10 @

[PATCH 07/13] vm: fix comment for alloc_offset_guard()

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/guard-page.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/guard-page.c b/vm/guard-page.c index 420230a..f47c936 100644 --- a/vm/guard-page.c +++ b/vm/guard-page.c @@ -37,8 +37,8 @@ * alloc_offset_guard - allocates a memory r

[PATCH 06/13] vm: fix call stack traversal when called from JNI trampoline

2009-07-23 Thread Tomek Grabiec
When JNI method linking fails an instance of java.lang.UnsatisfiedLinkError is thrown from JNI trampoline (jit_native_trampoline()). When stack trace is created for this exception, stack walker is trying to use the method->compilation_unit->native_ptr to get the JNI method's address, but this point

[PATCH 05/13] vm: clear exceptions before calling method from VM.

2009-07-23 Thread Tomek Grabiec
Any pending exceptions must be cleared before calling method from VM and restored upon return. Otherwise exception will be caught by the first encountered exception test which is not a correct behavior. Signed-off-by: Tomek Grabiec --- vm/call.c | 23 --- 1 files changed, 2

[PATCH 04/13] jit: signal_exception() should override already signalled exception

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- jit/exception.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/jit/exception.c b/jit/exception.c index 251bd17..d8eeed5 100644 --- a/jit/exception.c +++ b/jit/exception.c @@ -84,9 +84,6 @@ void thread_init_exceptions(void) */ void s

[PATCH 03/13] vm: rename vm_enter_jni_interface() to enter_vm_from_jni()

2009-07-23 Thread Tomek Grabiec
This also renames ->jni_interface_frame field of struct jni_stack_entry to ->vm_frame VM can be entered from JNI not only through JNI interface function but also through JNI trampoline (jit_native_trampoline). Signed-off-by: Tomek Grabiec --- include/vm/stack-trace.h | 19 +--

[PATCH 02/13] vm: optimize vm_call_method_a() a bit.

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- vm/call.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/vm/call.c b/vm/call.c index 09ac7d1..073e043 100644 --- a/vm/call.c +++ b/vm/call.c @@ -43,23 +43,24 @@ vm_call_method_a(struct vm_method *method, unsigned long *a

[PATCH 01/13] vm: lock on compilation unit's mutex before accessing its fields.

2009-07-23 Thread Tomek Grabiec
We cannot read compilation unit's fields without locking because some CPUs might reorder memory write operations. For example when thread A compiles some method and thread B which is running on another CPU reads the value of ->is_compiled, then thread B might see that ->is_compiled is set 'true' wh