X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini-gc.c;h=d83009b18342bba963006a88588cd354e06ed4ab;hb=d30f89875e9b3a30b3dfe03d201d00e9a740fb7a;hp=882f3a99506d1c8fe02511771389cba03081b2db;hpb=1f8da92d47d91af1524dfbbc67f3b089909f0aaf;p=mono.git diff --git a/mono/mini/mini-gc.c b/mono/mini/mini-gc.c index 882f3a99506..d83009b1834 100644 --- a/mono/mini/mini-gc.c +++ b/mono/mini/mini-gc.c @@ -6,11 +6,12 @@ * * Copyright 2009 Novell, Inc (http://www.novell.com) * Copyright 2011 Xamarin, Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "config.h" #include "mini-gc.h" -#include +#include static gboolean get_provenance (StackFrameInfo *frame, MonoContext *ctx, gpointer data) @@ -38,7 +39,7 @@ get_provenance_func (void) //#if defined(MONO_ARCH_GC_MAPS_SUPPORTED) #include -#include +#include #include #define SIZEOF_SLOT ((int)sizeof (mgreg_t)) @@ -597,7 +598,7 @@ thread_attach_func (void) TlsData *tls; tls = g_new0 (TlsData, 1); - tls->tid = GetCurrentThreadId (); + tls->tid = mono_native_thread_id_get (); tls->info = mono_thread_info_current (); stats.tlsdata_size += sizeof (TlsData); @@ -622,7 +623,7 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx) return; } - if (tls->tid != GetCurrentThreadId ()) { + if (tls->tid != mono_native_thread_id_get ()) { /* Happens on osx because threads are not suspended using signals */ #ifndef TARGET_WIN32 gboolean res; @@ -649,7 +650,7 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx) } else { tls->unwind_state.valid = FALSE; } - tls->unwind_state.unwind_data [MONO_UNWIND_DATA_JIT_TLS] = mono_native_tls_get_value (mono_jit_tls_id); + tls->unwind_state.unwind_data [MONO_UNWIND_DATA_JIT_TLS] = mono_tls_get_jit_tls (); tls->unwind_state.unwind_data [MONO_UNWIND_DATA_DOMAIN] = mono_domain_get (); } @@ -821,6 +822,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) ji = frame.ji; // FIXME: For skipped frames, scan the param area of the parent frame conservatively ? + // FIXME: trampolines if (frame.type == FRAME_TYPE_MANAGED_TO_NATIVE) { /* @@ -1678,7 +1680,7 @@ process_variables (MonoCompile *cfg) int hreg; GCSlotType slot_type; - t = mini_type_get_underlying_type (NULL, t); + t = mini_get_underlying_type (t); hreg = ins->dreg; g_assert (hreg < MONO_MAX_IREGS); @@ -1686,7 +1688,7 @@ process_variables (MonoCompile *cfg) if (byref) slot_type = SLOT_PIN; else - slot_type = mini_type_is_reference (cfg, t) ? SLOT_REF : SLOT_NOREF; + slot_type = mini_type_is_reference (t) ? SLOT_REF : SLOT_NOREF; if (slot_type == SLOT_PIN) { /* These have no live interval, be conservative */ @@ -1833,9 +1835,9 @@ process_variables (MonoCompile *cfg) } #endif - t = mini_type_get_underlying_type (NULL, t); + t = mini_get_underlying_type (t); - if (!mini_type_is_reference (cfg, t)) { + if (!mini_type_is_reference (t)) { set_slot_everywhere (gcfg, pos, SLOT_NOREF); if (cfg->verbose_level > 1) printf ("\tnoref%s at %s0x%x(fp) (R%d, slot = %d): %s\n", (is_arg ? " arg" : ""), ins->inst_offset < 0 ? "-" : "", (ins->inst_offset < 0) ? -(int)ins->inst_offset : (int)ins->inst_offset, vmv->vreg, pos, mono_type_full_name (ins->inst_vtype)); @@ -1939,7 +1941,7 @@ process_param_area_slots (MonoCompile *cfg) guint32 size; if (MONO_TYPE_ISSTRUCT (t)) { - size = mini_type_stack_size_full (cfg->generic_sharing_context, t, &align, FALSE); + size = mini_type_stack_size_full (t, &align, FALSE); } else { size = sizeof (mgreg_t); } @@ -2053,7 +2055,7 @@ compute_frame_size (MonoCompile *cfg) if (ins->opcode == OP_REGOFFSET) { int size, size_in_slots; - size = mini_type_stack_size_full (cfg->generic_sharing_context, ins->inst_vtype, NULL, ins->backend.is_pinvoke); + size = mini_type_stack_size_full (ins->inst_vtype, NULL, ins->backend.is_pinvoke); size_in_slots = ALIGN_TO (size, SIZEOF_SLOT) / SIZEOF_SLOT; min_offset = MIN (min_offset, ins->inst_offset);