Re: [PATCH] cafebabe: fix bug in cafebabe_stream_close()

2009-10-09 Thread Vegard Nossum
2009/10/9 Tomek Grabiec : > The bracket was misplaced causing close() to use wrong file descriptor. > This led to the following error message for tetris: > .: Fatal IO error 9 (Bad file descriptor) on X server :0.0. > > CC: Vegard Nossum > Signed-off-by: Tomek Grabiec >

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

2009-09-06 Thread Vegard Nossum
8,6 +163,9 @@ int vm_method_init_from_interface(struct vm_method *vmm, > struct vm_class *vmc, > >        vmm->args_count = interface_method->args_count; >        vmm->is_vm_native = false; > + > +       init_abstract_method(vmm); > + >        return 0; >  } ACK

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

2009-09-06 Thread Vegard Nossum
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 >>> classfiles. >>> >> >> Native and abstract methods don't have code. It

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

2009-09-05 Thread Vegard Nossum
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_edition/html/ClassFile.doc.html#1546 I think I tried once to skip the prepare-for-ji

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

2009-09-05 Thread Vegard Nossum
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 >> symptom and not the real error. We have met

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

2009-09-05 Thread Vegard Nossum
 by 0x806F932: vm_class_link (class.c:275) >  ==24231==    by 0x8070889: 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 |  

[PATCH 3/3] x86: add debug check to emit_itable_bsearch()

2009-08-30 Thread Vegard Nossum
This check ensures that we actually found the method we were searching for. (If we didn't, we die.) Signed-off-by: Vegard Nossum --- arch/x86/emit-code.c | 56 +++-- 1 files changed, 40 insertions(+), 16 deletions(-) diff --git a/arch/x86

[PATCH 2/3] vm: move itable_resolver_stub_error() to arch/x86

2009-08-30 Thread Vegard Nossum
This method was always arch-specific anyway, and now we need to call it from emit-code.c anyway. Signed-off-by: Vegard Nossum --- arch/x86/emit-code.c | 20 arch/x86/include/arch/itable.h | 10 ++ vm/itable.c| 22

[PATCH 1/3] vm: add trace_flush() to itable tracing and skip empty tables

2009-08-30 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- vm/itable.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/vm/itable.c b/vm/itable.c index 6f93457..bf38d6b 100644 --- a/vm/itable.c +++ b/vm/itable.c @@ -189,6 +189,18 @@ static void *itable_create_conflict_resolver

[PATCH] trace: filter traces by regex given by -Xtrace:method

2009-08-23 Thread Vegard Nossum
ain] trace invoke: java/util/Vector.addElement(Ljava/lang/Object;)V [main] trace invoke: java/util/Vector.add(Ljava/lang/Object;)Z [main] trace invoke: java/util/Vector.addElement(Ljava/lang/Object;)V PrintTest OK. Signed-off-by: Vegard Nossum --- include/jit/compiler.h | 12 jit/t

[PATCH 5/7] lib: add array_unique() to filter out duplicate elements

2009-08-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile |1 + include/lib/array.h|4 +++ lib/array.c| 50 test/arch-x86/Makefile |1 + 4 files changed, 56 insertions(+), 0 deletions(-) create mode 100644 lib/array.c

[PATCH 1/7] lib: add generic resizable array

2009-08-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/lib/array.h | 84 +++ 1 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 include/lib/array.h diff --git a/include/lib/array.h b/include/lib/array.h new file mode 100644 index 000

[PATCH 7/7] vm: remove duplicate methods from itable

2009-08-23 Thread Vegard Nossum
. Signed-off-by: Vegard Nossum --- vm/itable.c | 31 +-- 1 files changed, 13 insertions(+), 18 deletions(-) diff --git a/vm/itable.c b/vm/itable.c index 83ede3e..b1aaee4 100644 --- a/vm/itable.c +++ b/vm/itable.c @@ -29,6 +29,8 @@ #include #include +#include &quo

[PATCH 6/7] vm: fix abstract class implementing two interfaces with the same method

2009-08-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- vm/class.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/vm/class.c b/vm/class.c index abd3a5b..aced89b 100644 --- a/vm/class.c +++ b/vm/class.c @@ -204,6 +204,22 @@ static int insert_interface_method(struct

[PATCH 2/7] vm: add unimplemented interface methods to abstract classes

2009-08-23 Thread Vegard Nossum
Reported-by: Tomek Grabiec Signed-off-by: Vegard Nossum --- include/vm/class.h |1 + include/vm/method.h |3 ++ vm/class.c | 85 +- vm/method.c | 19 +++ 4 files changed, 99 insertions(+), 9 deletions(-) diff

[PATCH 4/7] lib: add array_qsort() helper function

2009-08-23 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/lib/array.h |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/lib/array.h b/include/lib/array.h index 3b43db5..cff85c1 100644 --- a/include/lib/array.h +++ b/include/lib/array.h @@ -81,4 +81,10 @@ static inline int

[PATCH 3/7] regression: add VirtualAbstractInterfaceMethodTest

2009-08-23 Thread Vegard Nossum
NOTE: The test-case was actually derived by Tomek Grabiec. Signed-off-by: Vegard Nossum --- Makefile |1 + .../jvm/VirtualAbstractInterfaceMethodTest.java| 29 regression/run-suite.sh|1 + 3

Re: [PATCH] regression: add MirandaInterfaceMethodTest

2009-08-23 Thread Vegard Nossum
2009/8/23 Pekka Enberg : > Vegard Nossum wrote: >> >> @@ -0,0 +1,29 @@ >> +package jvm; >> + >> +/** >> + * @author Tomek Grabiec >> + * @author Vegard Nossum >> + */ >> +public class MirandaInterfaceMethodTest extends TestCase { > >

[PATCH] vm: improve itable tracing and switch to trace_printf()

2009-08-22 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- vm/itable.c | 28 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/vm/itable.c b/vm/itable.c index a544c9b..83ede3e 100644 --- a/vm/itable.c +++ b/vm/itable.c @@ -35,6 +35,7 @@ #include "vm/object.h" #i

[PATCH] vm: remove extraneous semicolon

2009-08-22 Thread Vegard Nossum
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 +373,7 @@ bool vm_object_is_instance_of(const struct vm_object *obj

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

2009-08-22 Thread Vegard Nossum
We use the term "miranda method" here as a method which is omitted by the compiler (because the method is declared in an interface and the implementing class is abstract), and which needs to be inserted by the VM. Reported-by: Tomek Grabiec Signed-off-by: Vegard Nossum --- include/

[PATCH] regression: add MirandaInterfaceMethodTest

2009-08-22 Thread Vegard Nossum
NOTE: The test-case was actually derived by Tomek Grabiec. Signed-off-by: Vegard Nossum --- Makefile |1 + regression/jvm/MirandaInterfaceMethodTest.java | 29 regression/run-suite.sh|1 + 3 files

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

2009-08-18 Thread Vegard Nossum
2009/8/17 Tomek Grabiec : > 2009/8/17 Vegard Nossum : >> BTW, which flags are those? >> > > My patch sets flags the same way as jamvm (and hotspot) does: > - for primitive types: ACC_PUBLIC + ACC_ABSTRACT + ACC_FINAL > - for array types: ACC_ABSTRACT + ACC_FINAL

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

2009-08-17 Thread Vegard Nossum
2009/8/17 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. Therefo

Re: [PATCH 4/6] jit: make fixup sites use native pointers instead of struct insn pointers at run-time

2009-08-14 Thread Vegard Nossum
2009/8/13 Tomek Grabiec : > This is necessary for basic block freeing after compilation to be possible. > > Signed-off-by: Tomek Grabiec Hi, I feel very confused by this patch, and I wish there was an explanation of the changes too. > diff --git a/include/jit/compilation-unit.h b/include/jit/co

[PATCH 1/2] vm: fix field resolution (search interfaces)

2009-08-11 Thread Vegard Nossum
Reported-and-analyzed-by: Tomek Grabiec Signed-off-by: Vegard Nossum --- vm/class.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/vm/class.c b/vm/class.c index 757d242..b06ea04 100644 --- a/vm/class.c +++ b/vm/class.c @@ -701,11 +701,19 @@ struct vm_field

[PATCH 2/2] regression: add InterfaceFieldInheritanceTest

2009-08-11 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile |1 + regression/jvm/InterfaceFieldInheritanceTest.java | 14 ++ regression/run-suite.sh |1 + 3 files changed, 16 insertions(+), 0 deletions(-) create mode 100644

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

2009-08-11 Thread Vegard Nossum
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:208) >   at java.lang.VMClassL

[PATCH] vm: add only abstract methods to the itable

2009-08-11 Thread Vegard Nossum
Apparently, interfaces may have static initializers ( methods). We don't want to put them in the itable. This patch adds only the abstract methods to the itable. Reported-by: Tomek Grabiec Signed-off-by: Vegard Nossum --- vm/itable.c |3 +++ 1 files changed, 3 insertions(+), 0 dele

[PATCH] jit: put only J_REFERENCE types in the gc map

2009-08-10 Thread Vegard Nossum
Also print out the stack slot (if known). This code probably still needs some fixing. Signed-off-by: Vegard Nossum --- jit/gc-map.c| 22 -- jit/trace-jit.c | 13 + 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/jit/gc-map.c b/jit/gc

[PATCH 3/3] jit: add all (in-use) virtual registers to gc map

2009-08-10 Thread Vegard Nossum
Previously, we added only those vregs which were active (had a machine register assigned) at the gc safepoint. Now we add both in-register and in-stack variables to the stack map, and print the machine register in the gc-map tracing. Signed-off-by: Vegard Nossum --- jit/gc-map.c|6

[PATCH 1/3] x86: add lir printer for INSN_TEST_IMM_MEMDISP

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/lir-printer.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c index 61e7645..c69ae36 100644 --- a/arch/x86/lir-printer.c +++ b/arch/x86/lir-printer.c @@ -70,6

[PATCH 2/3] jit: only add J_REFERENCE types to the gc register/stack map

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- jit/gc-map.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/jit/gc-map.c b/jit/gc-map.c index 997c7e6..a341f17 100644 --- a/jit/gc-map.c +++ b/jit/gc-map.c @@ -26,6 +26,9 @@ int gc_map_init(struct compilation_unit *cu

[PATCH 5/5] x86: select gc safepoints before function calls

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index 01b57d7..a8a418e 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn

[PATCH 4/5] x86: fix INSN_TEST_IMM_MEMDISP (introduce OPERAND_MEMDISP)

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

[PATCH 1/5] jit: add gc-map creation entry point

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile |1 + include/jit/gc-map.h |8 jit/compiler.c |5 + jit/gc-map.c |7 +++ 4 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 include/jit/gc-map.h create mode 100644 jit/gc

[PATCH 2/5] jit: preliminary support for creating (somewhat crude) gc register/stack maps

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/include/arch/instruction.h |2 + include/jit/compilation-unit.h |5 jit/gc-map.c| 37 +++ 3 files changed, 44 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/arch

[PATCH 3/5] jit: preliminary support for gc map tracing

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/jit/compiler.h |2 ++ jit/compiler.c |3 +++ jit/trace-jit.c| 41 + vm/jato.c |6 ++ 4 files changed, 52 insertions(+), 0 deletions(-) diff --git a/include/jit

[PATCH 8/8] vm: add thread synchronization for GC

2009-08-10 Thread Vegard Nossum
Original code by Pekka Enberg. Signed-off-by: Vegard Nossum --- include/vm/gc.h |1 + vm/gc.c | 59 +++ 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index b833219..05e324c

[PATCH 7/8] vm: count the number of threads for GC

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/gc.h|4 test/arch-x86/Makefile |1 + test/jit/Makefile |1 + test/vm/gc-stub.c |9 + vm/gc.c| 25 + vm/thread.c|5 + 6 files changed, 45

[PATCH 4/8] lib: specify initial status of guard-page in constructor

2009-08-10 Thread Vegard Nossum
This patch adds a parameter "bool hidden" to the guard-page constructor, which signals whether the page should be initially hidden or accessible. Needed for GC, which wants an initially unhidden page. Signed-off-by: Vegard Nossum --- include/lib/guard-page.h |4 +++- jit/e

[PATCH 1/8] x86: call use-def table sanity checking arch-specific init code

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/init.c |3 +++ vm/jato.c |9 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/x86/init.c b/arch/x86/init.c index 5353f70..25b2e1a 100644 --- a/arch/x86/init.c +++ b/arch/x86/init.c @@ -1,6 +1,7 @@ #include

[PATCH 3/8] Move {vm -> lib}/guard-page.[ch]

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile |2 +- include/lib/guard-page.h |9 + include/vm/guard-page.h |9 - jit/exception.c |2 +- lib/guard-page.c | 90 ++ test/arch-x86/Makefile |2

[PATCH 2/8] vm: allocate a safepoint guard page for the garbage collector

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile| 11 ++- include/vm/gc.h |8 vm/gc.c | 12 vm/jato.c |2 ++ 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 include/vm/gc.h create mode 100644 vm/gc.c diff --git a

[PATCH 5/8] x86: add support for INSN_TEST_IMM_MEMDISP

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/emit-code.c| 23 +++ arch/x86/include/arch/instruction.h |2 ++ arch/x86/instruction.c | 10 ++ arch/x86/use-def.c |1 + 4 files changed, 36 insertions(+), 0 deletions

[PATCH 6/8] vm: catch gc safepoints in signal handler

2009-08-10 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/gc.h |1 + vm/gc.c |4 vm/signal.c | 21 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/vm/gc.h b/include/vm/gc.h index 6c39996..82766ca 100644 --- a/include/vm/gc.h +++ b

[PATCH 3/4] x86: use MACH_REG_xCX instead of MACH_REG_ECX in generic code

2009-08-09 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index 66744bb..e5da1a9 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg @@ -1425,7

[PATCH 4/4] x86_64: fix unused variables warnings in insn-selector

2009-08-09 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index e5da1a9..19ab58e 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg @@ -96,9

[PATCH 2/4] x86_64: fix REG_UNASSIGNED -> MACH_REG_UNASSIGNED in insn-selector

2009-08-09 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index 609a5a8..66744bb 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg

[PATCH 1/4] x86_64: fix typo in function call in insn-selector

2009-08-09 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index a8f18b6..609a5a8 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg @@ -1268,7

[RFC][PATCH] jit: remove machine_reg_type

2009-08-09 Thread Vegard Nossum
Since we're now using the var_info's vm type for register allocation, we can use it for spill/reload too, which gets rid of machine_reg_type entirely. Signed-off-by: Vegard Nossum --- arch/mmix/include/arch/registers.h |2 -- arch/mmix/register.c|5 -

[PATCH 5/5] jit: add support for register constraints

2009-08-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/mmix/include/arch/registers.h |9 + arch/x86/include/arch/registers_32.h |4 ++- arch/x86/registers_32.c | 58 - jit/linear-scan.c| 14 +--- 4 files changed, 55 insertions

[PATCH 4/5] jit: fix off-by-one in register allocator

2009-08-08 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- jit/linear-scan.c |2 +- test/jit/linear-scan-test.c |9 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/jit/linear-scan.c b/jit/linear-scan.c index d2a3c92..f038ba3 100644 --- a/jit/linear-scan.c

[PATCH 3/5] x86: define emitter for MOVSX_16_MEMBASE_REG

2009-08-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/emit-code.c| 15 +++ arch/x86/include/arch/instruction.h |1 + arch/x86/use-def.c |1 + 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c

[PATCH 2/5] x86: define emitter for MOVSX_8_MEMBASE_REG

2009-08-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/emit-code.c| 15 +++ arch/x86/include/arch/instruction.h |1 + arch/x86/use-def.c |1 + 3 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c

[PATCH 1/5] vm: introduce vm_type_size()

2009-08-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/types.h |1 + vm/types.c | 19 +++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/include/vm/types.h b/include/vm/types.h index dc944d9..9b5c2f6 100644 --- a/include/vm/types.h +++ b/include/vm/types.h

Re: [PATCH] vm: fix utf8_to_char_array()

2009-08-08 Thread Vegard Nossum
2009/8/8 Tomek Grabiec : > This caused that for characters with codes > 0x80 we > skipped one byte. > > Signed-off-by: Tomek Grabiec I don't like this patch. We already have all our error checking in utf8_char_count() and utf8_to_char_array() assumes this. We shouldn't have error checks in utf8_

[PATCH] vm: fix itable sorting

2009-08-08 Thread Vegard Nossum
Reported-and-analyzed-by: Tomek Grabiec Signed-off-by: Vegard Nossum --- vm/itable.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/itable.c b/vm/itable.c index 77409c0..955aa66 100644 --- a/vm/itable.c +++ b/vm/itable.c @@ -135,8 +135,8

[PATCH 1/2] vm: clean up field initialization a little bit

2009-08-08 Thread Vegard Nossum
Makes the code easier to read. Signed-off-by: Vegard Nossum --- vm/class.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vm/class.c b/vm/class.c index 91f4ca0..8cb6ebb 100644 --- a/vm/class.c +++ b/vm/class.c @@ -266,6 +266,7 @@ int vm_class_link(struct

[PATCH 2/2] vm: group class/instance fields by type

2009-08-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/field.h |4 +- vm/class.c | 135 +-- vm/field.c | 11 + 3 files changed, 112 insertions(+), 38 deletions(-) diff --git a/include/vm/field.h b/include/vm/field.h index 4a5a557

[PATCH] vm: rename vm_object_alloc_{native -> primitive}_array

2009-08-06 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg |4 ++-- include/vm/object.h|2 +- vm/object.c|8 vm/stack-trace.c |2 +- vm/utf8.c |2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a

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

2009-08-06 Thread Vegard Nossum
This fixes the performance issue in liveness analysis. Signed-off-by: Vegard Nossum --- include/jit/compilation-unit.h |7 +- include/jit/vars.h |3 -- jit/compilation-unit.c | 21 +++-- jit/interval.c | 25

[PATCH] x86: add use-def for MOVZX_16_REG_REG

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 3c63f76..2ceb85a 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -94,6 +94,7 @@ static struct insn_info

[PATCH] x86: add use-def for CMP_REG_REG

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 412a99e..3c63f76 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -53,6 +53,7 @@ static struct insn_info

[PATCH] x86: make sure all instruction types have a use-def

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/include/arch/instruction.h |5 + arch/x86/use-def.c | 10 ++ vm/jato.c |9 + 3 files changed, 24 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/arch/instruction.h b

[PATCH 19/21] x86: add USE_DST to MOV_IMM_THREAD_LOCAL_MEMBASE

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 0d62673..6dd1423 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -74,7 +74,7 @@ static struct insn_info

[PATCH 18/21] x86: change DEF_DST to USE_DST for MOV_XMM_MEMBASE

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 8b94645..0d62673 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -64,7 +64,7 @@ static struct insn_info

[PATCH 21/21] x86: change DEF_DST to USE_DST in CMP_MEMBASE_REG

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index b078776..7320887 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use

[PATCH 20/21] x86: add USE_DST to MOV_REG_THREAD_LOCAL_MEMBASE

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 6dd1423..b078776 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -86,7 +86,7 @@ static struct insn_info

[PATCH 17/21] x86: add USE_DST to XOR

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |8 test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 626a507..8b94645 100644 --- a/arch/x86

[PATCH 15/21] x86: add USE_DST to SHR

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index ea4a660..c48024a 100644 --- a/arch/x86/use

[PATCH 16/21] x86: add USE_DST to SUB

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |6 +++--- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index c48024a..626a507 100644 --- a/arch/x86

[PATCH 13/21] x86: add USE_DST to SBB

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |6 +++--- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 68a65af..c8a99db 100644 --- a/arch/x86

[PATCH 14/21] x86: add USE_DST to SHL

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index c8a99db..ea4a660 100644 --- a/arch/x86/use

[PATCH 11/21] x86: add USE_DST to OR

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index a5190e5..17376a7 100644 --- a/arch/x86/use

[PATCH 12/21] x86: add USE_DST to SAR

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 17376a7..68a65af 100644 --- a/arch/x86/use

[PATCH 10/21] x86: add USE_DST to MUL

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index e8ec2cf..a5190e5 100644 --- a/arch/x86/use

[PATCH 06/21] x86: add USE_DST to FADD

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index f3489ba..5571225 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -55,7 +55,7 @@ static

[PATCH 08/21] x86: add USE_DST to FMUL

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 1b52079..7578114 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -57,7 +57,7 @@ static

[PATCH 09/21] x86: add USE_DST to FDIV

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 7578114..e8ec2cf 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -58,7 +58,7 @@ static

[PATCH 04/21] x86: add USE_DST to AND_IMM_REG

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index cc12c5d..6acd026 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -46,8 +46,8 @@ static

[PATCH 05/21] x86: add USE_DST to DIV

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 6acd026..f3489ba 100644 --- a/arch/x86/use

[PATCH 07/21] x86: add USE_DST to FSUB

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 5571225..1b52079 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -56,7 +56,7 @@ static

[PATCH 02/21] x86: add USE_DST to ADC

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 02180bd..d1965e2 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -40,9 +40,9

[PATCH 03/21] x86: add USE_DST to ADD_IMM_REG

2009-08-04 Thread Vegard Nossum
From: Arthur Huillet Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |4 ++-- test/arch-x86/use-def-test_32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index d1965e2..cc12c5d 100644 --- a/arch/x86/use

[PATCH 01/21] test/x86: add usedef helpers

2009-08-04 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- test/arch-x86/use-def-test_32.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/test/arch-x86/use-def-test_32.c b/test/arch-x86/use-def-test_32.c index a1c2398..3b5b916 100644 --- a/test/arch-x86/use-def-test_32.c +++ b

[PATCH] jit: display float and double arguments in -Xtrace:invoke

2009-08-04 Thread Vegard Nossum
With this we also see the actual floating-point value and not just the hexadecimal representation. Signed-off-by: Vegard Nossum --- jit/trace-jit.c | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/jit/trace-jit.c b/jit/trace-jit.c index c9bae17

[PATCH] regression: add comparison operators to FloatArithmeticTest

2009-08-03 Thread Vegard Nossum
Javac produces both fcmpg and fcmpl instructions for this, verified with javap. Signed-off-by: Vegard Nossum --- regression/jvm/FloatArithmeticTest.java | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/regression/jvm/FloatArithmeticTest.java b

[PATCH] x86: add OP_CMPG to insn-selector

2009-08-03 Thread Vegard Nossum
This is a copy of OP_CMPL with a call to emulate_fcmpg instead of emulate_fcmpl. Signed-off-by: Vegard Nossum --- arch/x86/insn-selector.brg | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index

[PATCH] jato: add -Xtrace:method for single-method tracing

2009-08-03 Thread Vegard Nossum
a/nio/charset/Charset;FF[B)V' Signed-off-by: Vegard Nossum --- vm/jato.c | 148 +++-- 1 files changed, 115 insertions(+), 33 deletions(-) diff --git a/vm/jato.c b/vm/jato.c index 37ccd66..d8ebe78 100644 --- a/vm/jato.c +++ b/vm/jato.c

[PATCH] jit: add live-in/use/def/live-out set dumping to liveness analysis tracing

2009-08-03 Thread Vegard Nossum
This helped me resolve a bug, so I suppose it's useful in general. Signed-off-by: Vegard Nossum --- jit/trace-jit.c | 53 +++-- 1 files changed, 47 insertions(+), 6 deletions(-) diff --git a/jit/trace-jit.c b/jit/trace-jit.c index 8a

[PATCH] jit: fix liveness analysis

2009-08-03 Thread Vegard Nossum
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/defined. Signed-off-by: Vegard No

[PATCH] vm: add some debugging info in case of itable failure

2009-08-03 Thread Vegard Nossum
I needed this for debugging, but getting our hands on this information can be a bit subtle and tricky, so why not just leave it there for future reference. Signed-off-by: Vegard Nossum --- vm/itable.c | 20 ++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a

[PATCH] jit: add live-in/use/def/live-out set dumping to liveness analysis tracing

2009-08-03 Thread Vegard Nossum
This helped me resolve a bug, so I suppose it's useful in general. Signed-off-by: Vegard Nossum --- jit/trace-jit.c | 55 ++- 1 files changed, 50 insertions(+), 5 deletions(-) diff --git a/jit/trace-jit.c b/jit/trace-jit.c index 37

[RFC][PATCH] test: fix spill-reload-test

2009-08-03 Thread Vegard Nossum
before the first instruction. (Please double check, I have no idea why it works now and not before.) Signed-off-by: Vegard Nossum --- test/jit/spill-reload-test.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/jit/spill-reload-test.c b/test/jit/spill

[PATCH] x86: add USE_DST to INSN_ADD_IMM_REG

2009-08-03 Thread Vegard Nossum
"add imm, reg" also uses the reg, so we should put this in the use-def. Someone should probably go through the whole list to verify that the rest is correct too. Signed-off-by: Vegard Nossum --- arch/x86/use-def.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --

[PATCH] jit: fix liveness analysis

2009-07-31 Thread Vegard Nossum
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/defined. Signed-off-by: Vegard No

[PATCH 2/2] regression: add CFGCrashTest

2009-07-29 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- Makefile |1 + regression/jvm/CFGCrashTest.java | 16 regression/run-suite.sh |1 + 3 files changed, 18 insertions(+), 0 deletions(-) create mode 100644 regression/jvm/CFGCrashTest.java diff --git a

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

2009-07-29 Thread Vegard Nossum
: Vegard Nossum --- jit/basic-block.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/jit/basic-block.c b/jit/basic-block.c index c0ac458..6e8759b 100644 --- a/jit/basic-block.c +++ b/jit/basic-block.c @@ -117,6 +117,19 @@ struct basic_block *bb_split(struct

[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

  1   2   3   >