#include "vm/jit/s390/md-abi.h"
-#include "threads/threads-common.h"
+#include "threads/thread.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
+
#include "vm/jit/asmpart.h"
#include "vm/jit/abi.h"
+#include "vm/jit/executionstate.h"
#include "vm/jit/methodheader.h"
#include "vm/jit/methodtree.h"
#include "vm/jit/stacktrace.h"
+#include "vm/jit/trap.h"
#if !defined(NDEBUG) && defined(ENABLE_DISASSEMBLER)
#include "vmcore/options.h" /* XXX debug */
m = (*(codeinfo **)(pv + CodeinfoPointer))->m;
log_println(
"Java method: class %s, method %s, descriptor %s.",
- m->class->name->text, m->name->text, m->descriptor->text
+ m->clazz->name->text, m->name->text, m->descriptor->text
);
}
log_println("\tf%d\t0x%016llX\t(double)%e\t(float)%f", i, freg.l, freg.fr.d, freg.fr.f);
}
-#if defined(ENABLE_THREADS)
log_println("Dumping the current stacktrace:");
- threads_print_stacktrace();
-#endif
-
+ stacktrace_print_current();
}
/* md_signal_handler_sigsegv ***************************************************
pv = (u1 *)_mc->gregs[REG_PV] - N_PV_OFFSET;
sp = (u1 *)_mc->gregs[REG_SP];
ra = xpc;
- type = EXCEPTION_HARDWARE_NULLPOINTER;
+ type = TRAP_NullPointerException;
val = 0;
- /* Handle the type. */
+ /* Handle the trap. */
- p = signal_handle(type, val, pv, sp, ra, xpc, _p);
+ p = trap_handle(type, val, pv, sp, ra, xpc, _p);
if (p != NULL) {
- _mc->gregs[REG_ITMP3_XPTR] = (intptr_t) p;
- _mc->gregs[REG_ITMP1_XPC] = (intptr_t) xpc;
- _mc->psw.addr = (intptr_t) asm_handle_exception;
+ _mc->gregs[REG_ITMP3_XPTR] = (uintptr_t) p;
+ _mc->gregs[REG_ITMP1_XPC] = (uintptr_t) xpc;
+ _mc->psw.addr = (uintptr_t) asm_handle_exception;
}
else {
- _mc->psw.addr = (intptr_t) xpc;
+ _mc->psw.addr = (uintptr_t) xpc;
}
}
sp = (u1 *)_mc->gregs[REG_SP];
val = (ptrint)_mc->gregs[reg];
- if (EXCEPTION_HARDWARE_COMPILER == type) {
+ if (TRAP_COMPILER == type) {
/* The PV from the compiler stub is equal to the XPC. */
pv = xpc;
xpc = ra - 2;
}
- /* Handle the type. */
+ /* Handle the trap. */
- p = signal_handle(type, val, pv, sp, ra, xpc, _p);
+ p = trap_handle(type, val, pv, sp, ra, xpc, _p);
- if (EXCEPTION_HARDWARE_COMPILER == type) {
+ if (TRAP_COMPILER == type) {
if (NULL == p) {
- _mc->gregs[REG_ITMP3_XPTR] = (intptr_t) builtin_retrieve_exception();
- _mc->gregs[REG_ITMP1_XPC] = (intptr_t) ra - 2;
- _mc->gregs[REG_PV] = (intptr_t) md_codegen_get_pv_from_pc(ra);
- _mc->psw.addr = (intptr_t) asm_handle_exception;
+ _mc->gregs[REG_ITMP3_XPTR] = (uintptr_t) builtin_retrieve_exception();
+ _mc->gregs[REG_ITMP1_XPC] = (uintptr_t) ra - 2;
+ _mc->gregs[REG_PV] = (uintptr_t) md_codegen_get_pv_from_pc(ra);
+ _mc->psw.addr = (uintptr_t) asm_handle_exception;
} else {
- _mc->gregs[REG_PV] = (intptr_t) p;
- _mc->psw.addr = (intptr_t) p;
+ _mc->gregs[REG_PV] = (uintptr_t) p;
+ _mc->psw.addr = (uintptr_t) p;
}
} else {
if (p != NULL) {
- _mc->gregs[REG_ITMP3_XPTR] = (intptr_t) p;
- _mc->gregs[REG_ITMP1_XPC] = (intptr_t) xpc;
- _mc->psw.addr = (intptr_t) asm_handle_exception;
+ _mc->gregs[REG_ITMP3_XPTR] = (uintptr_t) p;
+ _mc->gregs[REG_ITMP1_XPC] = (uintptr_t) xpc;
+ _mc->psw.addr = (uintptr_t) asm_handle_exception;
}
else {
- _mc->psw.addr = (intptr_t) xpc;
+ _mc->psw.addr = (uintptr_t) xpc;
}
}
} else {
sp = (u1 *)_mc->gregs[REG_SP];
ra = xpc;
- type = EXCEPTION_HARDWARE_ARITHMETIC;
+ type = TRAP_ArithmeticException;
val = 0;
- /* Handle the type. */
+ /* Handle the trap. */
- p = signal_handle(type, val, pv, sp, ra, xpc, _p);
+ p = trap_handle(type, val, pv, sp, ra, xpc, _p);
- _mc->gregs[REG_ITMP3_XPTR] = (intptr_t) p;
- _mc->gregs[REG_ITMP1_XPC] = (intptr_t) xpc;
- _mc->psw.addr = (intptr_t) asm_handle_exception;
+ _mc->gregs[REG_ITMP3_XPTR] = (uintptr_t) p;
+ _mc->gregs[REG_ITMP1_XPC] = (uintptr_t) xpc;
+ _mc->psw.addr = (uintptr_t) asm_handle_exception;
return;
}
#endif
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
+/**
+ * Read the given context into an executionstate.
+ *
+ * @param es execution state
+ * @param context machine context
+ */
+void md_executionstate_read(executionstate_t* es, void* context)
{
- mcontext_t *_mc;
- u1 *pc;
- void *npc;
-
- _mc = &_uc->uc_mcontext;
-
- pc = (u1 *)_mc->psw.addr;
+ vm_abort("md_executionstate_read: IMPLEMENT ME!");
+}
- npc = critical_find_restart_point(pc);
- if (npc != NULL) {
- log_println("%s: pc=%p, npc=%p", __FUNCTION__, pc, npc);
- _mc->psw.addr = (ptrint) npc;
- }
+/**
+ * Write the given executionstate back to the context.
+ *
+ * @param es execution state
+ * @param context machine context
+ */
+void md_executionstate_write(executionstate_t* es, void* context)
+{
+ vm_abort("md_executionstate_write: IMPLEMENT ME!");
}
-#endif
/* md_jit_method_patch_address *************************************************