[RFC PATCH 7/9] x86-64: save register parameters in emit_trampoline()

2009-07-08 Thread Eduard - Gabriel Munteanu
Six registers are used on x86-64 to pass parameters to the callee and we must make sure they aren't altered by the trampoline. Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/emit-code.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/x86/emit

[RFC PATCH 8/9] x86-64: fix wrong register jump in emit_trampoline()

2009-07-08 Thread Eduard - Gabriel Munteanu
We need to jump to the address contained by REG_RAX, not REG_RDX. Signed-off-by: Eduard - Gabriel Munteanu --- 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 4099c04..ce09a45 100644 --- a/arch/x86/e

[RFC PATCH 3/9] x86: unify 32-bit and 64-bit insn selectors

2009-07-08 Thread Eduard - Gabriel Munteanu
This unifies 32-bit and 64-bit insn selectors so code working on both arches can be shared. Signed-off-by: Eduard - Gabriel Munteanu --- Makefile |2 +- arch/x86/Makefile_32 |2 +- arch/x86/Makefile_64

[RFC PATCH 6/9] x86-64: fix __emit_memdisp()

2009-07-08 Thread Eduard - Gabriel Munteanu
The instruction size passed to rip_relative() is actually constant, i.e. the size of an imm32, which is 4 bytes. That is because we have already emitted the prefix bytes and the opcode. Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/emit-code.c |7 ++- 1 files changed, 2 insertion

[RFC PATCH 9/9] (DON'T MERGE !) insn selector

2009-07-08 Thread Eduard - Gabriel Munteanu
Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/insn-selector.brg | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index ac34ec0..0ded186 100644 --- a/arch/x86/insn-selector.brg +++

[RFC PATCH 4/9] x86-64: support INSN_MOV_MEMLOCAL_REG

2009-07-08 Thread Eduard - Gabriel Munteanu
This implements the emitter for INSN_MOV_MEMLOCAL_REG. Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/emit-code.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 69db8c9..54332b9 100644 --- a/arch/x8

[RFC PATCH 5/9] Fix memory corruption in free_slot() from radix tree

2009-07-08 Thread Eduard - Gabriel Munteanu
This bug affects arches where sizeof(int) != sizeof(unsigned long). The key should be unsigned long so it doesn't get truncated. Signed-off-by: Eduard - Gabriel Munteanu --- lib/radix-tree.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/radix-tree.c b/lib/radix-

[RFC PATCH 2/9] x86-64: remove INSN32_* and INSN64_*

2009-07-08 Thread Eduard - Gabriel Munteanu
The emitters should automatically determine operand size by checking the vm_type of the variable. Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/emit-code.c| 135 --- arch/x86/include/arch/instruction.h | 31 arch/x86/use-def.c

[RFC PATCH 1/9] jit: store vm_type in struct var_info

2009-07-08 Thread Eduard - Gabriel Munteanu
x86-64 emitters need a way to determine the required operand size. We modify get_var() so it stores vm_type in struct var_info, making it available from struct operand. Signed-off-by: Eduard - Gabriel Munteanu --- arch/x86/include/arch/registers_32.h |3 + arch/x86/include/arch/registers_64

[RFC PATCH 0/9] ExitStatusIs* works, readme

2009-07-08 Thread Eduard - Gabriel Munteanu
Hi, I got ExitStatusIsZero and ExitStatusIsOne working. However, the last patch isn't finished and there are a few issues with it: 1) we need to discuss how to properly place ifdefs in the .brg 2) I need to make it pass more than one parameter correctly 3) I need to clean it up You can merge all

Re: [RFC][PATCH 5/5] vm: preliminary jar-file parsing

2009-07-08 Thread Vegard Nossum
2009/7/9 Vegard Nossum : > This provides a recursive-descent parser for the grammar of sections, > as given at: http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html > > The actual manifest parsing has still to be done. You should probably hold off on merging this. I realized while brushing my tee

[PATCH 3/5] vm: add some preliminary support for using the ConstantValue attribute

2009-07-08 Thread Vegard Nossum
Unfortunately, I was able to produce a test-case using my javac (I believe it's ecj) that actually had the ConstantValue attribute. This needs more work, obviously, but it's a start and shouldn't cause any regressions. Signed-off-by: Vegard Nossum --- vm/field.c | 85 ++

[PATCH 4/5] regression: add assertEquals() for boolean and double arguments

2009-07-08 Thread Vegard Nossum
This would be needed for the ConstantValue attribute test... Apply it if you want :-) Signed-off-by: Vegard Nossum --- regression/jvm/TestCase.java | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/regression/jvm/TestCase.java b/regression/jvm/TestCase.java in

[RFC][PATCH 5/5] vm: preliminary jar-file parsing

2009-07-08 Thread Vegard Nossum
This provides a recursive-descent parser for the grammar of sections, as given at: http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html The actual manifest parsing has still to be done. Signed-off-by: Vegard Nossum --- Makefile |1 + include/vm/jar.h |6 + vm/jar.c | 35

[PATCH 2/5] vm: add some static (class) field set/get helpers

2009-07-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/class.h | 71 ++- 1 files changed, 69 insertions(+), 2 deletions(-) diff --git a/include/vm/class.h b/include/vm/class.h index e6cb2fe..2ed5ffe 100644 --- a/include/vm/class.h +++ b/include/vm/class.h @

[PATCH 1/5] vm: constify field flag helper arguments

2009-07-08 Thread Vegard Nossum
Signed-off-by: Vegard Nossum --- include/vm/field.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vm/field.h b/include/vm/field.h index 6f0bc89..4a5a557 100644 --- a/include/vm/field.h +++ b/include/vm/field.h @@ -28,17 +28,17 @@ int vm_field_init(struct vm