[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 tgrab...@gmail.com --- include/vm/stack-trace.h | 19

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

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

[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 tgrab...@gmail.com --- vm/call.c | 23

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

2009-07-23 Thread Tomek Grabiec
-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/stack-trace.h |3 +++ jit/trampoline.c |6 ++ vm/stack-trace.c | 21 +++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/vm/stack-trace.h b/include/vm/stack-trace.h index 4bde292

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

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

[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 tgrab...@gmail.com --- 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

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

2009-07-23 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

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

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

[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 tgrab...@gmail.com --- jit/trampoline.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jit/trampoline.c b/jit/trampoline.c index

[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 tgrab...@gmail.com --- 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

[PATCH 03/14] x86: introduce INSN_MOV_IP_THREAD_LOCAL_MEMBASE

2009-07-22 Thread Tomek Grabiec
This instruction saves the address of itself to a memory location with GS segment override prefix. It will be needed for storing the approximate call site address into JNI call stack entry. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/emit-code.c| 35

[PATCH 08/14] x86: fix bug in native_call()

2009-07-22 Thread Tomek Grabiec
The stack pointer was not restored after call because %ecx is always 0 after arguments are copied because it's decremented by 'rep movsb'. This also optimizes argument copying by using movsd instead of movsb. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/include/arch/call.h

[PATCH 05/14] vm: replace alloc_page(void) with alloc_pages(int)

2009-07-22 Thread Tomek Grabiec
We will need that to allocate complex guards with multiple pages. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/alloc.h |2 +- jit/text.c |4 ++-- vm/guard-page.c|2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/vm/alloc.h b

[PATCH 06/14] vm: introduce alloc_offset_guard()

2009-07-22 Thread Tomek Grabiec
fail very rarely and need to be as fast as possible. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/guard-page.h |1 + vm/guard-page.c | 35 +++ 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/vm/guard-page.h b

[PATCH 10/14] vm: fix vm_stack_trace_element_to_string()

2009-07-22 Thread Tomek Grabiec
We should not call vm_string_cstr() on null string objects. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/stack-trace.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/vm/stack-trace.c b/vm/stack-trace.c index 24eb29f..cabbfae 100644 --- a/vm/stack

[PATCH 09/14] x86: emit exception test after each JNI call

2009-07-22 Thread Tomek Grabiec
JNI methods can signal exceptions but those exceptions are not technically thrown until JNI method returns to JIT code. We must therefore test for exceptions signalled by JNI methods upon return. This test is cheap for non-exceptional flow but is expensive in the other case. Signed-off-by: Tomek

[PATCH 11/14] vm: introduce -native_ptr field in struct compilation_unit

2009-07-22 Thread Tomek Grabiec
trampoline first. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/insn-selector.brg | 27 +-- include/jit/compilation-unit.h |9 + include/vm/method.h| 26 +++--- jit/compiler.c |1 + jit

[PATCH 12/14] vm: cleanups is stack-trace.c

2009-07-22 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/stack-trace.h |4 +- vm/stack-trace.c | 97 - 2 files changed, 61 insertions(+), 40 deletions(-) diff --git a/include/vm/stack-trace.h b/include/vm/stack-trace.h index

[PATCH 13/14] vm: correct stack walker with presence of VM and JNI natives.

2009-07-22 Thread Tomek Grabiec
are hidden and SIGSEGV handler throws StackOverflowError when such access happens. This makes stack overflow check require only a single test instruction. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/include/arch/call.h| 35 ++ arch/x86/insn-selector.brg | 122

[PATCH 14/14] vm: remove __vm_native macro and linker scripts

2009-07-22 Thread Tomek Grabiec
These are no longer used. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |3 +- arch/x86/jato_32.ld | 199 arch/x86/jato_64.ld | 220 - include/vm/fault-inject.h

[PATCH 4/7 v2] jit: add support for WIDE instruction prefix

2009-07-15 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |3 +- include/jit/bytecode-to-ir.h |1 + include/jit/compiler.h |2 + jit/arithmetic-bc.c | 14 --- jit/bytecode-to-ir.c | 39 --- jit/load

Re: [RFC PATCH 7/9] x86-64: fix stack frame operations

2009-07-15 Thread Tomek Grabiec
It would be nice to know what exactly the 7 is. Can we have a pretty diagram like for x86_32 (or modify the diagram to take x86_64 into account)? guys, wouldn't it be cleaner to write something like this: #define ARGS_START_OFFSET offsetof(struct jit_stack_frame, args) -- Tomek Grabiec

[PATCH 1/3] vm: properly handle WIDE instruction size

2009-07-14 Thread Tomek Grabiec
Wide instruction changes the size of arguments of the following instruction from 8-bits to 16-bits. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/bytecode-def.h |2 +- test/vm/bytecodes-test.c | 24 vm/bytecodes.c| 62

[PATCH] jit: fix method_real_argument_count()

2009-07-13 Thread Tomek Grabiec
Signatures with 'J' after 'Lclass;' were incorrectly parsed Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- jit/invoke-bc.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/jit/invoke-bc.c b/jit/invoke-bc.c index 3a4b2da..628ebf3 100644 --- a/jit/invoke-bc.c +++ b

[JATO] invokeinterface bug report

2009-07-13 Thread Tomek Grabiec
', error: -22 Native stack trace: [08051d88] __show_stack_trace+18 (/home/tomek/projects/jato/jato/arch/x86/backtrace.c:131) [] unknown [0805b385] unknown [080601c8] unknown [a7c3964d] unknown [080654a1] unknown [b7cd460c] unknown [08051cd1] unknown -- Tomek Grabiec

[PATCH 1/5] vm: constify argument of bytecode read functions

2009-07-12 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/bytecode.h | 10 +- vm/bytecode.c | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/vm/bytecode.h b/include/vm/bytecode.h index 580b6e0..23c047a 100644 --- a/include/vm

[PATCH 3/5] vm: introduce bytecode write functions

2009-07-12 Thread Tomek Grabiec
These are needed for subroutine inlining. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/bytecode.h |6 ++ vm/bytecode.c | 29 + 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/include/vm/bytecode.h b/include/vm

[PATCH 5/5] regression: introduce jvm/FinallyTest.java

2009-07-12 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile|1 + regression/jvm/FinallyTest.java | 126 +++ regression/run-suite.sh |1 + 3 files changed, 128 insertions(+), 0 deletions(-) create mode 100644

[PATCH] vm: fix check_class() and check_class_object() macros

2009-07-07 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jni-interface.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/jni-interface.c b/vm/jni-interface.c index c5aa38c..c955dfb 100644 --- a/vm/jni-interface.c +++ b/vm/jni-interface.c @@ -41,14 +41,14 @@ #include

[PATCH] vm: Add new classpath autodiscovery path

2009-07-07 Thread Tomek Grabiec
On gentoo gnu-classpath-97.2 is installed in /usr/local/classpath/ Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 4eb5dbc..ec7a388 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -474,6

[PATCH 1/2] vm: set 'path.separator' to ':'

2009-07-07 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 4eb5dbc..a9eb0a7 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -106,7 +106,7 @@ static void __vm_native

[PATCH 2/2] vm: set 'java.library.path' property to LD_LIBRARY_PATH

2009-07-07 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c | 31 ++- vm/jni.c | 16 +--- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index a9eb0a7..c6dfd4d 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -93,6

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

2009-07-06 Thread Tomek Grabiec
. Affected code: public class Test2 { static public void c() { } public static void main(String[] args) { while (true) c(); } } Acked-by: Arthur HUILLET arthur.huil...@free.fr Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- jit/emit.c |3 ++- 1 files changed, 2 insertions

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

2009-07-06 Thread Tomek Grabiec
2009/7/6 Tomek Grabiec tgrab...@gmail.com: Signed-off-by: Tomek Grabiec tgrab...@gmail.com ---  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

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

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

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

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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 stdio.h +#include vm/die.h

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 tgrab...@gmail.com: 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

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

2009-07-06 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

[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 tgrab...@gmail.com --- include/jit/exception.h |8

[PATCH 2/3] vm: implement bytecode_offset_to_line_no()

2009-07-05 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/method.h |2 ++ jit/bc-offset-mapping.c | 18 +- test/arch-x86/Makefile |1 + vm/method.c | 11 ++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/include/vm

[PATCH 2/3] vm: implement native_vmruntime_maplibraryname()

2009-07-05 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c | 61 +++-- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 865deda..fb7ecb0 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -130,8

[PATCH 3/3] vm: preliminary support for JNI

2009-07-05 Thread Tomek Grabiec
Support for loading objects with native code, invoking JNI native methods. Few JNI native interface functions implemented. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |4 +- arch/x86/emit-code.c | 24 +++ arch/x86/insn-selector_32.brg |3

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

2009-07-05 Thread Tomek Grabiec
Add missing return after throw_from_native() and put object-class check in assertion Reported-by: Vegard Nossum vegard.nos...@gmail.com Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/vm/jato.c b/vm

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

2009-07-05 Thread Tomek Grabiec
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 tgrab...@gmail.com --- arch/x86/emit-code.c| 37 +++-- include/jit

[PATCH 1/2] vm: cleanups in preload.c

2009-07-04 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/preload.c | 137 +++--- 1 files changed, 112 insertions(+), 25 deletions(-) diff --git a/vm/preload.c b/vm/preload.c index 264d7ab..5c8a181 100644 --- a/vm/preload.c +++ b/vm/preload.c

[PATCH 1/2] vm: introduce fault injection into VM

2009-07-04 Thread Tomek Grabiec
This lets us enabled/disable specific VM faults from regression tests Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |3 +- include/vm/fault-inject.h| 23 regression/jato/internal/VM.java |4 ++ vm/class.c

[PATCH 2/2] regression: introduce ClassExceptionsTest

2009-07-04 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile|3 +- regression/jvm/ClassExceptionsTest.java | 66 +++ regression/run-suite.sh |1 + 3 files changed, 69 insertions(+), 1 deletions(-) create mode

[RFC][PATCH] vm: load source file name of a class by reading SourceFile class attribute

2009-07-04 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/class.c | 35 +++ vm/classloader.c |5 + 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/vm/class.c b/vm/class.c index 96405db..9efb7a7 100644 --- a/vm/class.c +++ b/vm/class.c

[PATCH] vm: set message of ExceptionInInitializerError to erroneous class name

2009-07-04 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/class.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm/class.c b/vm/class.c index 9efb7a7..e2fbb9f 100644 --- a/vm/class.c +++ b/vm/class.c @@ -408,7 +408,7 @@ int vm_class_init(struct vm_class *vmc

[RFC][PATCH 1/2] cafebabe: introduce cafebabe_class_get_source_file_name()

2009-07-04 Thread Tomek Grabiec
This also adds support for reading SourceFile class attribute Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |1 + cafebabe/include/cafebabe/class.h|1 + cafebabe/include/cafebabe/sourcefile_attribute.h | 51

[PATCH 2/2] vm: set java.io.tmpdir property to /tmp

2009-07-03 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 739093f..5652d50 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -78,6 +78,10 @@ static void __vm_native

[PATCH 3/6] vm: move preloading code to vm/preload.c

2009-07-03 Thread Tomek Grabiec
Rename include/vm/java_lang.h to include/vm/preload.h Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |3 +- include/vm/java_lang.h | 30 include/vm/preload.h | 32 jit/emulate.c|1 + jit/trace-jit.c |2

[PATCH 2/6] vm: convert vm/stack-trace.c to new JatoVM interface

2009-07-03 Thread Tomek Grabiec
Cleanup fallouts from JamVM and re-enable natives for VMThrowable.fillInStackTrace() and VMThrowable.getStackTrace(). Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/java_lang.h |5 ++- include/vm/object.h | 12 + include/vm/stack-trace.h |5 +- vm/jato.c

[PATCH 6/6] vm: handle exceptions in class initialization correctly

2009-07-03 Thread Tomek Grabiec
The procedure is described in JVM spec: http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#24237 Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/emit-code.c| 13 - include/jit/exception.h |3 +++ include/vm/class.h |1 + include

[PATCH 5/6] vm: Use preloaded classes for creating exceptions in VM

2009-07-03 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/exception.h |2 +- include/vm/object.h |4 +--- include/vm/preload.h| 11 +++ jit/emulate.c |4 ++-- jit/exception.c |4 ++-- jit/trampoline.c|2 +- test/vm/object

[PATCH 2/9] vm: VMClassLoader.getPrimitiveClass() should return null when type is invalid

2009-07-02 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/classloader.c |3 ++- vm/jato.c|4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vm/classloader.c b/vm/classloader.c index b99701a..0ed65b1 100644 --- a/vm/classloader.c +++ b/vm/classloader.c @@ -292,7

[PATCH 1/9] x86: make signal bh trampoline's frame be identical to native frames

2009-07-02 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/signal-bh.S | 10 +++--- arch/x86/signal.c|8 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/x86/signal-bh.S b/arch/x86/signal-bh.S index 8d680f0..0eb6230 100644 --- a/arch/x86/signal-bh.S

[PATCH 5/9] jit: introduce detailed invocation trace -Xtrace:invoke-dtls

2009-07-02 Thread Tomek Grabiec
) Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/args.h |1 + include/jit/compiler.h |2 + include/vm/types.h |1 + jit/args.c | 32 + jit/method.c |8 +++ jit/trace-jit.c| 118

[PATCH 4/9] vm: use memmove() in native_vmsystem_arraycopy()

2009-07-02 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c | 15 +++ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 2cc0135..52ddf5b 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -104,8 +104,6 @@ native_vmsystem_arraycopy(struct vm_object

[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 tgrab

[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 tgrab...@gmail.com --- 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

[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 tgrab...@gmail.com --- 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

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

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

[PATCH] vm: implement VMSystem.arraycopy()

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

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

2009-07-01 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- 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

[PATCH 2/4] x86: print machine register names in LIR for fixeg registers.

2009-06-30 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/lir-printer.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c index 2dc2cc5..7f5558d 100644 --- a/arch/x86/lir-printer.c +++ b/arch/x86/lir-printer.c

[PATCH 1/4] vm: implement VMObject.getClass native

2009-06-30 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 26203af..023030f 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -110,6 +110,12 @@ native_vmthrowable_fill_in_stack_trace(struct

[PATCH 4/4] vm: implement VMClass.getName()

2009-06-30 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/jato.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 023030f..729455f 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -116,6 +116,17 @@ native_vmobject_getclass(struct vm_object

[PATCH 2/8] jit: make dup_expr() nonstatic and replace copy_expr_value()

2009-06-28 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/expression.h |2 +- jit/load-store-bc.c | 38 +- jit/object-bc.c |4 ++-- jit/ostack-bc.c |3 ++- 4 files changed, 6 insertions(+), 41 deletions(-) diff --git

[PATCH 7/8] jit: fix bug in convert_getstatic() and convert_getfield()

2009-06-28 Thread Tomek Grabiec
-off-by: Tomek Grabiec tgrab...@gmail.com --- jit/object-bc.c | 22 -- 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/jit/object-bc.c b/jit/object-bc.c index 8b8658b..b4a6ed9 100644 --- a/jit/object-bc.c +++ b/jit/object-bc.c @@ -79,6 +79,7 @@ static struct

[PATCH 6/8] jit: insert assertion that expression is pure in expr_get()

2009-06-28 Thread Tomek Grabiec
It most likely an error to have multiple references to an expression with side effects. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- jit/expression.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/jit/expression.c b/jit/expression.c index d46c2b7..fc67889

[PATCH 3/8] jit: introduce expr_is_pure()

2009-06-28 Thread Tomek Grabiec
expr_is_pure() is introduced to distinguish expressions with side effects. Instances of such expressions should not occure more than once in the tree or mimic-stack. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/expression.h |1 + jit/expression.c | 63

[PATCH] vm: print exception message in vm_print_exception()

2009-06-27 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/java_lang.h |2 ++ vm/jato.c | 10 +++--- vm/stack-trace.c | 13 - 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/include/vm/java_lang.h b/include/vm/java_lang.h index

[PATCH 2/2] regression: enable fixed exception tests

2009-06-27 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- regression/jvm/ExceptionsTest.java |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/regression/jvm/ExceptionsTest.java b/regression/jvm/ExceptionsTest.java index 71c4d2f..292fb05 100644 --- a/regression/jvm

[PATCH 1/2] vm: fix bug in convert_checkcast()

2009-06-27 Thread Tomek Grabiec
-by: Tomek Grabiec tgrab...@gmail.com --- jit/object-bc.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jit/object-bc.c b/jit/object-bc.c index a194a7b..3866a64 100644 --- a/jit/object-bc.c +++ b/jit/object-bc.c @@ -485,12 +485,12 @@ int convert_instanceof(struct

[PATCH] Makefile: remove clean rule for lib/

2009-06-26 Thread Tomek Grabiec
This caused error on `make clean` as of commit 03d3251a7bb42a6508009a974feb102dc976d222 (Kill unused lib/) Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 8501f63..b7af01b 100644

[PATCH] vm: implement vm_object_get_array_element_class()

2009-06-26 Thread Tomek Grabiec
It's needed to get the class of array elements. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/vm/object.h |1 + vm/object.c |9 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/vm/object.h b/include/vm/object.h index 587b6bb..29eeb24

[PATCH 2/3] vm, jit: use const char * to pass exception messages

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/exception.h |2 +- include/vm/object.h |2 +- jit/exception.c |2 +- vm/object.c |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jit/exception.h b/include/jit

[PATCH 6/11] x86: fix emit_sbb_reg_reg()

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/emit-code.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 6317fa5..7ded6ea 100644 --- a/arch/x86/emit-code.c +++ b/arch/x86/emit-code.c @@ -669,7 +669,7

[PATCH 1/11] test: fix `make test` brakage

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- test/vm/object-stub.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/vm/object-stub.c b/test/vm/object-stub.c index 075b96f..2e7b0da 100644 --- a/test/vm/object-stub.c +++ b/test/vm/object-stub.c @@ -11,7 +11,7

[PATCH 2/2] test: fix `make test` breakage introduced by jit: do not push EXPR_LOCAL onto mimic-stack

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- test/jit/load-store-bc-test.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/test/jit/load-store-bc-test.c b/test/jit/load-store-bc-test.c index cd79de4..c0d85bb 100644 --- a/test/jit/load-store-bc-test.c

[PATCH 5/11] x86: fix rule OP_MUL(reg, reg)

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/insn-selector_32.brg |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg index 5c7eddd..d385ca8 100644 --- a/arch/x86/insn-selector_32.brg +++ b/arch

[PATCH 8/11] jit: introduce copy_expr_value()

2009-06-26 Thread Tomek Grabiec
The purpose of this function is to create a new temporary expression and generate store statement which will copy the result of given expression into a temporary expression. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/expression.h |3 +++ jit/expression.c | 30

[PATCH 9/11] x86: add OP_XXX(reg, reg) monoburg rules

2009-06-26 Thread Tomek Grabiec
They will be needed when EXPR_LOCAL will be replaced with EXPR_TEMPORARY Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/insn-selector_32.brg | 57 + 1 files changed, 57 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector_32

[PATCH 3/11] regression: enable tests in jvm/ExceptionsTest.java that have been fixed

2009-06-26 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- regression/jvm/ExceptionsTest.java |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/regression/jvm/ExceptionsTest.java b/regression/jvm/ExceptionsTest.java index c526e83..71c4d2f 100644 --- a/regression/jvm

[PATCH 7/11] x86: add new instruction INSN_XOR_REG_REG

2009-06-26 Thread Tomek Grabiec
It's needed to implement monoburg rule reg: OP_XOR(reg, reg) Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/emit-code.c|7 +++ arch/x86/include/arch/instruction.h |1 + arch/x86/lir-printer.c |7 +++ arch/x86/use-def.c

[PATCH] vm: fix slash2dots() function

2009-06-25 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- vm/utf8.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/utf8.c b/vm/utf8.c index b55cda7..d3538d7 100644 --- a/vm/utf8.c +++ b/vm/utf8.c @@ -88,8 +88,8 @@ char *slash2dots(char *utf8) char *result

[PATCH] jit: do not use CLASS_CB macro in jit_native_trampoline()

2009-06-25 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- jit/trampoline.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/jit/trampoline.c b/jit/trampoline.c index 1afcfbd..05f5cc6 100644 --- a/jit/trampoline.c +++ b/jit/trampoline.c @@ -61,7 +61,7 @@ static void

[PATCH 1/7] vm: move code creating exceptions out of signal handlers

2009-06-24 Thread Tomek Grabiec
the handler. This issue is addressed by introducing bottom halfs. These are functions which are executed in normal context immediately after signal handler returns. They are installed by manipulating ucontext_t structure associated with signal handler. Signed-off-by: Tomek Grabiec tgrab...@gmail.com

[PATCH 6/7] vm: support for stack trace printing

2009-06-24 Thread Tomek Grabiec
printStackTrace() is executed by JamVM which happens when exception is thrown out of main() method. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/bc-offset-mapping.h |1 + include/vm/stack-trace.h| 11 ++ jit/bc-offset-mapping.c | 14 +++ vm/jato.c

[PATCH 4/7] vm: put all functions implementing virtual machine native methods in a separate section

2009-06-24 Thread Tomek Grabiec
All VM natives should be placed in a .vm_native section to allow stack traversal functions to distinguish between regular native functions and native functions which implement native java methods. The former ones do not appear in stack trace but the latter do. Signed-off-by: Tomek Grabiec tgrab

[PATCH 5/7] vm: the foundation for java stack trace collecting

2009-06-24 Thread Tomek Grabiec
to detect when to stop tracig back. It is set to a native frame pointer of the function that calls the main() method. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- Makefile|3 +- arch/x86/include/arch/stack-frame.h | 18 +++-- arch/x86/stack-frame.c

[PATCH 2/7] vm: replace signal_from_jit_method() with signal_from_native()

2009-06-24 Thread Tomek Grabiec
The rationale for this is the same as for commit 3d406995e21bf1695f6abc743fb37d16cc387f9e (jit: remove is_jit_method() and introduce is_native()) Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- arch/x86/include/arch/signal.h |2 +- arch/x86/signal.c |9 ++--- vm

[PATCH 4/17] vm: fix error in radix_tree_previous()

2009-06-20 Thread Tomek Grabiec
We should not omit searching the node that radix_tree_previous() was first called in when there is only one slot filled in. That's because when we miss the lookup on some level, there is a possibility that previous key is right in the same node. Signed-off-by: Tomek Grabiec tgrab...@gmail.com

[PATCH 7/17] jit: code cleanups

2009-06-20 Thread Tomek Grabiec
Cleanups in include/jit/exception.h, jit/exception.c, jit/cfg-analyzer.c. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include/jit/exception.h | 22 -- jit/cfg-analyzer.c |8 ++ jit/exception.c | 54 +- 3

[PATCH 6/17] test: cleanup in vm/radix-tree-test.c

2009-06-20 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- test/vm/radix-tree-test.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/vm/radix-tree-test.c b/test/vm/radix-tree-test.c index 1a8d70b..afa721e 100644 --- a/test/vm/radix-tree-test.c +++ b/test/vm

[PATCH 11/17] jit: throw UnsatisfiedLinkError when definition of method declared as native cannot be found

2009-06-20 Thread Tomek Grabiec
The Java VM Spec in 2.16.4 The Classes Exception and RuntimeException states that: An UnsatisfiedLinkError is thrown at run time if the Java virtual machine cannot find an appropriate definition of a method declared to be native. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- jit

[PATCH 12/17] regression: test for UnsatisfiedLinkError exception

2009-06-20 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- regression/jvm/ExceptionsTest.java | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/regression/jvm/ExceptionsTest.java b/regression/jvm/ExceptionsTest.java index 3b21c1b..bc5b67d 100644 --- a/regression

[PATCH 9/17] jit: make compilation unit mapping use whole address as a key.

2009-06-20 Thread Tomek Grabiec
We need to use whole address as a mapping key because we will have to store compilation unit mappings for native methods too. Native functions that implement native java methods are not aligned like compilation unit's objcode buffer. Signed-off-by: Tomek Grabiec tgrab...@gmail.com --- include

[PATCH 13/17] vm: put all functions implementing virtual machine native methods in a separate section

2009-06-20 Thread Tomek Grabiec
All VM natives should be placed in a .vm_native section to allow stack traversal functions to distinguish between regular native functions and native functions which implement native java methods. The former ones do not appear in stack trace but the latter do. Signed-off-by: Tomek Grabiec tgrab

<    1   2   3   4   5   >