/*
* This flag controls whenever the runtime uses LLVM compiled code.
* Enabling this causes different/slower code paths to be used, which is why it
- * defaults to FALSE if ENABLE_LLVM is not defined, i.e. the runtime is only capable of
- * running AOT code compiled by LLVM.
+ * defaults to FALSE.
* Changes when this flag is set include:
* - a per method vtable trampoline is used to handle virtual calls, instead of only
* one trampoline.
{
return mono_jump_info_token_new2 (mp, image, token, NULL);
}
+
+/*
+ * mono_tramp_info_create:
+ *
+ * Create a MonoTrampInfo structure from the arguments. This function assumes ownership
+ * of NAME, JI, and UNWIND_OPS.
+ */
+MonoTrampInfo*
+mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops)
+{
+ MonoTrampInfo *info = g_new0 (MonoTrampInfo, 1);
+
+ info->name = (char*)name;
+ info->code = code;
+ info->code_size = code_size;
+ info->ji = ji;
+ info->unwind_ops = unwind_ops;
+
+ return info;
+}
+
+void
+mono_tramp_info_free (MonoTrampInfo *info)
+{
+ g_free (info->name);
+
+ // FIXME: ji + unwind_ops
+}
#define MONO_INIT_VARINFO(vi,id) do { \
(vi)->range.first_use.pos.bid = 0xffff; \
mono_decompose_array_access_opts (cfg);
if (cfg->got_var) {
+#ifndef MONO_ARCH_GOT_REG
GList *regs;
+#endif
+ int got_reg;
g_assert (cfg->got_var_allocated);
* branches problem. Testcase: mcs crash in
* System.MonoCustomAttrs:GetCustomAttributes.
*/
+#ifdef MONO_ARCH_GOT_REG
+ got_reg = MONO_ARCH_GOT_REG;
+#else
regs = mono_arch_get_global_int_regs (cfg);
g_assert (regs);
+ got_reg = GPOINTER_TO_INT (regs->data);
+ g_list_free (regs);
+#endif
cfg->got_var->opcode = OP_REGVAR;
- cfg->got_var->dreg = GPOINTER_TO_INT (regs->data);
+ cfg->got_var->dreg = got_reg;
cfg->used_int_regs |= 1LL << cfg->got_var->dreg;
-
- g_list_free (regs);
}
/*
}
if ((cfg->opt & MONO_OPT_LINEARS) && !cfg->globalra) {
- GList *vars, *regs;
+ GList *vars, *regs, *l;
/* fixme: maybe we can avoid to compute livenesss here if already computed ? */
cfg->comp_done &= ~MONO_COMP_LIVENESS;
if ((vars = mono_arch_get_allocatable_int_vars (cfg))) {
regs = mono_arch_get_global_int_regs (cfg);
- if (cfg->got_var)
- regs = g_list_delete_link (regs, regs);
+ /* Remove the reg reserved for holding the GOT address */
+ if (cfg->got_var) {
+ for (l = regs; l; l = l->next) {
+ if (GPOINTER_TO_UINT (l->data) == cfg->got_var->dreg) {
+ regs = g_list_delete_link (regs, l);
+ break;
+ }
+ }
+ }
mono_linear_scan (cfg, vars, regs, &cfg->used_int_regs);
}
}
}
if (prof_options & MONO_PROFILE_JIT_COMPILATION) {
- if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
- /* The profiler doesn't know about wrappers, so pass the original icall method */
- mono_profiler_method_end_jit (mono_marshal_method_from_wrapper (method), jinfo, MONO_PROFILE_OK);
- else
+ if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) {
+ if (mono_marshal_method_from_wrapper (method)) {
+ /* Native func wrappers have no method */
+ /* The profiler doesn't know about wrappers, so pass the original icall method */
+ mono_profiler_method_end_jit (mono_marshal_method_from_wrapper (method), jinfo, MONO_PROFILE_OK);
+ }
+ } else {
mono_profiler_method_end_jit (method, jinfo, MONO_PROFILE_OK);
+ }
}
mono_runtime_class_init (vtable);