This method was always arch-specific anyway, and now we need to call it
from emit-code.c anyway.

Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 arch/x86/emit-code.c           |   20 ++++++++++++++++++++
 arch/x86/include/arch/itable.h |   10 ++++++++++
 vm/itable.c                    |   22 ++--------------------
 3 files changed, 32 insertions(+), 20 deletions(-)
 create mode 100644 arch/x86/include/arch/itable.h

diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index a0b85e0..695b588 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -21,11 +21,13 @@
 #include "lib/list.h"
 #include "lib/buffer.h"
 
+#include "vm/backtrace.h"
 #include "vm/method.h"
 #include "vm/object.h"
 
 #include "arch/init.h"
 #include "arch/instruction.h"
+#include "arch/itable.h"
 #include "arch/memory.h"
 #include "arch/stack-frame.h"
 #include "arch/thread.h"
@@ -2023,6 +2025,24 @@ void emit_jni_trampoline(struct buffer *buf, struct 
vm_method *vmm,
        jit_text_unlock();
 }
 
+/* The regparm(1) makes GCC get the first argument from %ecx and the rest
+ * from the stack. This is convenient, because we use %ecx for passing the
+ * hidden "method" parameter. Interfaces are invoked on objects, so we also
+ * always get the object in the first stack parameter. */
+void __attribute__((regparm(1)))
+itable_resolver_stub_error(struct vm_method *method, struct vm_object *obj)
+{
+       fprintf(stderr, "itable resolver stub error!\n");
+       fprintf(stderr, "invokeinterface called on method %s.%s%s "
+               "(itable index %d)\n",
+               method->class->name, method->name, method->type,
+               method->itable_index);
+       fprintf(stderr, "object class %s\n", obj->class->name);
+
+       print_trace();
+       abort();
+}
+
 /* Note: a < b, always */
 static void emit_itable_bsearch(struct buffer *buf,
        struct itable_entry **table, unsigned int a, unsigned int b)
diff --git a/arch/x86/include/arch/itable.h b/arch/x86/include/arch/itable.h
new file mode 100644
index 0000000..7824cf2
--- /dev/null
+++ b/arch/x86/include/arch/itable.h
@@ -0,0 +1,10 @@
+#ifndef ARCH_X86_ITABLE_H
+#define ARCH_X86_ITABLE_H
+
+struct vm_method;
+struct vm_object;
+
+void __attribute__((regparm(1)))
+itable_resolver_stub_error(struct vm_method *method, struct vm_object *obj);
+
+#endif
diff --git a/vm/itable.c b/vm/itable.c
index bf38d6b..88b80d0 100644
--- a/vm/itable.c
+++ b/vm/itable.c
@@ -39,6 +39,8 @@
 #include "vm/method.h"
 #include "vm/trace.h"
 
+#include "arch/itable.h"
+
 bool opt_trace_itable;
 
 static uint32_t itable_hash_string(const char *str)
@@ -119,26 +121,6 @@ static int itable_add_entries(struct vm_class *vmc, struct 
list_head *itable)
        return 0;
 }
 
-/* The regparm(1) makes GCC get the first argument from %ecx and the rest
- * from the stack. This is convenient, because we use %ecx for passing the
- * hidden "method" parameter. Interfaces are invoked on objects, so we also
- * always get the object in the first stack parameter.
- *
- * XXX: This is arch-specific (x86_32) code, should do something else here. */
-static void __attribute__((regparm(1)))
-itable_resolver_stub_error(struct vm_method *method, struct vm_object *obj)
-{
-       fprintf(stderr, "itable resolver stub error!\n");
-       fprintf(stderr, "invokeinterface called on method %s.%s%s "
-               "(itable index %d)\n",
-               method->class->name, method->name, method->type,
-               method->itable_index);
-       fprintf(stderr, "object class %s\n", obj->class->name);
-
-       print_trace();
-       abort();
-}
-
 static int itable_entry_compare(const void *a, const void *b)
 {
        const struct itable_entry *ae = *(const struct itable_entry **) a;
-- 
1.6.0.4


------------------------------------------------------------------------------
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
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to