Branch: refs/heads/master
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/4e6c494b3066...f62ffb9b892a
Commit: fb4dd485c9ef8aa08c2989534a263b5b80720e33
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 10:42:37 GMT
URL: https://github.com/mono/mono/commit/fb4dd485c9ef8aa08c2989534a263b5b80720e33
[runtime] Use a cache in mono_create_rgctx_lazy_fetch_trampoline () in the full-aot case as well.
Changed paths:
M mono/mini/mini-trampolines.c
Modified: mono/mini/mini-trampolines.c
===================================================================
@@ -1517,9 +1517,6 @@
gpointer tramp, ptr;
- if (mono_aot_only)
- return mono_aot_get_lazy_fetch_trampoline (offset);
-
mono_trampolines_lock ();
if (rgctx_lazy_fetch_trampoline_hash)
tramp = g_hash_table_lookup (rgctx_lazy_fetch_trampoline_hash, GUINT_TO_POINTER (offset));
@@ -1529,14 +1526,18 @@
if (tramp)
return tramp;
- tramp = mono_arch_create_rgctx_lazy_fetch_trampoline (offset, &info, FALSE);
- if (info) {
- mono_save_trampoline_xdebug_info (info);
- if (mono_jit_map_is_enabled ())
- mono_emit_jit_tramp (info->code, info->code_size, info->name);
- mono_tramp_info_free (info);
+ if (mono_aot_only) {
+ ptr = mono_aot_get_lazy_fetch_trampoline (offset);
+ } else {
+ tramp = mono_arch_create_rgctx_lazy_fetch_trampoline (offset, &info, FALSE);
+ if (info) {
+ mono_save_trampoline_xdebug_info (info);
+ if (mono_jit_map_is_enabled ())
+ mono_emit_jit_tramp (info->code, info->code_size, info->name);
+ mono_tramp_info_free (info);
+ }
+ ptr = mono_create_ftnptr (mono_get_root_domain (), tramp);
}
- ptr = mono_create_ftnptr (mono_get_root_domain (), tramp);
mono_trampolines_lock ();
if (!rgctx_lazy_fetch_trampoline_hash) {
Commit: e6fcd7e8866bbec77331d141f94c4900a4f53085
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 10:45:43 GMT
URL: https://github.com/mono/mono/commit/e6fcd7e8866bbec77331d141f94c4900a4f53085
[runtime] Avoid running tests using AC_TRY_RUN () when cross-compiling.
Changed paths:
M configure.in
Modified: configure.in
===================================================================
@@ -1585,6 +1585,8 @@ if test x$target_win32 = xno; then
AC_MSG_CHECKING(for working __thread)
if test "x$with_tls" != "x__thread"; then
AC_MSG_RESULT(disabled)
+ elif test "x$cross_compiling" = "xyes"; then
+ AC_MSG_RESULT(cross compiling, assuming yes)
else
AC_TRY_RUN([
#if defined(__APPLE__) && defined(__clang__)
@@ -1632,6 +1634,8 @@ if test x$target_win32 = xno; then
AC_MSG_CHECKING(for working sigaltstack)
if test "x$with_sigaltstack" != "xyes"; then
AC_MSG_RESULT(disabled)
+ elif test "x$cross_compiling" = "xyes"; then
+ AC_MSG_RESULT(cross compiling, assuming yes)
else
AC_TRY_RUN([
#include <stdio.h>
Commit: 47fcf8de8c0168091ca77175c72d9e79215574ce
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 10:48:47 GMT
URL: https://github.com/mono/mono/commit/47fcf8de8c0168091ca77175c72d9e79215574ce
[sdb] Fix support of vtypes passed by ref.
Changed paths:
M mono/mini/debug-mini.c
M mono/mini/debugger-agent.c
Modified: mono/mini/debug-mini.c
===================================================================
@@ -164,8 +164,12 @@ struct _MonoDebuggerThreadInfo {
} else if (inst->opcode == OP_GSHAREDVT_LOCAL) {
var->index = inst->inst_imm | MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL;
} else if (inst->opcode == OP_VTARG_ADDR) {
- var->offset = inst->inst_offset;
- var->index = inst->inst_basereg | MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR;
+ MonoInst *vtaddr;
+
+ vtaddr = inst->inst_left;
+ g_assert (vtaddr->opcode == OP_REGOFFSET);
+ var->offset = vtaddr->inst_offset;
+ var->index = vtaddr->inst_basereg | MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR;
} else {
g_assert_not_reached ();
}
Modified: mono/mini/debugger-agent.c
===================================================================
@@ -5888,6 +5888,7 @@ static void CALLBACK notify_thread_apc (ULONG_PTR param)
NOT_IMPLEMENTED;
break;
case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR:
+ case MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR:
/* Same as regoffset, but with an indirection */
addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg);
addr += (gint32)var->offset;
Commit: 5557499b1a8b945d8f1d73d748a0f67c8a8f9dc2
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 10:51:14 GMT
URL: https://github.com/mono/mono/commit/5557499b1a8b945d8f1d73d748a0f67c8a8f9dc2
[runtime] Make --regression work when a domain is not yet setup during porting.
Changed paths:
M mono/mini/driver.c
Modified: mono/mini/driver.c
===================================================================
@@ -388,10 +388,12 @@
comp_time = elapsed = 0.0;
/* fixme: ugly hack - delete all previously compiled methods */
- g_hash_table_destroy (domain_jit_info (domain)->jit_trampoline_hash);
- domain_jit_info (domain)->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
- mono_internal_hash_table_destroy (&(domain->jit_code_hash));
- mono_jit_code_hash_init (&(domain->jit_code_hash));
+ if (domain_jit_info (domain)) {
+ g_hash_table_destroy (domain_jit_info (domain)->jit_trampoline_hash);
+ domain_jit_info (domain)->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
+ mono_internal_hash_table_destroy (&(domain->jit_code_hash));
+ mono_jit_code_hash_init (&(domain->jit_code_hash));
+ }
g_timer_start (timer);
if (mini_stats_fd)
Commit: e833cd7669e070ab32e15f655732f4f222b94cf4
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:14:39 GMT
URL: https://github.com/mono/mono/commit/e833cd7669e070ab32e15f655732f4f222b94cf4
[jit] Add a MONO_ARCH_EMULATE_LONG_MUL_OVF_OPTS define for architectures which have mul but not mul.ovf opcodes.
Changed paths:
M mono/mini/jit-icalls.c
M mono/mini/mini.c
Modified: mono/mini/jit-icalls.c
===================================================================
@@ -82,7 +82,7 @@
mono_raise_exception (mono_get_exception_array_type_mismatch ());
}
-#ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
+#if !defined(MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS) || defined(MONO_ARCH_EMULATE_LONG_MUL_OVF_OPTS)
gint64
mono_llmult (gint64 a, gint64 b)
Modified: mono/mini/mini.c
===================================================================
@@ -7211,6 +7211,8 @@ static void seq_point_info_free (gpointer value)
register_opcode_emulation (OP_LDIV_UN, "__emul_ldiv_un", "long long long", mono_lldiv_un, "mono_lldiv_un", FALSE);
register_opcode_emulation (OP_LREM, "__emul_lrem", "long long long", mono_llrem, "mono_llrem", FALSE);
register_opcode_emulation (OP_LREM_UN, "__emul_lrem_un", "long long long", mono_llrem_un, "mono_llrem_un", FALSE);
+#endif
+#if !defined(MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS) || defined(MONO_ARCH_EMULATE_LONG_MUL_OVF_OPTS)
register_opcode_emulation (OP_LMUL_OVF_UN, "__emul_lmul_ovf_un", "long long long", mono_llmult_ovf_un, "mono_llmult_ovf_un", FALSE);
register_opcode_emulation (OP_LMUL_OVF, "__emul_lmul_ovf", "long long long", mono_llmult_ovf, "mono_llmult_ovf", FALSE);
#endif
Commit: 16d53c2dd7bb4b196ac0049628eadf1fe4f0bae0
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:16:02 GMT
URL: https://github.com/mono/mono/commit/16d53c2dd7bb4b196ac0049628eadf1fe4f0bae0
runtime] Print unwind information in the JIT debug output.
Changed paths:
M mono/mini/mini.c
Modified: mono/mini/mini.c
===================================================================
@@ -593,6 +593,22 @@ void *mono_global_codeman_reserve (int size)
op->when = when;
cfg->unwind_ops = g_slist_append_mempool (cfg->mempool, cfg->unwind_ops, op);
+ if (cfg->verbose_level > 1) {
+ switch (tag) {
+ case DW_CFA_def_cfa:
+ printf ("CFA: [%x] def_cfa: %s+0x%x\n", when, mono_arch_regname (reg), val);
+ break;
+ case DW_CFA_def_cfa_register:
+ printf ("CFA: [%x] def_cfa_reg: %s\n", when, mono_arch_regname (reg));
+ break;
+ case DW_CFA_def_cfa_offset:
+ printf ("CFA: [%x] def_cfa_offset: 0x%x\n", when, val);
+ break;
+ case DW_CFA_offset:
+ printf ("CFA: [%x] offset: %s at cfa-0x%x\n", when, mono_arch_regname (reg), -val);
+ break;
+ }
+ }
}
MonoJumpInfoToken *
Commit: 60c5ef5e2b9a4a64461955d90763c12f584a3012
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:18:28 GMT
URL: https://github.com/mono/mono/commit/60c5ef5e2b9a4a64461955d90763c12f584a3012
[jit] Add a 'call_info' field to MonoCallInst so the OP_CALL_... opcodes have access to the calling convention information computed in mono_arch_emit_call ().
Changed paths:
M mono/mini/mini.h
Modified: mono/mini/mini.h
===================================================================
@@ -844,6 +844,7 @@ struct MonoCallInst {
GSList *out_ireg_args;
GSList *out_freg_args;
GSList *outarg_vts;
+ gpointer call_info;
#ifdef ENABLE_LLVM
LLVMCallInfo *cinfo;
int rgctx_arg_reg, imt_arg_reg;
Commit: 71a7f55907f8e5275b59d12b25207890191a90b3
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:21:37 GMT
URL: https://github.com/mono/mono/commit/71a7f55907f8e5275b59d12b25207890191a90b3
[jit] Add a 'relocation' field to MonoJumpInfo which contains an architecture specific relocation constant so mono_arm_patch_code () doesn't have to decompile the patch site to determine the type of patching to do.
Changed paths:
M mono/mini/mini.c
M mono/mini/mini.h
Modified: mono/mini/mini.c
===================================================================
@@ -3011,6 +3011,20 @@ void *mono_global_codeman_reserve (int size)
cfg->patch_info = ji;
}
+void
+mono_add_patch_info_rel (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target, int relocation)
+{
+ MonoJumpInfo *ji = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfo));
+
+ ji->ip.i = ip;
+ ji->type = type;
+ ji->relocation = relocation;
+ ji->data.target = target;
+ ji->next = cfg->patch_info;
+
+ cfg->patch_info = ji;
+}
+
MonoJumpInfo *
mono_patch_info_list_prepend (MonoJumpInfo *list, int ip, MonoJumpInfoType type, gconstpointer target)
{
Modified: mono/mini/mini.h
===================================================================
@@ -1182,6 +1182,8 @@ struct MonoMethodVar {
typedef struct MonoJumpInfo MonoJumpInfo;
struct MonoJumpInfo {
MonoJumpInfo *next;
+ /* Relocation type for patching */
+ int relocation;
union {
int i;
guint8 *p;
@@ -1940,6 +1942,7 @@ enum {
guint32 mono_reverse_branch_op (guint32 opcode) MONO_INTERNAL;
void mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) MONO_INTERNAL;
void mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target) MONO_LLVM_INTERNAL;
+void mono_add_patch_info_rel (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target, int relocation) MONO_LLVM_INTERNAL;
void mono_remove_patch_info (MonoCompile *cfg, int ip) MONO_INTERNAL;
MonoJumpInfo* mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info) MONO_INTERNAL;
guint mono_patch_info_hash (gconstpointer data) MONO_INTERNAL;
Commit: 7994b74bc47155f45328e284cc3709a3daa8082e
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:22:59 GMT
URL: https://github.com/mono/mono/commit/7994b74bc47155f45328e284cc3709a3daa8082e
[jit] Add a MONO_TRAMPOLINE_TYPE_HAS_ARG macro which determines whenever a given trampoline type receives its argument directly in a register.
Changed paths:
M mono/mini/mini.h
Modified: mono/mini/mini.h
===================================================================
@@ -1258,6 +1258,13 @@ struct MonoJumpInfoGSharedVtCall {
(t) == MONO_TRAMPOLINE_MONITOR_ENTER || \
(t) == MONO_TRAMPOLINE_MONITOR_EXIT)
+/* These trampolines receive an argument directly in a register */
+#define MONO_TRAMPOLINE_TYPE_HAS_ARG(t) \
+ ((t) == MONO_TRAMPOLINE_GENERIC_CLASS_INIT || \
+ (t) == MONO_TRAMPOLINE_MONITOR_ENTER || \
+ (t) == MONO_TRAMPOLINE_MONITOR_EXIT || \
+ (t) == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+
/* optimization flags */
#define OPTFLAG(id,shift,name,descr) MONO_OPT_ ## id = 1 << shift,
enum {
Commit: dde6bb81f5cd7bf96e5dc669f438eadaac97bad5
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:26:01 GMT
URL: https://github.com/mono/mono/commit/dde6bb81f5cd7bf96e5dc669f438eadaac97bad5
[jit] Add a mini_exception_id_by_name () helper function.
Changed paths:
M mono/mini/mini-codegen.c
M mono/mini/mini.h
Modified: mono/mini/mini-codegen.c
===================================================================
@@ -2697,4 +2697,27 @@ enum {
}
}
+int
+mini_exception_id_by_name (const char *name)
+{
+ if (strcmp (name, "IndexOutOfRangeException") == 0)
+ return MONO_EXC_INDEX_OUT_OF_RANGE;
+ if (strcmp (name, "OverflowException") == 0)
+ return MONO_EXC_OVERFLOW;
+ if (strcmp (name, "ArithmeticException") == 0)
+ return MONO_EXC_ARITHMETIC;
+ if (strcmp (name, "DivideByZeroException") == 0)
+ return MONO_EXC_DIVIDE_BY_ZERO;
+ if (strcmp (name, "InvalidCastException") == 0)
+ return MONO_EXC_INVALID_CAST;
+ if (strcmp (name, "NullReferenceException") == 0)
+ return MONO_EXC_NULL_REF;
+ if (strcmp (name, "ArrayTypeMismatchException") == 0)
+ return MONO_EXC_ARRAY_TYPE_MISMATCH;
+ if (strcmp (name, "ArgumentException") == 0)
+ return MONO_EXC_ARGUMENT;
+ g_error ("Unknown intrinsic exception %s\n", name);
+ return -1;
+}
+
#endif /* DISABLE_JIT */
Modified: mono/mini/mini.h
===================================================================
@@ -2193,6 +2193,7 @@ void mono_emit_unwind_op (MonoCompile *cfg, int when,
MonoTrampInfo* mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops) MONO_INTERNAL;
void mono_tramp_info_free (MonoTrampInfo *info) MONO_INTERNAL;
void mono_tramp_info_register (MonoTrampInfo *info) MONO_INTERNAL;
+int mini_exception_id_by_name (const char *name) MONO_INTERNAL;
int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock,
MonoInst *return_var, GList *dont_inline, MonoInst **inline_args,
Commit: 7226a70c87b7450b40963ce668244353fba9e83d
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:27:35 GMT
URL: https://github.com/mono/mono/commit/7226a70c87b7450b40963ce668244353fba9e83d
[runtime] Avoid crashing in mini_jit_info_table_find () if the current thread is not set.
Changed paths:
M mono/mini/mini-exceptions.c
Modified: mono/mini/mini-exceptions.c
===================================================================
@@ -1176,6 +1176,9 @@
}
}
+ if (!t)
+ return NULL;
+
refs = (t->appdomain_refs) ? *(gpointer *) t->appdomain_refs : NULL;
for (; refs && *refs; refs++) {
if (*refs != domain && *refs != mono_get_root_domain ()) {
Commit: 3b5d644f27125773edd42fdc28d1f87a20e85434
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:28:56 GMT
URL: https://github.com/mono/mono/commit/3b5d644f27125773edd42fdc28d1f87a20e85434
[runtime] Add a mono_restore_context () helper function.
Changed paths:
M mono/mini/mini-exceptions.c
M mono/mini/mini.h
Modified: mono/mini/mini-exceptions.c
===================================================================
@@ -2780,3 +2780,20 @@
g_assert_not_reached ();
}
+
+/*
+ * mono_restore_context:
+ *
+ * Call the architecture specific restore context function.
+ */
+void
+mono_restore_context (MonoContext *ctx)
+{
+ static void (*restore_context) (MonoContext *);
+
+ if (!restore_context)
+ restore_context = mono_get_restore_context ();
+ restore_context (ctx);
+ g_assert_not_reached ();
+}
+
Modified: mono/mini/mini.h
===================================================================
@@ -2408,6 +2408,7 @@ int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoB
typedef gboolean (*MonoExceptionFrameWalk) (MonoMethod *method, gpointer ip, size_t native_offset, gboolean managed, gpointer user_data);
gboolean mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpointer user_data);
+void mono_restore_context (MonoContext *ctx) MONO_INTERNAL;
gboolean
mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls,
Commit: e6f000945f0b92ed186af5e7c80d21e2a09f7200
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:32:27 GMT
URL: https://github.com/mono/mono/commit/e6f000945f0b92ed186af5e7c80d21e2a09f7200
[runtime] Fix gsharedvt support in mono_helper_compile_generic_method ().
Changed paths:
M mono/mini/jit-icalls.c
Modified: mono/mini/jit-icalls.c
===================================================================
@@ -996,8 +996,7 @@
addr = mono_compile_method (vmethod);
- if (mono_method_needs_static_rgctx_invoke (vmethod, FALSE))
- addr = mono_create_static_rgctx_trampoline (vmethod, addr);
+ addr = mini_add_method_trampoline (NULL, vmethod, addr, mono_method_needs_static_rgctx_invoke (vmethod, FALSE), FALSE);
/* Since this is a virtual call, have to unbox vtypes */
if (obj->vtable->klass->valuetype)
Commit: f62ffb9b892ae6f445b361cddb58557b5506235f
Author: Zoltan Varga <[email protected]> (vargaz)
Date: 2013-10-22 11:33:41 GMT
URL: https://github.com/mono/mono/commit/f62ffb9b892ae6f445b361cddb58557b5506235f
[runtime] Add a mini_get_nullified_class_init_trampoline () helper function.
Changed paths:
M mono/mini/mini-trampolines.c
M mono/mini/mini.h
Modified: mono/mini/mini-trampolines.c
===================================================================
@@ -1727,3 +1727,21 @@
return g_strdup_printf ("rgctx_fetch_trampoline_%s_%d", mrgctx ? "mrgctx" : "rgctx", index);
}
+gpointer
+mini_get_nullified_class_init_trampoline (void)
+{
+ static gpointer nullified_class_init_trampoline;
+
+ if (!nullified_class_init_trampoline) {
+ gpointer tramp;
+
+ if (mono_aot_only)
+ tramp = mono_aot_get_trampoline ("nullified_class_init_trampoline");
+ else
+ tramp = mono_arch_get_nullified_class_init_trampoline (NULL);
+ mono_memory_barrier ();
+ nullified_class_init_trampoline = tramp;
+ }
+
+ return nullified_class_init_trampoline;
+}
Modified: mono/mini/mini.h
===================================================================
@@ -2161,6 +2161,7 @@ gpointer mono_aot_plt_trampoline (mgreg_t *regs, guint8 *code, guint8 *
gpointer mini_get_vtable_trampoline (int slot_index) MONO_INTERNAL;
char* mono_get_generic_trampoline_name (MonoTrampolineType tramp_type) MONO_INTERNAL;
char* mono_get_rgctx_fetch_trampoline_name (int slot) MONO_INTERNAL;
+gpointer mini_get_nullified_class_init_trampoline (void) MONO_INTERNAL;
gpointer mini_add_method_trampoline (MonoMethod *orig_method, MonoMethod *m, gpointer compiled_method, gboolean add_static_rgctx_tramp, gboolean add_unbox_tramp) MONO_INTERNAL;
gboolean mini_jit_info_is_gsharedvt (MonoJitInfo *ji) MONO_INTERNAL;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.