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

2009-06-24 Thread Tomek Grabiec
It is not safe to execute jit code in signal handler context. One of the reasons is that throwing-by-signal mechanisms don't work in code executed from signal handler. That's becasue kernel will not execute user defined signal handler for SIGSEGV when second signal occures while executing the

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

2009-06-24 Thread Tomek Grabiec
The natives VMThrowable.fillInStackTrace and VMThrowable.getStackTrace are implemented. The stack trace can not be printed yet by invoking printStackTrace() on java.lang.Throwable instance because jato cannot execute PrintStream.print() yet. The stack trace can be however printed when

[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

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

2009-06-24 Thread Tomek Grabiec
A number of utility functions are introduced for backtrace traversal to assist java stack trace collecting. Only JIT methods and VM natives should appear in stack trace so all native functions and trampolines must be filtered out. A new per-thread variable bottom_stack_frame is introduced to

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

[PATCH] bc2ir: fix refcount bug in spill_expression

2009-06-24 Thread Arthur HUILLET
Signed-off-by: Arthur HUILLET arthur.huil...@free.fr --- jit/bytecode-to-ir.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/jit/bytecode-to-ir.c b/jit/bytecode-to-ir.c index 76fd5a4..862a335 100644 --- a/jit/bytecode-to-ir.c +++ b/jit/bytecode-to-ir.c @@ -143,7 +143,7

[PATCH 1/2] jit: add predecessors to basic block structure

2009-06-24 Thread Arthur HUILLET
The list of predecessors is not set yet, this is just the infrastructure. Signed-off-by: Arthur HUILLET arthur.huil...@free.fr --- include/jit/basic-block.h |2 ++ jit/basic-block.c | 32 +++- jit/trace-jit.c | 23

[PATCH 2/2] jit: set up bb predecessors in bb_add_successor

2009-06-24 Thread Arthur HUILLET
Signed-off-by: Arthur HUILLET arthur.huil...@free.fr --- jit/basic-block.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/jit/basic-block.c b/jit/basic-block.c index df984eb..5a4fa53 100644 --- a/jit/basic-block.c +++ b/jit/basic-block.c @@ -167,6 +167,7 @@ int

[PATCH 1/3] jit: add EXPR_MIMIC_STACK_SLOT and expr_set_type

2009-06-24 Thread Arthur HUILLET
This will be necessary for bc2ir to work. Signed-off-by: Arthur HUILLET arthur.huil...@free.fr --- include/jit/expression.h | 16 jit/expression.c | 12 jit/tree-printer.c | 11 +-- 3 files changed, 37 insertions(+), 2 deletions(-) diff

[PATCH] x86: add OP_AND(reg, reg)

2009-06-24 Thread Arthur HUILLET
It is necessary for System.out.println Signed-off-by: Arthur HUILLET arthur.huil...@free.fr --- arch/x86/emit-code.c|7 +++ arch/x86/include/arch/instruction.h |1 + arch/x86/insn-selector_32.brg | 15 +++ arch/x86/lir-printer.c |7