* src/vm/jit/mips/codegen.c: Make it compile.
* src/vm/jit/mips/codegen.h: Added M_ALD_DSEG.
* src/vm/jit/mips/linux/md-os.c: Fixes.
* src/vm/jit/mips/md.c: Fixed includes.
* src/vm/jit/mips/md.h: Likewise.
/* src/vm/jit/mips/codegen.c - machine code generator for MIPS
- Copyright (C) 1996-2005, 2006, 2007, 2008
+ Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
#include "vm/jit/emit-common.hpp"
#include "vm/jit/jit.hpp"
#include "vm/jit/linenumbertable.hpp"
+#include "vm/jit/parse.hpp"
#include "vm/jit/patcher-common.hpp"
#include "vm/jit/reg.h"
+#include "vm/jit/stacktrace.hpp"
#include "vm/jit/trap.hpp"
-#if defined(ENABLE_LSRA)
-# include "vm/jit/allocator/lsra.h"
-#endif
-
-
-/* codegen_emit ****************************************************************
-
- Generates machine code.
-
-*******************************************************************************/
-
-bool codegen_emit(jitdata *jd)
-{
-
-
- savedregs_num = code_is_leafmethod(code) ? 0 : 1; /* space to save the RA */
-
-
-#if defined(ENABLE_THREADS)
- /* space to save argument of monitor_enter */
-
- if (checksync && code_is_synchronized(code)) {
-# if SIZEOF_VOID_P == 8
- cd->stackframesize++;
-# else
- rd->memuse++;
- cd->stackframesize += 2;
-# endif
- }
-#endif
-
- /* keep stack 16-byte aligned */
-
- if (cd->stackframesize & 1)
- cd->stackframesize++;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/**
* Generates machine code for the method prolog.
/* deallocate stack and return */
if (cd->stackframesize) {
- int32_t lo, hi;
+ int32_t lo, hi, disp;
disp = cd->stackframesize * 8;
lo = (short) (disp);
-XXX
- else {
- s1 = codegen_reg_of_dst(jd, iptr, REG_FRESULT);
- if (IS_2_WORD_TYPE(d))
- M_DMOV(REG_FRESULT, s1);
- else
- M_FMOV(REG_FRESULT, s1);
- }
- emit_store_dst(jd, iptr, s1);
- }
- break;
-
-
case ICMD_CHECKCAST: /* ..., objectref ==> ..., objectref */
if (!(iptr->flags.bits & INS_FLAG_ARRAY)) {
if ((super == NULL) || (super->flags & ACC_INTERFACE)) {
if (super == NULL) {
- constant_classref * iptr->sx.s23.s3.c.ref;
-
patcher_add_patch_ref(jd, PATCHER_instanceof_interface,
- cr, 0);
+ iptr->sx.s23.s3.c.ref, 0);
}
else {
emit_label_beqz(cd, BRANCH_LABEL_3, s1);
#define M_ALD_INTERN(a,b,disp) M_LLD_INTERN(a,b,disp)
#define M_ALD(a,b,disp) M_LLD(a,b,disp)
+#define M_ALD_DSEG(a,disp) M_LLD(a,REG_PV,disp)
#define M_AST_INTERN(a,b,disp) M_LST_INTERN(a,b,disp)
#define M_AST(a,b,disp) M_LST(a,b,disp)
#define M_AADD(a,b,c) M_LADD(a,b,c)
#define M_ALD_INTERN(a,b,disp) M_ILD_INTERN(a,b,disp)
#define M_ALD(a,b,disp) M_ILD(a,b,disp)
+#define M_ALD_DSEG(a,disp) M_ILD(a,REG_PV,disp)
#define M_AST_INTERN(a,b,disp) M_IST_INTERN(a,b,disp)
#define M_AST(a,b,disp) M_IST(a,b,disp)
#define M_AADD(a,b,c) M_IADD(a,b,c)
ucontext_t* _uc = (struct ucontext *) _p;
mcontext_t* _mc = &_uc->uc_mcontext;
- void* xpc = (void*) _mc->pc;
+ void* xpc = (void*) (_mc->pc - 4);
// Handle the trap.
trap_handle(TRAP_SIGSEGV, xpc, _p);
ucontext_t* _uc = (struct ucontext *) _p;
mcontext_t* _mc = &_uc->uc_mcontext;
- void* xpc = (void*) _mc->pc;
+ void* xpc = (void*) (_mc->pc - 4);
// Handle the trap.
trap_handle(TRAP_SIGILL, xpc, _p);
greg_t* _gregs;
int i;
- vm_abort("md_executionstate_read: PLEASE REVISE ME!");
-
_uc = (ucontext_t*) context;
_mc = &_uc->uc_mcontext;
greg_t* _gregs;
int i;
- vm_abort("md_executionstate_write: PLEASE REVISE ME!");
-
_uc = (ucontext_t *) context;
_mc = &_uc->uc_mcontext;
+#if defined(__UCLIBC__)
+ _gregs = _mc->gpregs;
+#else
+ _gregs = _mc->gregs;
+#endif
+
/* Write integer registers. */
for (i = 0; i < INT_REG_CNT; i++)
#include "config.h"
-#include <assert.h>
#include <stdint.h>
+#include <ucontext.h>
-#include "vm/types.h"
-
+#include "vm/jit/mips/codegen.h"
#include "vm/jit/mips/md.h"
-#include "vm/global.h"
-#include "vm/vm.hpp"
-
+#include "vm/jit/asmpart.h"
#include "vm/jit/jit.hpp"
+#include "vm/jit/trap.hpp"
/* md_jit_method_patch_address *************************************************
#include <assert.h>
#include <stdint.h>
-#include <unistd.h>
#include <sys/cachectl.h>
-#include "vm/types.h"
-
+#include "vm/global.h"
#include "vm/vm.hpp"
+#include "vm/jit/asmpart.h"
+#include "vm/jit/codegen-common.hpp"
/**
* Returns the size (in bytes) of the current stackframe, specified by