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

2009-06-24 Thread Pekka Enberg
On Thu, 2009-06-25 at 01:02 +0200, Arthur HUILLET wrote: > It is necessary for System.out.println > > Signed-off-by: Arthur HUILLET Seems reasonable although I usually don't like merging something that has no users. Anyway, applied! -

Re: [PATCH] regression: ObjectStackTest now enabled

2009-06-24 Thread Pekka Enberg
On Wed, 2009-06-24 at 22:25 +0200, Arthur HUILLET wrote: > Signed-off-by: Arthur HUILLET > --- > regression/jvm/ObjectStackTest.java |3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) Nice work! Applied. --

Re: [PATCH 3/3] bc2ir: mimic stack spilling/reloading

2009-06-24 Thread Pekka Enberg
On Wed, 2009-06-24 at 22:21 +0200, Arthur HUILLET wrote: > @@ -276,6 +277,121 @@ out: > return err; > } > > +static void assign_temporary(struct basic_block *bb, int entry, int slotnb, > + struct var_info *tmp_high, struct var_info *tmp_low) > +{ Indentation gone crazy in this

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

2009-06-24 Thread Pekka Enberg
On Wed, 2009-06-24 at 22:21 +0200, Arthur HUILLET wrote: > This will be necessary for bc2ir to work. > > Signed-off-by: Arthur HUILLET > @@ -235,6 +236,13 @@ struct expression { > > /* EXPR_ARRAY_SIZE_CHECK and EXPR_MULTIARRAY_SIZE_CHECK */ > struct tree_node *size_

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

2009-06-24 Thread Pekka Enberg
On Wed, 2009-06-24 at 18:13 +0200, Arthur HUILLET wrote: > diff --git a/test/jit/basic-block-assert.h > b/test/jit/basic-block-assert.h > index 8f00672..abec84c 100644 > --- a/test/jit/basic-block-assert.h > +++ b/test/jit/basic-block-assert.h > @@ -12,16 +12,28 @@ static void inline assert_basic_b

Re: Monoburg arithmetic operations

2009-06-24 Thread Pekka Enberg
On Thu, 2009-06-25 at 00:53 +0200, Arthur Huillet wrote: > I wasted several hours until I noticed that OP_AND was only implemented with > (reg, EXPR_LOCAL). > > The (reg, reg) variant is missing for several binops, and it's very difficult > with monoburg to notice it. Yup, I think it's worth some

[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 --- 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 +++ arch/x86/use-

Monoburg arithmetic operations

2009-06-24 Thread Arthur Huillet
Hi, I wasted several hours until I noticed that OP_AND was only implemented with (reg, EXPR_LOCAL). The (reg, reg) variant is missing for several binops, and it's very difficult with monoburg to notice it. Implementing the (reg, reg) variants for operations will be my work of tomorrow as it is

[PATCH] regression: ObjectStackTest now enabled

2009-06-24 Thread Arthur HUILLET
Signed-off-by: Arthur HUILLET --- regression/jvm/ObjectStackTest.java |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/regression/jvm/ObjectStackTest.java b/regression/jvm/ObjectStackTest.java index d49cc62..04efeca 100644 --- a/regression/jvm/ObjectStackTest.java +++ b

[PATCH 3/3] bc2ir: mimic stack spilling/reloading

2009-06-24 Thread Arthur HUILLET
Mimic stack is now correctly spilled and reloaded at basic block boundaries. Signed-off-by: Arthur HUILLET --- jit/bytecode-to-ir.c | 155 +- 1 files changed, 141 insertions(+), 14 deletions(-) diff --git a/jit/bytecode-to-ir.c b/jit/bytecode-to-

[PATCH 2/3] jit: add list of mimic stack exprs to struct basic_block

2009-06-24 Thread Arthur HUILLET
BC2IR needs it to properly replace them by temporaries. Signed-off-by: Arthur HUILLET --- include/jit/basic-block.h |3 +++ jit/basic-block.c | 26 -- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/jit/basic-block.h b/include/jit/ba

[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 --- include/jit/expression.h | 16 jit/expression.c | 12 jit/tree-printer.c | 11 +-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/include/jit/exp

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

2009-06-24 Thread Arthur HUILLET
Signed-off-by: Arthur HUILLET --- 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 __bb_add_neighbor(struct basic_b

[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 --- include/jit/basic-block.h |2 ++ jit/basic-block.c | 32 +++- jit/trace-jit.c | 23 +++ test/jit/basic

[PATCH] bc2ir: fix refcount bug in spill_expression

2009-06-24 Thread Arthur HUILLET
Signed-off-by: Arthur HUILLET --- 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 @@ static int spill_exp

[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 --- arch/x86/include/arch/signal.h |2 +- arch/x86/signal.c |9 ++--- vm/signal.c

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

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

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

[PATCH 7/7] jit: fix condition on which fixup_direct_calls() is called from jit_magic_trampoline()

2009-06-24 Thread Tomek Grabiec
fixup_direct_calls() should be called whenever return address (ret) is not NULL, it should not depend on whether compilation unit is marked as compiled. That's because native methods are never marked as compiled and yet we can fixup the calls. Signed-off-by: Tomek Grabiec --- jit/trampoline.c |

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

[PATCH 3/7] vm: skip __cleanup_args if args_size is 0.

2009-06-24 Thread Tomek Grabiec
Signed-off-by: Tomek Grabiec --- arch/x86/include/arch/stack-frame.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/arch/stack-frame.h b/arch/x86/include/arch/stack-frame.h index 3f27fae..3813668 100644 --- a/arch/x86/include/arch/stack-frame.h