-#include "vm/jit/asmpart.h"
-
-
-/* Invocation API variables ***************************************************/
-
-_Jv_JavaVM *_Jv_jvm; /* denotes a Java VM */
-
-
-#if defined(ENABLE_INTRP)
-/* dummy interpreter stack to keep the compiler happy */
-
-u1 *intrp_main_stack;
-#endif
-
-
-/* for raising exceptions from native methods *********************************/
-
-#if !defined(ENABLE_THREADS)
-java_objectheader *_no_threads_exceptionptr = NULL;
-#endif
-
-
-/* replace some non-vmcore functions ******************************************/
-
-functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
- bool isstatic)
-{
- /* return something different than NULL, otherwise we get an exception */
-
- return (functionptr) 1;
-}
-
-java_objectheader *native_new_and_init(classinfo *c) { return NULL; }
-java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s) { return NULL; }
-java_objectheader *native_new_and_init_int(classinfo *c, s4 i) { return NULL; }
-java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t) { return NULL; }
-
-
-java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
-{ return NULL; }
-
-void vm_abort(const char *text, ...)
-{
- abort();
-}
-
-/* code patching functions */
-void patcher_builtin_arraycheckcast(u1 *sp) {}
-
-#if defined(__MIPS__)
-long compare_and_swap(long *p, long oldval, long newval)
-{
- if (*p == oldval) {
- *p = newval;
- return oldval;
- } else
- return *p;
-}
-#endif
-
-
-u1 *createcompilerstub(methodinfo *m) { return NULL; }
-#if defined(ENABLE_INTRP)
-u1 *intrp_createcompilerstub(methodinfo *m) { return NULL; }
-#endif
-
-codeinfo *codegen_createnativestub(functionptr f, methodinfo *m) { return NULL; }
-
-void removecompilerstub(u1 *stub) {}
-void removenativestub(u1 *stub) {}
-
-void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop) {}
-u1* asm_initialize_thread_stack(void *func, u1 *stack) { return NULL; }
-
-void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p) { return NULL; }
-
-void asm_handle_builtin_exception(classinfo *c) {}
-void asm_abstractmethoderror(void) {}
-
-#if defined(ENABLE_JIT)
-void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out) {}
-#endif
-
-#if defined(ENABLE_INTRP)
-void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out) {}
-#endif
-
-u8 asm_get_cycle_count(void)
-{
- return 0;
-}
-
-
-void *Java_java_lang_VMObject_clone(void *env, void *clazz, void * this)
-{
- return NULL;
-}
-
-typecheck_result typeinfo_is_assignable_to_class(typeinfo *value,classref_or_classinfo dest)
-{
- return typecheck_TRUE;
-}
-
-void typeinfo_init_classinfo(typeinfo *info,classinfo *c)
-{
-}
-
-bool typeinfo_init_class(typeinfo *info,classref_or_classinfo c)
-{
- return true;
-}
-
-void typeinfo_print(FILE *file,typeinfo *info,int indent) {}
-
-void exceptions_print_exception(java_objectheader *xptr) {}
-void stacktrace_print_trace(java_objectheader *xptr) {}
-java_objectarray *stacktrace_getClassContext() { return NULL; }
-void code_free_code_of_method(methodinfo *m) {}
-
-
-/* exception functions ********************************************************/
-
-/* these should not be called */
-
-void throw_main_exception_exit(void) { assert(0); }
-void throw_exception(void) { assert(0); }
-void throw_exception_exit(void) { assert(0); }
-
-void exceptions_throw_verifyerror(methodinfo *m, const char *message)
-{
- assert(0);
-}
-
-java_objectheader *new_exception_throwable(const char *classname, java_lang_Throwable *throwable)
-{
- assert(0);
-
- /* keep compiler happy */
-
- return NULL;
-}
-
-
-void throw_cacao_exception_exit(const char *exception, const char *message, ...)
-{
- va_list ap;
-
- fprintf(stderr, "%s: ", exception);
-
- va_start(ap, message);
- vfprintf(stderr, message, ap);
- va_end(ap);
-
- fputc('\n', stderr);
-
- exit(1);
-}
-
-
-void exceptions_throw_outofmemory_exit(void)
-{
- fprintf(stderr, "java.lang.InternalError: Out of memory\n");
- exit(1);
-}
-
-
-java_objectheader *new_exception(const char *classname)
-{
- fprintf(stderr, "%s\n", classname);
- exit(1);
-
- /* keep compiler happy */
-
- return NULL;
-}
-
-
-java_objectheader *new_exception_message(const char *classname, const char *message)
-{
- fprintf(stderr, "%s: %s\n", classname, message);
- exit(1);
-
- /* keep compiler happy */
-
- return NULL;
-}
-
-
-java_objectheader *new_exception_utfmessage(const char *classname, utf *message)
-{
- fprintf(stderr, "%s: ", classname);
- utf_display_printable_ascii(message);
- fputc('\n', stderr);
-
- exit(1);
-
- /* keep compiler happy */
-
- return NULL;
-}
-
-
-java_objectheader *new_exception_javastring(const char *classname,
- java_lang_String *message)
-{
- fprintf(stderr, "%s: ", classname);
- /* TODO print message */
- fputc('\n', stderr);
-
- exit(1);
-
- /* keep compiler happy */
-
- return NULL;
-}
-
-
-void exceptions_throw_abstractmethoderror(void)
-{
- fprintf(stderr, "java.lang.AbstractMethodError\n");
-
- exit(1);
-}
-
-
-java_objectheader *new_classformaterror(classinfo *c, const char *message, ...)
-{
- va_list ap;