trap handling.
* src/vm/jit/i386/darwin/md-os.c: Simplified signal handlers.
* src/vm/jit/i386/linux/md-os.c: Likewise.
* src/vm/jit/i386/solaris/md-os.c: Likewise.
intptr_t val;
int type;
void *p;
- java_object_t *o;
_uc = (ucontext_t *) _p;
_mc = _uc->uc_mcontext;
/* Set registers. */
if (type == TRAP_COMPILER) {
- if (p == NULL) {
- o = builtin_retrieve_exception();
-
+ if (p == NULL) {
_ss->__esp = (uintptr_t) sp; /* Remove RA from stack. */
-
- _ss->__eax = (uintptr_t) o;
- _ss->__ecx = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _ss->__eip = (uintptr_t) asm_handle_exception;
}
- else {
- _ss->__eip = (uintptr_t) p;
- }
- }
- else {
- _ss->__eax = (uintptr_t) p;
- _ss->__ecx = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _ss->__eip = (uintptr_t) asm_handle_exception;
}
}
u1 *xpc;
int type;
intptr_t val;
- void *p;
_uc = (ucontext_t *) _p;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- _ss->__eax = (uintptr_t) p;
- _ss->__ecx = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _ss->__eip = (uintptr_t) asm_handle_exception;
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
u1 *xpc;
int type;
intptr_t val;
- void *p;
_uc = (ucontext_t *) _p;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- if (p != NULL) {
- _ss->__eax = (uintptr_t) p;
- _ss->__ecx = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _ss->__eip = (uintptr_t) asm_handle_exception;
- }
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
/* md_executionstate_read ******************************************************
ptrint val;
s4 type;
void *p;
- java_object_t *o;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
if (type == TRAP_COMPILER) {
if (p == NULL) {
- o = builtin_retrieve_exception();
-
_mc->gregs[REG_ESP] = (uintptr_t) sp; /* Remove RA from stack. */
-
- _mc->gregs[REG_EAX] = (uintptr_t) o;
- _mc->gregs[REG_ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[REG_EIP] = (uintptr_t) asm_handle_exception;
- }
- else {
- _mc->gregs[REG_EIP] = (uintptr_t) p;
}
}
-#if defined(ENABLE_REPLACEMENT)
- else if (type == TRAP_COUNTDOWN) {
- /* context has been written by md_replace_executionstate_write */
- }
-#endif
- else {
- _mc->gregs[REG_EAX] = (uintptr_t) p;
- _mc->gregs[REG_ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[REG_EIP] = (uintptr_t) asm_handle_exception;
- }
}
u1 *xpc;
s4 type;
ptrint val;
- void *p;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- _mc->gregs[REG_EAX] = (uintptr_t) p;
- _mc->gregs[REG_ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[REG_EIP] = (uintptr_t) asm_handle_exception;
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
u1 *xpc;
s4 type;
ptrint val;
- void *p;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- if (p != NULL) {
- _mc->gregs[REG_EAX] = (uintptr_t) p;
- _mc->gregs[REG_ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[REG_EIP] = (uintptr_t) asm_handle_exception;
- }
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
ptrint val;
s4 type;
void *p;
- java_object_t *o;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
if (type == TRAP_COMPILER) {
if (p == NULL) {
- o = builtin_retrieve_exception();
-
_mc->gregs[ESP] = (uintptr_t) sp; /* Remove RA from stack. */
-
- _mc->gregs[EAX] = (uintptr_t) o;
- _mc->gregs[ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[EIP] = (uintptr_t) asm_handle_exception;
- }
- else {
- _mc->gregs[EIP] = (uintptr_t) p;
}
}
- else {
- _mc->gregs[EAX] = (uintptr_t) p;
- _mc->gregs[ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[EIP] = (uintptr_t) asm_handle_exception;
- }
}
u1 *xpc;
s4 type;
ptrint val;
- void *p;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- _mc->gregs[EAX] = (uintptr_t) p;
- _mc->gregs[ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[EIP] = (uintptr_t) asm_handle_exception;
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
u1 *xpc;
s4 type;
ptrint val;
- void *p;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
/* Handle the trap. */
- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- if (p != NULL) {
- _mc->gregs[EAX] = (uintptr_t) p;
- _mc->gregs[ECX] = (uintptr_t) xpc; /* REG_ITMP2_XPC */
- _mc->gregs[EIP] = (uintptr_t) asm_handle_exception;
- }
+ trap_handle(type, val, pv, sp, ra, xpc, _p);
}
o = NULL;
m = NULL;
-#if defined(__X86_64__)
+#if defined(__I386__) || defined(__X86_64__)
# if !defined(NDEBUG)
/* Perform a sanity check on our execution state functions. */
stacktrace_stackframeinfo_remove(&sfi);
-#if defined(__X86_64__)
+#if defined(__I386__) || defined(__X86_64__)
/* Update execution state and write it back to the current context. */
/* AFTER: removing stackframeinfo */