* Returns a pointer to a method which restores a previously saved sigcontext.
*/
gpointer
-mono_arch_get_restore_context (void)
+mono_arch_get_restore_context_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot)
{
static guint8 *start = NULL;
static gboolean inited = FALSE;
/* restore_contect (MonoContext *ctx) */
+ *ji = NULL;
+
start = code = mono_global_codeman_reserve (256);
amd64_mov_reg_reg (code, AMD64_R11, AMD64_ARG_REG1, 8);
/* jump to the saved IP */
amd64_jump_reg (code, AMD64_R11);
+ mono_arch_flush_icache (start, code - start);
+
+ *code_size = code - start;
+
inited = TRUE;
return start;
* @exc object in this case).
*/
gpointer
-mono_arch_get_call_filter (void)
+mono_arch_get_call_filter_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot)
{
static guint8 *start;
static gboolean inited = FALSE;
if (inited)
return start;
+ *ji = NULL;
+
start = code = mono_global_codeman_reserve (128);
/* call_filter (MonoContext *ctx, unsigned long eip) */
g_assert ((code - start) < 128);
+ mono_arch_flush_icache (start, code - start);
+
+ *code_size = code - start;
+
inited = TRUE;
return start;
MonoContext ctx;
if (!restore_context)
- restore_context = mono_arch_get_restore_context ();
+ restore_context = mono_get_restore_context ();
ctx.rsp = rsp;
ctx.rip = rip;
amd64_call_reg (code, AMD64_R11);
amd64_breakpoint (code);
+ mono_arch_flush_icache (start, code - start);
+
g_assert ((code - start) < 64);
return start;
*
*/
gpointer
-mono_arch_get_throw_exception (void)
+mono_arch_get_throw_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot)
{
static guint8* start;
static gboolean inited = FALSE;
}
gpointer
-mono_arch_get_rethrow_exception (void)
+mono_arch_get_rethrow_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot)
{
static guint8* start;
static gboolean inited = FALSE;
/* Not used on amd64 */
amd64_breakpoint (code);
+ mono_arch_flush_icache (start, code - start);
+
return start;
}
/* Put the throw_ip at the top of the misaligned stack */
amd64_push_reg (code, AMD64_ARG_REG3);
- throw_ex = (guint64)mono_arch_get_throw_exception ();
+ throw_ex = (guint64)mono_get_throw_exception ();
/* Call throw_exception */
amd64_mov_reg_reg (code, AMD64_ARG_REG1, AMD64_RAX, 8);
g_assert ((code - start) < 64);
+ mono_arch_flush_icache (start, code - start);
+
inited = TRUE;
return start;
void (*restore_context) (MonoContext *);
MonoContext mctx;
- restore_context = mono_arch_get_restore_context ();
+ restore_context = mono_get_restore_context ();
mono_arch_sigctx_to_monoctx (sigctx, &mctx);
mono_handle_exception (&mctx, obj, MONO_CONTEXT_GET_IP (&mctx), FALSE);
if (stack_ovf)
amd64_push_reg (code, AMD64_RAX);
/* Call the throw trampoline */
- throw_trampoline = mono_arch_get_throw_exception ();
+ throw_trampoline = mono_get_throw_exception ();
amd64_mov_reg_imm (code, AMD64_R11, throw_trampoline);
/* We use a jump instead of a call so we can push the original ip on the stack */
amd64_jump_reg (code, AMD64_R11);