#include "vm/signallocal.h"
#include "vm/jit/asmpart.h"
+#include "vm/jit/executionstate.h"
#include "vm/jit/stacktrace.h"
+#include "vmcore/system.h"
+
/* md_signal_handler_sigsegv ***************************************************
#endif
-/* md_replace_executionstate_read **********************************************
+/* md_executionstate_read ******************************************************
- Read the given context into an executionstate for Replacement.
+ Read the given context into an executionstate.
*******************************************************************************/
-#if defined(ENABLE_REPLACEMENT)
-void md_replace_executionstate_read(executionstate_t *es, void *context)
+void md_executionstate_read(executionstate_t *es, void *context)
{
ucontext_t *_uc;
mcontext_t *_mc;
- s4 i;
+ int i;
_uc = (ucontext_t *) context;
_mc = &_uc->uc_mcontext;
* the _mc->sc_fpregs[i] can cause invalid conversions. */
assert(sizeof(_mc->sc_fpregs) == sizeof(es->fltregs));
- memcpy(&es->fltregs, &_mc->sc_fpregs, sizeof(_mc->sc_fpregs));
+ system_memcpy(&es->fltregs, &_mc->sc_fpregs, sizeof(_mc->sc_fpregs));
}
-#endif
-/* md_replace_executionstate_write *********************************************
+/* md_executionstate_write *****************************************************
- Write the given executionstate back to the context for Replacement.
+ Write the given executionstate back to the context.
*******************************************************************************/
-#if defined(ENABLE_REPLACEMENT)
-void md_replace_executionstate_write(executionstate_t *es, void *context)
+void md_executionstate_write(executionstate_t *es, void *context)
{
ucontext_t *_uc;
mcontext_t *_mc;
- s4 i;
+ int i;
_uc = (ucontext_t *) context;
_mc = &_uc->uc_mcontext;
* the _mc->sc_fpregs[i] can cause invalid conversions. */
assert(sizeof(_mc->sc_fpregs) == sizeof(es->fltregs));
- memcpy(&_mc->sc_fpregs, &es->fltregs, sizeof(_mc->sc_fpregs));
+ system_memcpy(&_mc->sc_fpregs, &es->fltregs, sizeof(_mc->sc_fpregs));
/* write special registers */
_mc->sc_pc = (ptrint) es->pc;
_mc->sc_regs[REG_PV] = (ptrint) es->pv;
_mc->sc_regs[REG_RA] = (ptrint) es->ra;
}
-#endif
/* md_critical_section_restart *************************************************