This implements emit_exception_test() on x86-64.
Signed-off-by: Eduard - Gabriel Munteanu <[email protected]>
---
arch/x86/emit-code.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 3d56581..6319b2c 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -2585,11 +2585,6 @@ emit_mov_reg_membase(struct buffer *buf, struct operand
*src,
mach_reg(&dest->base_reg), dest->disp);
}
-static void emit_exception_test(struct buffer *buf, enum machine_reg reg)
-{
- /* FIXME: implement this! */
-}
-
static void __emit_memdisp(struct buffer *buf,
int rex_w,
unsigned char opc,
@@ -2988,6 +2983,17 @@ void emit_trampoline(struct compilation_unit *cu,
jit_text_unlock();
}
+static void emit_exception_test(struct buffer *buf, enum machine_reg reg)
+{
+ /* mov fs:(0xXXX), %reg */
+ emit(buf, 0x64);
+ __emit_memdisp_reg(buf, 1, 0x8b,
+ get_thread_local_offset(&exception_guard), reg);
+
+ /* test (%reg), %reg */
+ __emit64_test_membase_reg(buf, reg, 0, reg);
+}
+
void emit_lock(struct buffer *buf, struct vm_object *obj)
{
emit_save_regparm(buf);
--
1.6.0.6
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel