Re: Jato mailing list has been moved!

2009-12-18 Thread Pekka Enberg
Pekka Enberg wrote: > Hi all, > > I've moved the Jato mailing list to Google Groups: > > http://groups.google.com/group/jatovm?hl=en > > I did this because SF.net mailing lists are slow, the archives are > crappy, and I got tired of fighting spam through mai

Jato mailing list has been moved!

2009-12-18 Thread Pekka Enberg
Hi all, I've moved the Jato mailing list to Google Groups: http://groups.google.com/group/jatovm?hl=en I did this because SF.net mailing lists are slow, the archives are crappy, and I got tired of fighting spam through mailman admin interface. While Google Groups might not be the perfect solut

[PATCH 2/3] x86: Pass insn to single operand emitters

2009-12-13 Thread Pekka Enberg
Preparation for emitter function signature unification. Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c | 102 +- 1 files changed, 51 insertions(+), 51 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 143329a

[PATCH 3/3] x86: Unify NO_OPERANDS and SINGLE_OPERAND emission

2009-12-13 Thread Pekka Enberg
Now that NO_OPERANDS and SINGLE_OPERAND emitter share the same function signature we can unify the two. Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c | 19 +-- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c

[PATCH 1/3] x86: Pass insn to operand emitters

2009-12-13 Thread Pekka Enberg
Preparation for emitter function signature unification. Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c | 25 +++-- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 6158365..143329a 100644 --- a/arch

[PATCH] x86: Fix some single operand emitters

2009-12-13 Thread Pekka Enberg
Use SINGLE_OPERAND for instructions emitters that only have a single operand. This doesn't change functionality as we've been lucky so far and TWO_OPERAND passes the right operand to the emitter functions. Cc: Arthur HUILLET Signed-off-by: Pekka Enberg --- arch/x86/emit-cod

[PATCH 2/2] x86: Unify single operand emitter function signatures

2009-12-13 Thread Pekka Enberg
The "src" and "dest" argument names refer to the ->src and ->dest struct insn operands. Use the "operand" name for single operand instruction emitters to avoid confusion. Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c | 23 +++ 1

[PATCH 1/2] x86: Remove unused INSN_MOV_IP_REG type

2009-12-13 Thread Pekka Enberg
Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c|8 arch/x86/include/arch/instruction.h |1 - arch/x86/instruction.c |1 - 3 files changed, 0 insertions(+), 10 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index

[PATCH 1/3] x86: Remove unused INSN_MOV_IP_THREAD_LOCAL_MEMBASE type

2009-12-13 Thread Pekka Enberg
Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c| 11 --- arch/x86/include/arch/instruction.h |1 - arch/x86/instruction.c |1 - arch/x86/lir-printer.c |7 --- 4 files changed, 0 insertions(+), 20 deletions(-) diff --git a

[PATCH 2/3] x86: Remove unused INSN_PUSH_MEMBASE type

2009-12-13 Thread Pekka Enberg
Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c|7 --- arch/x86/include/arch/instruction.h |1 - arch/x86/instruction.c |1 - arch/x86/lir-printer.c |7 --- 4 files changed, 0 insertions(+), 16 deletions(-) diff --git a/arch

[PATCH 3/3] x86: Remove unused INSN_XOR_IMM_REG type

2009-12-13 Thread Pekka Enberg
Signed-off-by: Pekka Enberg --- arch/x86/emit-code.c| 12 arch/x86/include/arch/instruction.h |1 - arch/x86/instruction.c |1 - arch/x86/lir-printer.c |7 --- test/arch-x86/emit-code-test_32.c |7 --- 5 files

[PATCH] vm: Add support for GNU Classpath 0.98

2009-12-13 Thread Pekka Enberg
Cc: Arthur HUILLET Signed-off-by: Pekka Enberg --- vm/classloader.c |9 ++--- vm/preload.c | 45 +++-- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/vm/classloader.c b/vm/classloader.c index c31ae24..66a9b93 100644 --- a

[PATCH] x86-64: Fix native_call_gp() clobber list

2009-12-13 Thread Pekka Enberg
As we are doing a "call", we must specify all caller-saved registers as clobbered. Cc: Eduard - Gabriel Munteanu Cc: Arthur HUILLET Signed-off-by: Pekka Enberg --- arch/x86/call.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/call.c b/arch/

Re: Entering the GC from the JIT trampolines

2009-12-07 Thread Pekka Enberg
On Mon, 2009-12-07 at 12:42 +0200, Pekka Enberg wrote: > AFAICT entering GC from a JIT trampoline is irrelevant to this > discussion. We're really looking at a generic problem where one or more > of the threads are already blocked with pthread_mutex_lock() or whatever > and w

Re: Entering the GC from the JIT trampolines

2009-12-07 Thread Pekka Enberg
Pekka Enberg kirjoitti: > As I mentioned before, I'm seeing deadlocks with GcTortureTest when > "-Xgc" is enabled. I've been debugging the problem for a bit now and I > think it's a generic problem of entering the GC from within a JIT > trampoline while w

Entering the GC from the JIT trampolines

2009-12-06 Thread Pekka Enberg
Hi! As I mentioned before, I'm seeing deadlocks with GcTortureTest when "-Xgc" is enabled. I've been debugging the problem for a bit now and I think it's a generic problem of entering the GC from within a JIT trampoline while we're holding cu->mutex. See the below backtrace for details (I think Th

Re: [PATCH] vm: fix init_stack_trace_elem_current()

2009-11-17 Thread Pekka Enberg
Tomasz Grabiec wrote: Tomek Grabiec wrote: > The function was setting elem to the init_stack_trace_elem_current()'s > frame which is error prone because after function returns its stack > frame might be overriden by another function calls done from the > caller. > > A f

Re: [PATCH] vm: fix init_stack_trace_elem_current()

2009-11-17 Thread Pekka Enberg
Tomasz Grabiec wrote: > Dnia 2009-11-17, wto o godzinie 16:39 +0200, Pekka Enberg pisze: >> Tomek Grabiec wrote: >>> The function was setting elem to the init_stack_trace_elem_current()'s >>> frame which is error prone because after function returns its stack

Re: [PATCH] vm: fix init_stack_trace_elem_current()

2009-11-17 Thread Pekka Enberg
Tomek Grabiec wrote: > The function was setting elem to the init_stack_trace_elem_current()'s > frame which is error prone because after function returns its stack > frame might be overriden by another function calls done from the > caller. > > A fix for that is to make init_stack_trace_elem_curre

Re: GC maps

2009-11-16 Thread Pekka Enberg
Hi Tomek, Tomasz Grabiec kirjoitti: > Dnia 2009-11-16, pon o godzinie 12:19 +0200, Pekka Enberg pisze: >> Next step is to change gc_safepoint() to look up struct gc_map based on >> regs->eip. I was thinking of adding an hash map of GC maps to struct >> compilation_unit

[PATCH] x86-64: Fix native_call() signature

2009-10-24 Thread Pekka Enberg
Fixes the following compilation error on x86-64: CC arch/x86/call.o arch/x86/call.c:257: error: conflicting types for ‘native_call’ include/vm/call.h:82: error: previous declaration of ‘native_call’ was here Cc: Eduard - Gabriel Munteanu Signed-off-by: Pekka Enberg --- arch/x86

Strange code in __insert_spill_reload_insn()

2009-10-24 Thread Pekka Enberg
out in the future add ebx, ebx Signed-off-by: Tomek Grabiec Signed-off-by: Pekka Enberg there's a pretty strange change: @@ -198,11 +229,11 @@ static int __insert_spill_reload_insn(struct live_interval *interval, struct com * can't insert a

Re: [RFC PATCH 13/16] x86-64: XMM args register assignment

2009-10-22 Thread Pekka Enberg
On Wed, 2009-10-21 at 19:29 +0200, Tomasz Grabiec wrote: > > + if (xmm_count < 8) { > > + map->reg = args_map_alloc_xmm(xmm_count++); > > + map->stack_index = -1; > > + } else { > > + m

[PATCH] x86: Fix instruction selector deadlock in invoke()

2009-10-12 Thread Pekka Enberg
Cc: Tomek Grabiec Signed-off-by: Pekka Enberg --- arch/x86/insn-selector.brg | 26 -- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index c2d06c3..647cb1b 100644 --- a/arch/x86/insn-selector.brg

[PATCH v2] x86: Fix instruction selector deadlock in invoke()

2009-10-12 Thread Pekka Enberg
Cc: Tomek Grabiec Signed-off-by: Pekka Enberg --- arch/x86/insn-selector.brg | 22 -- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index c2d06c3..26bcfd5 100644 --- a/arch/x86/insn-selector.brg +++

Re: [PATCH 1/2] vm: parse method and field type on initialization

2009-10-06 Thread Pekka Enberg
On Tue, 2009-10-06 at 11:45 +0200, Tomek Grabiec wrote: > struct vm_type_info is introduced to fully describe a java type of a > call argument, return type, field type, etc. Method's and field's type > strings are parsed on initialization and type information is put to > appropriate struct vm_type_

[PATCH 3/3] gc: Pass register state to gc_start() and gc_safepoint()

2009-09-16 Thread Pekka Enberg
. Cc: Tomek Grabiec Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |6 -- vm/gc.c | 11 --- vm/signal.c |8 +++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index 343e04d..3b5889e 1

[PATCH 2/3] x86-64: Register state saving

2009-09-16 Thread Pekka Enberg
Add save_registers() and save_signal_registers() to x86-64 as well. Cc: Eduard - Gabriel Munteanu Cc: Tomek Grabiec Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- arch/x86/include/arch/registers_64.h | 75 +++--- 1 files changed, 69 insertions(+), 6 deletions

[PATCH 1/3] x86: Register state saving

2009-09-16 Thread Pekka Enberg
() function for converting gregset_t to struct register_state so we can pass register contents to the gc_safepoint() function. Cc: Tomek Grabiec Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- arch/x86/include/arch/registers_32.h | 52 + 1 files changed, 45 insertions

Passing registers to gc_safepoint() from signal handler

2009-09-14 Thread Pekka Enberg
Hi guys, I am working on passing register values to gc_safepoint(). I fixed up gc_alloc() with this simple function that does pusha and copies the values: static inline void save_registers(struct register_values *regs) { void *esp; __asm__ volatile ( "pusha\n\t"

[ANNOUNCE] Jato v0.0.1 - a simple JIT-only virtual machine for Java

2009-09-08 Thread Pekka Enberg
Hi all, I am proud to announce the release of Jato v0.0.1 "buy more RAM"-edition! Jato is a JIT-only virtual machine for Java that can run some simple programs under GNU/Linux on modern 32-bit x86 CPUs. A port to the x86-64 machine architecture is currently being developed. Jato depends on GNU Cl

Re: [PATCH] jit: fix race condition in fixup_direct_calls()

2009-09-07 Thread Pekka Enberg
On Mon, 2009-09-07 at 22:41 +0200, Tomek Grabiec wrote: > This fixes incorrect lock order reported by helgrind: OK, so what is the problem? How are you fixing it? The changelog is really too terse for this kind of critical fix. > Signed-off-by: Tomek Grabiec > --- > arch/x86/emit-code.c

[PATCH v4 1/5] vm: Introduce vm_nr_threads_running()

2009-09-07 Thread Pekka Enberg
We need to keep track of running threads when stopping the world. This means that we must exclude threads that are waiting on monitor. This patch introduces a vm_nr_threads_running() that will be used in vm/gc.c. Cc: Tomek Grabiec Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm

[PATCH v4 4/5] vm: Introduce -verbose:gc command line option

2009-09-07 Thread Pekka Enberg
Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |3 +++ vm/gc.c |5 + vm/jato.c |6 ++ 3 files changed, 14 insertions(+), 0 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index a9bfae9..8cc7994 100644 --- a/include/vm/gc.h +++ b

[PATCH v4 5/5] vm: Introduce -Xgc command line option

2009-09-07 Thread Pekka Enberg
This patch adds a "-Xgc" command line option that enables the work-in-progress GC infrastructure. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |1 + vm/gc.c |4 vm/jato.c |6 ++ 3 files changed, 11 insertions(+), 0 deletion

[PATCH v4 3/5] gc: Introduce gc_malloc() entry-point

2009-09-07 Thread Pekka Enberg
This patch introduces a gc_malloc() entry point. It's a simple wrapper on top of kzalloc() for now. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |2 ++ test/vm/gc-stub.c |6 ++ vm/gc.c |6 ++ vm/object.c |9 + 4

[PATCH v4 2/5] gc: Fix safepoints when gc_start() is called from object allocator

2009-09-07 Thread Pekka Enberg
um Signed-off-by: Pekka Enberg --- vm/gc.c | 118 +++--- 1 files changed, 82 insertions(+), 36 deletions(-) diff --git a/vm/gc.c b/vm/gc.c index 949a6c9..7ab37b7 100644 --- a/vm/gc.c +++ b/vm/gc.c @@ -4,6 +4,7 @@ #include #include

[RFC/PATCH v3 4/5] vm: Introduce -verbose:gc command line option

2009-09-06 Thread Pekka Enberg
Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |3 +++ vm/gc.c |3 +++ vm/jato.c |6 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index a9bfae9..8cc7994 100644 --- a/include/vm/gc.h +++ b

[RFC/PATCH v3 5/5] vm: Introduce -Xgc command line option

2009-09-06 Thread Pekka Enberg
This patch adds a "-Xgc" command line option that enables the work-in-progress GC infrastructure. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |1 + vm/gc.c |3 +++ vm/jato.c |6 ++ 3 files changed, 10 insertions(+), 0 deletions(-)

[RFC/PATCH v3 1/5] vm: Introduce nr_threads_running

2009-09-06 Thread Pekka Enberg
Signed-off-by: Pekka Enberg --- include/vm/thread.h |2 ++ vm/thread.c | 30 ++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/include/vm/thread.h b/include/vm/thread.h index 39084a1..afb5ede 100644 --- a/include/vm/thread.h +++ b

[RFC/PATCH v3 2/5] gc: Fix safepoints when gc_start() is called from object allocator

2009-09-06 Thread Pekka Enberg
bootstrap code when no threads are started. With the above fixes, GcTortureTest passes when gc_start() is called from object allocator. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- vm/gc.c | 99 +- 1 files changed, 65 inse

[RFC/PATCH v3 3/5] gc: Introduce gc_malloc() entry-point

2009-09-06 Thread Pekka Enberg
This patch introduces a gc_malloc() entry point. It's a simple wrapper on top of kzalloc() for now. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |2 ++ test/vm/gc-stub.c |6 ++ vm/gc.c |6 ++ vm/object.c |9 + 4

[PATCH v2 1/4] gc: Fix safepoints when gc_start() is called from object allocator

2009-09-06 Thread Pekka Enberg
bootstrap code when no threads are started. With the above fixes, GcTortureTest passes when gc_start() is called from object allocator. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- vm/gc.c | 136 -- 1 files changed, 114 inse

[PATCH v2 3/4] vm: Introduce -verbose:gc command line option

2009-09-06 Thread Pekka Enberg
Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |3 +++ vm/gc.c |3 +++ vm/jato.c |6 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index a9bfae9..8cc7994 100644 --- a/include/vm/gc.h +++ b

[PATCH v2 2/4] gc: Introduce gc_malloc() entry-point

2009-09-06 Thread Pekka Enberg
This patch introduces a gc_malloc() entry point. It's a simple wrapper on top of kzalloc() for now. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |2 ++ test/vm/gc-stub.c |6 ++ vm/gc.c |6 ++ vm/object.c |9 + 4

[PATCH v2 4/4] vm: Introduce -Xgc command line option

2009-09-06 Thread Pekka Enberg
This patch adds a "-Xgc" command line option that enables the work-in-progress GC infrastructure. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |1 + vm/gc.c |3 +++ vm/jato.c |6 ++ 3 files changed, 10 insertions(+), 0 deletions(-)

[PATCH 4/4] vm: Introduce -Xgc command line option

2009-09-06 Thread Pekka Enberg
This patch adds a "-Xgc" command line option that enables the work-in-progress GC infrastructure. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |1 + vm/gc.c |4 vm/jato.c |6 ++ 3 files changed, 11 insertions(+), 0 deletion

[PATCH 2/4] gc: Introduce gc_malloc() entry-point

2009-09-06 Thread Pekka Enberg
This patch introduces a gc_malloc() entry point. It's a simple wrapper on top of kzalloc() for now. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |2 ++ test/vm/gc-stub.c |6 ++ vm/gc.c |6 ++ vm/object.c |9 + 4

[PATCH 1/4] gc: Fix safepoints when gc_start() is called from object allocator

2009-09-06 Thread Pekka Enberg
bootstrap code when no threads are started. With the above fixes, GcTortureTest passes when gc_start() is called from object allocator. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- vm/gc.c | 76 +- 1 files changed, 55 inse

[PATCH 3/4] vm: Introduce -verbose:gc command line option

2009-09-06 Thread Pekka Enberg
Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- include/vm/gc.h |3 +++ vm/gc.c |4 vm/jato.c |6 ++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index a9bfae9..8cc7994 100644 --- a/include/vm/gc.h +++ b

Re: [PATCH 15/19] x86-64: move received parameters to non-fixed registers

2009-09-06 Thread Pekka Enberg
On Sat, 2009-09-05 at 13:27 +0300, Eduard - Gabriel Munteanu wrote: > We must not keep the parameters we received in fixed registers because > they can be clobbered by other insn-selector rules that use them (e.g. > method invocation). > > Signed-off-by: Eduard - Gabriel Munteanu I applied this

[PATCH] gc: Fix safepoints when gc_start() is called from object allocator

2009-09-06 Thread Pekka Enberg
bootstrap code when no threads are started. With the above fixes, GcTortureTest passes when gc_start() is called from object allocator. Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- vm/gc.c | 76 +- 1 files changed, 55 inse

Re: [PATCH] vm: Use calloc() to allocate class methods

2009-09-06 Thread Pekka Enberg
On Sun, 2009-09-06 at 10:34 +0200, Vegard Nossum wrote: > ACK! > > Acked-by: Vegard Nossum > > It's better because we don't initialize the same fields over and over. > Perhaps this is premature optimization, but it's just much more > elegant to not do more than we really need. Calloc() is a big

Re: [PATCH] vm: Use calloc() to allocate class methods

2009-09-06 Thread Pekka Enberg
On Sun, 2009-09-06 at 10:23 +0200, Vegard Nossum wrote: > 2009/9/5 Pekka Enberg : > > Vegard Nossum wrote: > >> > >> 2009/9/5 Pekka Enberg : > >>> > >>> Good point. I wonder why we have methods without code attribute in > >>> classfil

Re: [PATCH] vm: Use calloc() to allocate class methods

2009-09-05 Thread Pekka Enberg
Vegard Nossum wrote: > 2009/9/5 Pekka Enberg : >> Good point. I wonder why we have methods without code attribute in >> classfiles. >> > > Native and abstract methods don't have code. It's all here: > > http://java.sun.com/docs/books/jvms/second_editio

Re: [PATCH] vm: Use calloc() to allocate class methods

2009-09-05 Thread Pekka Enberg
Vegard Nossum wrote: > 2009/9/5 Pekka Enberg : >> On Sat, 2009-09-05 at 16:06 +0200, Vegard Nossum wrote: >>> Um, wait, what's the actual dereference that causes the valgrind >>> warning? Because as it stands, it looks like you're fixing just the >>>

Re: [PATCH] vm: Use calloc() to allocate class methods

2009-09-05 Thread Pekka Enberg
On Sat, 2009-09-05 at 16:06 +0200, Vegard Nossum wrote: > 2009/9/5 Pekka Enberg : > > This fixes the following uninitialized memory access reported by valgrind: > > > > ==24231== Warning: set address range perms: large range 268435456 (defined) > > ==24231== Conditio

[PATCH] vm: Use calloc() to allocate class methods

2009-09-05 Thread Pekka Enberg
: classloader_load (classloader.c:359) ==24231==by 0x806EC84: vm_class_resolve_class (class.c:734) Cc: Tomek Grabiec Cc: Vegard Nossum Signed-off-by: Pekka Enberg --- vm/class.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm/class.c b/vm/class.c index f53f112..7fbee09

Re: [PATCH 13/19] x86-64: add XMM registers

2009-09-05 Thread Pekka Enberg
Hi Eduard, Eduard - Gabriel Munteanu wrote: > This adds definitions for XMM regs on x86-64. > > Signed-off-by: Eduard - Gabriel Munteanu > --- > arch/x86/include/arch/registers_64.h |9 + > arch/x86/registers_64.c |9 + > 2 files changed, 18 insertions(+), 0

Re: [PATCH 1/6] vm: introduce -Xnobuf

2009-09-01 Thread Pekka Enberg
ad8df3e0 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 1 Sep 2009 21:21:15 +0300 Subject: [PATCH] vm: Flush and disable buffering on SIGABRT Signed-off-by: Pekka Enberg --- include/vm/trace.h |1 + vm/signal.c| 23 +-- vm/trace.c

[PATCH] x86: Introduce workarounds for running on valgrind

2009-09-01 Thread Pekka Enberg
From: Tomek Grabiec Currently workarounds eliminate class initialization from signal handler by unconditionally selecting calls to vm_class_ensure_init(). [ penb...@cs.helsinki.fi: use RUNNING_ON_VALGRIND for auto-detection ] Signed-off-by: Tomek Grabiec Signed-off-by: Pekka Enberg --- arch

Re: [PATCH] x86: Introduce workarounds for valgrind to work with jato.

2009-09-01 Thread Pekka Enberg
On Mon, 2009-08-31 at 16:14 +0200, Tomek Grabiec wrote: > Jato can be compiled with workarounds which make valgrind > work with jato. > > To do so, define VALGRIND variable for make: > make jato VALGRIND=y We can auto-detect whether we're running on valgrind or not: #include #include in

Re: [PATCH] x86: fix writes below (%esp) which can be fixed at no cost

2009-08-31 Thread Pekka Enberg
Hi Tomek, On Mon, 2009-08-31 at 20:30 +0200, Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > arch/x86/insn-selector.brg | 30 -- > 1 files changed, 16 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.br

Re: [PATCH] x86: Introduce workarounds for valgrind to work with jato.

2009-08-31 Thread Pekka Enberg
Hi Tomek, On Mon, 2009-08-31 at 16:14 +0200, Tomek Grabiec wrote: > Jato can be compiled with workarounds which make valgrind > work with jato. > > To do so, define VALGRIND variable for make: > make jato VALGRIND=y > > Currently workarounds eliminate class initialization > from signal handler b

Re: [PATCH] regression: add MirandaInterfaceMethodTest

2009-08-23 Thread Pekka Enberg
On Sun, 2009-08-23 at 09:06 +0200, Vegard Nossum wrote: > I did write something about this in the changelog of one of the other > patches. It is correct that this is not _exactly_ what a miranda > method is, but it would have been called a miranda method if it was > generated by javac. But we're do

Re: [PATCH] regression: add MirandaInterfaceMethodTest

2009-08-22 Thread Pekka Enberg
Vegard Nossum wrote: > @@ -0,0 +1,29 @@ > +package jvm; > + > +/** > + * @author Tomek Grabiec > + * @author Vegard Nossum > + */ > +public class MirandaInterfaceMethodTest extends TestCase { AFAICT, the name "miranda" is for methods inserted by javac to work around bugs in old VMs. What we're

Re: [PATCH] vm: remove extraneous semicolon

2009-08-22 Thread Pekka Enberg
On Sat, 2009-08-22 at 23:39 +0200, Vegard Nossum wrote: > Signed-off-by: Vegard Nossum > --- > vm/object.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/vm/object.c b/vm/object.c > index 1baa966..36e60c1 100644 > --- a/vm/object.c > +++ b/vm/object.c > @@ -373,7

Re: [PATCH] vm: add unimplemented interface methods to abstract classes

2009-08-22 Thread Pekka Enberg
Hi Vegard, (I'm cc'ing Eduard on the args map question.) On Sat, 2009-08-22 at 23:39 +0200, Vegard Nossum wrote: > @@ -371,7 +371,56 @@ int vm_class_link(struct vm_class *vmc, const > struct cafebabe_class *class) > } > } > > - vmc->methods = malloc(sizeof(*vmc->methods)

Re: [RFC][PATCH 3/3] jit: fix data flow resolution code in presence of empty basic blocks.

2009-08-19 Thread Pekka Enberg
lab > pop // This and the next instruction generate no > iconst_1 // LIR instructions. > lab: > > I tried to write a regression test based on the above description. Unfortunately this doesn't seem to trigger the bug: >From d642832b008d8622f01e14eb07c197f40458488

Re: [PATCH 3/3] spill-reload: Use radix_tree_lookup() in insert_mov_insns()

2009-08-18 Thread Pekka Enberg
Hi Tomek, On Tue, 2009-08-18 at 21:21 +0200, Tomek Grabiec wrote: > Like I said on IRC, this will not work for empty basic blocks, because > spill_at_insn will belong to the preceding > basic block. This causes that instructions will be added to different > (preceding) basic block and might not be

Re: [PATCH 3/3] spill-reload: Use radix_tree_lookup() in insert_mov_insns()

2009-08-18 Thread Pekka Enberg
be executed on some > execution paths. I think the following patch _is_ correct but it breaks "make regression" so I think we're silently spilling/reloading empty basic blocks. Pekka >From 999622798d073ae892c316e6f69fde7697233e4d Mon Sep 17 00:00:00 2

[PATCH 1/3] spill-reload: Insert spill instructions before branches

2009-08-18 Thread Pekka Enberg
Use insn_is_branch() to determine whether we must insert a spill instruction before or after the last instruction in a basic block. Cc: Arthur HUILLET Cc: Tomek Grabiec Signed-off-by: Pekka Enberg --- arch/mmix/include/arch/instruction.h |5 + arch/x86/include/arch/instruction.h

[PATCH 3/3] spill-reload: Use radix_tree_lookup() in insert_mov_insns()

2009-08-18 Thread Pekka Enberg
Lets use radix_tree_lookup() and get rid of the nasty loop in bb_last_insn(). For some reason, this seems to fix the infinite loop triggered by empty basic blocks. Cc: Arthur HUILLET Cc: Tomek Grabiec Signed-off-by: Pekka Enberg --- jit/basic-block.c | 16 +--- jit/spill

[PATCH 2/3] spill-reload: Remove redundant argument from insert_copy_slot_insn()

2009-08-18 Thread Pekka Enberg
The 'pop_at_insn' argument is not used in insert_copy_slot_insn() function so remove it to clean up code. Cc: Arthur HUILLET Cc: Tomek Grabiec Signed-off-by: Pekka Enberg --- jit/spill-reload.c | 13 + 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a

[PATCH] linear-scan: Fix range end checks

2009-08-17 Thread Pekka Enberg
From: Pekka Enberg The ->end member of struct live_range is not part of the range. Fix up some range end checks in jit/linear-scan.c which assume ->end is part of the range. Cc: Arthur HUILLET Signed-off-by: Pekka Enberg --- Arthur, I'd appreciate if you had a look at this patch

Re: [PATCH] vm: introduce per vm_class access flags.

2009-08-17 Thread Pekka Enberg
On Mon, 2009-08-17 at 19:36 +0200, Tomek Grabiec wrote: > 2009/8/17 Pekka Enberg : > > On Mon, 2009-08-17 at 15:38 +0200, Tomek Grabiec wrote: > >> We need to assign access flags for arrays and primitive classes which > >> have no corresponding cafebabe_class. Theref

Re: [PATCH] vm: introduce per vm_class access flags.

2009-08-17 Thread Pekka Enberg
On Mon, 2009-08-17 at 15:38 +0200, Tomek Grabiec wrote: > We need to assign access flags for arrays and primitive classes which > have no corresponding cafebabe_class. Therefore ->access_flags field is > introduced for struct vm_class. > > Signed-off-by: Tomek Grabiec I'd rather we didn't make s

More GCC warnings enabled

2009-08-16 Thread Pekka Enberg
Hi all, I've enabled some more GCC warnings now. There's still few more I'd like to enable at some point: -Wstack-protector -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wpacked -Wshadow -Wbad-function-cast Unfortunately all of them make bugs in Jato code visible so w

Re: [PATCH 13/30] x86-64: pass correct object reference to fixup_vtable()

2009-08-15 Thread Pekka Enberg
On Sat, 2009-08-15 at 18:55 +0200, Tomek Grabiec wrote: > 2009/8/15 Eduard - Gabriel Munteanu : > > The previous implementation passed an incorrect object reference to > > fixup_vtable() from code generated by emit_trampoline(). That was > > because *this gets passed by %rdi, not stack, on x86-64.

Re: [PATCH 5/5] vm: implement VMClass.getModifiers()

2009-08-12 Thread Pekka Enberg
Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > diff --git a/vm/jato.c b/vm/jato.c > index 6d1ac6b..0d32645 100644 > --- a/vm/jato.c > +++ b/vm/jato.c > @@ -607,10 +607,32 @@ native_vmclass_isprimitive(struct vm_object *object) > > static jint native_vmclass_getmodifiers(struct vm_object

Re: [PATCH 1/5] jit: add entry for EXPR_INVKOEINTERFACE in expr_is_pure()

2009-08-12 Thread Pekka Enberg
Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > jit/expression.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/jit/expression.c b/jit/expression.c > index ff80c1f..be1de1b 100644 > --- a/jit/expression.c > +++ b/jit/expression.c > @@ -126,6 +126,7 @@

Re: [PATCH] vm: set 'os.name' system property

2009-08-11 Thread Pekka Enberg
Vegard Nossum wrote: > 2009/8/11 Tomek Grabiec : >> Or we'll get this: >> >> Exception in thread "main" java/lang/ExceptionInInitializerError >> at java.io.VMFile.getName(VMFile.java:230) >> at java.io.File.getName(File.java:537) >> at java.lang.VMClassLoader.getResources(VMClassLoader.java:2

Re: [PATCH] jit: EXPR_INSTANCEOF should have J_INT return type

2009-08-10 Thread Pekka Enberg
On Tue, 2009-08-11 at 01:10 +0200, Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > jit/expression.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/jit/expression.c b/jit/expression.c > index 3acbd3c..e1001a1 100644 > --- a/jit/expression.c > +++ b/jit/

Re: [PATCH] jit: introduce per-cu lir -> insn mapping

2009-08-06 Thread Pekka Enberg
On Thu, 2009-08-06 at 16:13 +0200, Vegard Nossum wrote: > This fixes the performance issue in liveness analysis. > > Signed-off-by: Vegard Nossum Nice! Perf report looks like this now: # Overhead CommandShared Object Symbol # ...

Native symbol resolution busted

2009-08-05 Thread Pekka Enberg
Hi Tomek, It seems that native symbol resolution is busted somehow: [AWT-EventQueue-2] SIGSEGV at EIP 08055d30 while accessing memory address 002a. [AWT-EventQueue-2] Registers: [AWT-EventQueue-2] eax: ebx: ecx: 0001 edx: [AWT-EventQueue-2] esi: 00

Re: [PATCH 02/26] jit: make trace output thread safe.

2009-08-02 Thread Pekka Enberg
On Mon, 2009-08-03 at 00:09 +0200, Tomek Grabiec wrote: > @@ -719,18 +720,18 @@ const char *stack_trace_elem_type_name(enum > stack_trace_elem_type type) > > static void show_mixed_stack_trace(struct stack_trace_elem *elem) > { > - printf("Native and JAVA stack trace:\n"); > + trace_pri

Re: [PATCH 09/26] regression: introduce JNI regression tests

2009-08-02 Thread Pekka Enberg
Hi Tomek, I skipped this patch because it's causing too many problems. The regression test didn't compile: make -C regression/jni make[1]: Entering directory `/home/penberg/src/jato/regression/jni' JAVAHjvm_JNITest.h CXX libjnitest.so In file included from jvm_JNITest.cpp:1: jvm_JNIT

Re: [PATCH 01/26] vm: introduce vm_thread_get_name()

2009-08-02 Thread Pekka Enberg
The series has been applied, thanks! -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core app

Re: [PATCH 25/26] x86: fix 'this' pointer passing to fixup_vtable() for JNI methods.

2009-08-02 Thread Pekka Enberg
Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > arch/x86/emit-code.c | 17 +++-- > 1 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c > index 57de052..521c150 100644 > --- a/arch/x86/emit-code.c > +++ b/arch/x8

Re: [PATCH 15/26] vm: set user.dir, user.home, user.name properties

2009-08-02 Thread Pekka Enberg
Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > vm/jato.c |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/vm/jato.c b/vm/jato.c > index 4a82048..ea176ca 100644 > --- a/vm/jato.c > +++ b/vm/jato.c > @@ -206,6 +206,13 @@ static void init_system_prope

Re: [PATCH 13/26] vm: initial support for JNI invocation API

2009-08-02 Thread Pekka Enberg
Tomek Grabiec wrote: > @@ -52,6 +52,53 @@ > if (!vm_object_is_instance_of((x), vm_java_lang_Class)) \ > return NULL; > > +static void vm_jni_destroy_java_vm(void) { > + NOT_IMPLEMENTED; > +} > + > +static void vm_jni_attach_current_thread(void) { > + NOT_IMPLEM

Re: [PATCH] jit: fix liveness analysis

2009-08-01 Thread Pekka Enberg
On Fri, 2009-07-31 at 18:12 +0200, Vegard Nossum wrote: > All registers that were defined in the basic block were subtracted from the > use set. This is right if the order is "define, use", but it's wrong if the > order is "use, define". Fix this by checking if the register has already > been used/

Re: [PATCH] jit: fix liveness analysis

2009-08-01 Thread Pekka Enberg
Hi Vegard, On Fri, 2009-07-31 at 18:12 +0200, Vegard Nossum wrote: > All registers that were defined in the basic block were subtracted from the > use set. This is right if the order is "define, use", but it's wrong if the > order is "use, define". Fix this by checking if the register has already

Re: [PATCH] vm: initialize monitor fields

2009-08-01 Thread Pekka Enberg
On Thu, 2009-07-30 at 14:41 +0200, Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > vm/object.c |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/vm/object.c b/vm/object.c > index cb69dca..1a5136a 100644 > --- a/vm/object.c > +++ b/vm/object.c > @@ -597,6

Re: [PATCH 4/6] vm: make static field fixup thread safe

2009-08-01 Thread Pekka Enberg
On Thu, 2009-07-30 at 12:50 +0200, Tomek Grabiec wrote: > diff --git a/include/vm/class.h b/include/vm/class.h > index 2ed5ffe..b827afc 100644 > --- a/include/vm/class.h > +++ b/include/vm/class.h > @@ -2,6 +2,7 @@ > #define _VM_CLASS_H > > #include > +#include > > #include "vm/field.h" >

Re: [PATCH 3/6] jato: prevent removal of .java regression test suite files on `make clean'

2009-08-01 Thread Pekka Enberg
On Thu, 2009-07-30 at 12:50 +0200, Tomek Grabiec wrote: > Signed-off-by: Tomek Grabiec > --- > Makefile |1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/Makefile b/Makefile > index ede2d0c..c037fb8 100644 > --- a/Makefile > +++ b/Makefile > @@ -308,7 +308,6 @@ clean:

Re: [PATCH 1/6] jit: ensure tracing mutual exclusion during whole method compilation

2009-08-01 Thread Pekka Enberg
On Thu, 2009-07-30 at 12:50 +0200, Tomek Grabiec wrote: > We have to make trace_mutex recursive because java.lang.String > initialization might be triggered during compilation of method > containing ldc on String constant. > > Signed-off-by: Tomek Grabiec > +void init_tracing(void) > +{ > + p

Re: [RFC][PATCH] jit: fix handling of split intervals in register allocator

2009-08-01 Thread Pekka Enberg
On Wed, 2009-07-29 at 15:36 +0200, Tomek Grabiec wrote: > Liveness analysis can produce intervals with range not ending at a use > position. When splitting such interval after last use position we get > the new interval with non-zero range length and without use positions. > We should not add such

Re: [PATCH 1/2] jit: fix basic block splitting

2009-07-29 Thread Pekka Enberg
On Wed, 2009-07-29 at 12:15 +0200, Vegard Nossum wrote: > On splitting a bb, the successors of the new bb were still pointing at > the original bb. This caused the CFG to be inconsistent and subsequently > also mimic stack spill/restore to do the wrong thing. > > This fixes the java.security.Prote

Re: [RFC][PATCH] jit: set argument index correctly for JNI invocations

2009-07-28 Thread Pekka Enberg
On Tue, 2009-07-28 at 17:53 +0300, Eduard - Gabriel Munteanu wrote: > On Tue, Jul 28, 2009 at 01:52:39PM +0300, Pekka Enberg wrote: > > Tomek Grabiec wrote: > >> When method is a JNI method, then we add a pointer to JNI environemnt > >> as the first argument. If me

  1   2   3   >