#include "md.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/avl.h"
#include "toolbox/list.hpp"
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
#include "native/llni.h"
-#include "native/localref.h"
-#include "native/native.h"
+#include "native/localref.hpp"
+#include "native/native.hpp"
#include "threads/thread.hpp"
#include "vm/jit/builtin.hpp"
#include "vm/exceptions.hpp"
-#include "vm/method.h"
+#include "vm/method.hpp"
#include "vm/options.h"
#include "vm/string.hpp"
#include <vmlog_cacao.h>
#endif
-#include "show.h"
+#include "show.hpp"
/* codegen_init ****************************************************************
/* initialize members */
- cd->flags = 0;
+ // Set flags as requested.
+ if (opt_AlwaysEmitLongBranches) {
+ cd->flags = CODEGENDATA_FLAG_LONGBRANCHES;
+ }
+ else {
+ cd->flags = 0;
+ }
cd->mcodebase = (u1*) DumpMemory::allocate(MCODEINITSIZE);
cd->mcodeend = cd->mcodebase + MCODEINITSIZE;
/* MIPS always uses 8 bytes to store the RA */
datasp = sp + framesize - 8;
javasp = sp + framesize;
+# if SIZEOF_VOID_P == 8
+ arg_regs = (uint64_t *) sp;
+# else
+ arg_regs = (uint64_t *) (sp + 5 * 8);
+# endif
+ arg_stack = (uint64_t *) javasp;
#elif defined(__S390__)
datasp = sp + framesize - 8;
javasp = sp + framesize;
#endif
#if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
/* print the call-trace if necesarry */
/* BEFORE: filling the local reference table */
#elif defined(__MIPS__)
/* MIPS always uses 8 bytes to store the RA */
datasp = sp + framesize - 8;
+# if SIZEOF_VOID_P == 8
+ ret_regs = (uint64_t *) sp;
+# else
+ ret_regs = (uint64_t *) (sp + 1 * 8);
+# endif
#elif defined(__S390__)
datasp = sp + framesize - 8;
ret_regs = (uint64_t *) (sp + 96);
#endif
#if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
/* print the call-trace if necesarry */
/* AFTER: unwrapping the return value */