This fixes an issue where state->reg1 wasn't properly set on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg |6 --
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
index b32fedf..5ef161
This fixes the improper passing of arguments to fixup_vtable() from
within trampolines.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 10 +++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 5b3ab70..f
This refactoring introduces a general mechanism usable by other arches
to provide argument passing in registers. Developers of other arches
where this applies need only write a parser that allocates registers for
arguments. The additional code and data structure support is controlled
by CONFIG_ARGS
This fixes the handling of EXPR_NEW, to make it suitable on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg | 23 ++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
inde
We use GPR_VM_TYPE instead of J_INT, because the former expands to
J_LONG on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
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 bf8
This implements the emitter for INSN_CALL_REG.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 11 +++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index a1f0f3c..47bd429 100644
--- a/arch/x86/emit-code.
There's no 64-bit operand size imm->membase move instruction on x86-64.
Therefore, we first do an imm->reg move, then a reg->membase move.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c|8 +++
arch/x86/include/arch/instruction.h |1 +
arch/x86/insn-sele
This makes vm_native_call() a stub which will be properly implemented
later.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/include/arch/call.h |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/arch/call.h b/arch/x86/include/arch/call.h
index abba90
This implements the rest of the emitters for INSN_*_THREAD_LOCAL_*,
where this is useful on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 40
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-cod
We shouldn't alter the tree from the instruction selector. Instead, we
should implement copy propagation later.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg | 11 +++
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/
This implements emitters for INSN_CMP_* instructions.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 38 ++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 46c586a..c54f42
This fixes the implementation of newarray selectors on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg | 43 ++-
1 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-se
This implements the emitter for INSN_MOV_THREAD_LOCAL_MEMDISP_REG.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 11 +++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index c54f428..c9bdae4 100644
--- a
This implements emitters for INSN_MOV_REG_MEMDISP.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 19 +++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 5a5d006..46c586a 100644
--- a/arch/x8
This fixes problems encountered with passing arguments in case of JNI.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/args.c | 14 ++
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/x86/args.c b/arch/x86/args.c
index c52f3cd..5b5a740 100644
--- a/arch/x8
On x86-64 we can use 64-bit operands directly, unlike on x86-32.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg | 201 ++--
1 files changed, 64 insertions(+), 137 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/in
We reuse the existing code for parsing the vm_method->type string.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/args.c| 22 +++---
include/vm/types.h |1 +
vm/types.c |2 +-
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/arch/x86/ar
J_LONG values should be returned in a 64-bit register on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/insn-selector.brg | 18 ++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
index 184874
This implements the emitter for INSN_MOV_REG_MEMLOCAL.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 40
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 2f1a810..5a5
This implements the emitter for INSN_MOV_MEMDISP_REG.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/emit-code.c | 10 ++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index c9bdae4..239d91a 100644
--- a/arch/x86/emit
On x86-64, GCC disables frame pointers at optimization levels beyond
-O0. This works correctly for debuggers such as GDB because they use
debugging information available by default on x86-64. But stack
traversal code within Jato no longer works, so we prevent disabling
frame pointers at any optimiz
This makes the function a stub which will be actually implemented later.
Signed-off-by: Eduard - Gabriel Munteanu
---
arch/x86/include/arch/call.h |3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/arch/call.h b/arch/x86/include/arch/call.h
index bc9e9ec.
This is needed for native stack trace printing
Signed-off-by: Tomek Grabiec
---
vm/call.c |5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/vm/call.c b/vm/call.c
index 6041494..11c9dca 100644
--- a/vm/call.c
+++ b/vm/call.c
@@ -64,9 +64,10 @@ vm_call_method_a(struct vm
Signed-off-by: Tomek Grabiec
---
vm/stack-trace.c |6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/vm/stack-trace.c b/vm/stack-trace.c
index 30c0595..4e9638b 100644
--- a/vm/stack-trace.c
+++ b/vm/stack-trace.c
@@ -162,6 +162,9 @@ static int get_caller_stack_trace_el
If bottom_stack_frame is not NULL and stack walker is called
from outside main() function then it could loop forever.
Stack walker can be called in the future outside main() to print the stack
trace.
Signed-off-by: Tomek Grabiec
---
vm/jato.c |2 ++
1 files changed, 2 insertions(+), 0 deleti
also rename throw_exception_from_trampoline() to throw_from_trampoline()
and throw_exception_from_signal() to throw_from_signal().
Signed-off-by: Tomek Grabiec
---
arch/x86/exception.c|8
arch/x86/unwind_32.S|2 +-
arch/x86/unwind_64.S|2 +-
include/jit/exception
Signed-off-by: Tomek Grabiec
---
include/vm/stack-trace.h | 20 +
vm/jato.c|4 ++-
vm/stack-trace.c | 69 ++---
3 files changed, 57 insertions(+), 36 deletions(-)
diff --git a/include/vm/stack-trace.h b/include/
When vm_print_exception() is called from JNI then exception
that is printed is signalled. Therefore we have to clear exceptions
before printing to be able to detect when exception is thrown
from printing code.
Signed-off-by: Tomek Grabiec
---
vm/stack-trace.c |7 +++
1 files changed, 7 i
It is more natural behavior to reserve the space before writing
to it.
Signed-off-by: Tomek Grabiec
---
arch/x86/insn-selector.brg | 36
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg
Signed-off-by: Tomek Grabiec
---
include/vm/call.h | 31 ++-
vm/call.c | 12
2 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/include/vm/call.h b/include/vm/call.h
index c1ed6bd..557fb86 100644
--- a/include/vm/call.h
+++ b/inc
The ->addr can be set from the return address of ->vm_frame.
This makes ->addr field set for all types of stack trace elements.
Signed-off-by: Tomek Grabiec
---
vm/stack-trace.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/vm/stack-trace.c b/vm/stack-trace.c
index
This is needed to print trampoline's method signature in stack trace.
Signed-off-by: Tomek Grabiec
---
jit/trampoline.c |8 ++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/jit/trampoline.c b/jit/trampoline.c
index ba1a495..880a899 100644
--- a/jit/trampoline.c
+++ b/j
Making it a macro rules out the risk of using __builtin_frame_address().
When __builtin_frame_address() is used in a function it is possible
that a call to it will be optimized so that new frame is not created.
Signed-off-by: Tomek Grabiec
---
include/vm/signal.h | 16
test/
Signed-off-by: Tomek Grabiec
---
vm/method.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/vm/method.c b/vm/method.c
index eb618f2..37bd54d 100644
--- a/vm/method.c
+++ b/vm/method.c
@@ -95,6 +95,9 @@ int vm_method_init(struct vm_method *vmm,
/* Hm, w
Backtrace is now printed using the VM stack walker. One advantage of
this is that it can recognize JIT, trampoline, VM native and JNI
frames. JIT frames have different format than native frames - return
address is misplaced so the stamdard backtrace() doesn't work with jit
frames involved.
Example
Signed-off-by: Tomek Grabiec
---
vm/stack-trace.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/vm/stack-trace.c b/vm/stack-trace.c
index 3d8b723..81ca7aa 100644
--- a/vm/stack-trace.c
+++ b/vm/stack-trace.c
@@ -306,6 +306,9 @@ void init_stack_trace_elem_current(stru
Signed-off-by: Tomek Grabiec
---
vm/jato.c |7 +--
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index 636f6a9..6aa3854 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -736,12 +736,7 @@ main(int argc, char *argv[])
out_check_exception:
if (exce
It is unnecessary to clear exception prior to signaling
since signaling overrides any pending exception.
Signed-off-by: Tomek Grabiec
---
vm/class.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/vm/class.c b/vm/class.c
index 915e5e0..a96f1b6 100644
--- a/vm/class.c
+++
This function can be replaced by signal bottom half with throw_from_signal_bh()
call. Less code increases maintainability.
Signed-off-by: Tomek Grabiec
---
arch/x86/exception.c| 21 -
include/jit/exception.h |1 -
vm/signal.c |7 ++-
3 files chan
function_name might be NULL even if bfd_find_nearest_line()
returned value != 0.
Signed-off-by: Tomek Grabiec
---
arch/x86/backtrace.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/backtrace.c b/arch/x86/backtrace.c
index 6b2dde4..9fd28b4 100644
--- a/arch/x
Signed-off-by: Tomek Grabiec
---
include/jit/emit-code.h |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/jit/emit-code.h b/include/jit/emit-code.h
index c9cf8ee..f08bee6 100644
--- a/include/jit/emit-code.h
+++ b/include/jit/emit-code.h
@@ -40,7 +40,5 @@ extern
In general we should use vm_call_method() to call methods from VM. Calling
methods from VM is not only about calling native function, but we
also have to save any pending exceptions before that. Besides that, using
vm_call_method() increases maintainability.
Calling methods by getting trampoline a
Signed-off-by: Tomek Grabiec
---
vm/call.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/vm/call.c b/vm/call.c
index 718917e..6041494 100644
--- a/vm/call.c
+++ b/vm/call.c
@@ -48,9 +48,9 @@ vm_call_method_a(struct vm_method *method, unsigned long
*args)
Signed-off-by: Tomek Grabiec
---
vm/jni-interface.c |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/vm/jni-interface.c b/vm/jni-interface.c
index 6a5488c..07cfaa4 100644
--- a/vm/jni-interface.c
+++ b/vm/jni-interface.c
@@ -262,8 +262,6 @@ vm_jni_call_static_void_method
44 matches
Mail list logo