else
LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
fi
- LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
+ LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS -lstdc++"
expected_llvm_version="3.4svn-mono-mono/e656cac"
this.listItemTypeData = listItemTypeData;
this.sType = schemaType;
this.hasPublicConstructor = true;
-
- LookupTypeConvertor ();
}
void LookupTypeConvertor ()
var res = serializer.Deserialize (new StringReader (xmlString));
Assert.IsNotNull (res, "#1");
- Assert.IsInstanceOfType (typeof (SerializableClass), res, "#2");
+ Assert.AreEqual (typeof (SerializableClass), res.GetType (), "#2");
var xe = (SerializableClass)res;
Assert.AreEqual (xe.Content.ToString (), "<Data />", "#3");
}
[AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ConditionalAttribute("CONTRACTS_FULL")]
- public class ContractOptionAttribute : Attribute {
+ public sealed class ContractOptionAttribute : Attribute {
public ContractOptionAttribute (string category, string setting, bool enabled)
{
Category = category;
--- /dev/null
+//
+// EventCommandEventArgs.cs.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_5
+
+namespace System.Diagnostics.Tracing
+{
+ public class EventCommandEventArgs : EventArgs
+ {
+ private EventCommandEventArgs ()
+ {
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// EventSource.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_5
+
+namespace System.Diagnostics.Tracing
+{
+ public class EventSource : IDisposable
+ {
+ protected EventSource ()
+ {
+ }
+
+ protected EventSource (bool throwOnEventWriteErrors)
+ {
+ }
+
+ public bool IsEnabled ()
+ {
+ return false;
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ }
+
+ protected void WriteEvent (int eventId, int arg1, int arg2, int arg3)
+ {
+ }
+ }
+}
+
+#endif
return 12;
}
+#if !NET_4_5
[ComVisible (false)]
public override int GetWeekOfYear (DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
{
return base.GetWeekOfYear (time, rule, firstDayOfWeek);
}
+#endif
/// <summary>
/// Overridden. Gives the number of the year of the specified
PtrToStructure (ptr, (object)structure);
}
- public static object PtrToStructure<T> (IntPtr ptr) {
- return PtrToStructure (ptr, typeof (T));
+ public static T PtrToStructure<T> (IntPtr ptr) {
+ return (T) PtrToStructure (ptr, typeof (T));
}
#endif
}
#if NET_4_5
- public static Delegate GetDelegateForFunctionPointer<T> (IntPtr ptr) {
- return GetDelegateForFunctionPointer (ptr, typeof (T));
+ public static TDelegate GetDelegateForFunctionPointer<TDelegate> (IntPtr ptr) {
+ return (TDelegate) (object) GetDelegateForFunctionPointer (ptr, typeof (TDelegate));
}
#endif
// Don't throw ObjectDisposedException if the callback
// is called concurrently with a Dispose
//
- public void CancelSafe ()
+ void CancelSafe ()
{
if (!disposed)
Cancellation (true);
list.Capacity = 0;
}
+ // This doesn't fail on 64 bit systems
+ /*
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void TestCapacity4 ()
SortedList list = new SortedList ();
list.Capacity = Int32.MaxValue;
}
+ */
[Test]
public void TestCount ()
#endif
- [Test]
- public void JaggedArrayCtor ()
- {
- var type = Type.GetType ("System.Object[][]");
-
- ConstructorInfo ctor = null;
- foreach (var c in type.GetConstructors ()) {
- if (c.GetParameters ().Length == 2)
- ctor = c;
- }
- Assert.IsNotNull (ctor);
- var arr = (object[])ctor.Invoke (new object [] { 4, 10 });
- for (int i = 0; i < 4; ++i) {
- Assert.IsNotNull (arr [i]);
- Assert.AreEqual (10, ((object[])arr [i]).Length);
- }
- }
}
}
System.Diagnostics.Contracts/ContractVerificationAttribute.cs
System.Diagnostics.Contracts/PureAttribute.cs
System.Diagnostics.Contracts.Internal/ContractHelper.cs
+System.Diagnostics.Tracing/EventSource.cs
+System.Diagnostics.Tracing/EventCommandEventArgs.cs
System.Diagnostics.SymbolStore/ISymbolBinder.cs
System.Diagnostics.SymbolStore/ISymbolBinder1.cs
System.Diagnostics.SymbolStore/ISymbolDocument.cs
MonoMethodSignature *sig;
int count_generic = 0, first_generic = 0;
int method_num = 0;
- gboolean jagged_ctor = FALSE;
class->method.count = 3 + (class->rank > 1? 2: 1);
mono_class_setup_interfaces (class, &error);
g_assert (mono_error_ok (&error)); /*FIXME can this fail for array types?*/
- if (class->rank == 1 && class->element_class->rank) {
- jagged_ctor = TRUE;
- class->method.count ++;
- }
-
if (class->interface_count) {
count_generic = generic_array_methods (class);
first_generic = class->method.count;
amethod = create_array_method (class, ".ctor", sig);
methods [method_num++] = amethod;
}
-
- if (jagged_ctor) {
- /* Jagged arrays have an extra ctor in .net which creates an array of arrays */
- sig = mono_metadata_signature_alloc (class->image, class->rank + 1);
- sig->ret = &mono_defaults.void_class->byval_arg;
- sig->pinvoke = TRUE;
- sig->hasthis = TRUE;
- for (i = 0; i < class->rank + 1; ++i)
- sig->params [i] = &mono_defaults.int32_class->byval_arg;
- amethod = create_array_method (class, ".ctor", sig);
- methods [method_num++] = amethod;
- }
-
/* element Get (idx11, [idx2, ...]) */
sig = mono_metadata_signature_alloc (class->image, class->rank);
sig->ret = &class->element_class->byval_arg;
for (i = 0; i < pcount; ++i)
lengths [i] = *(int32_t*) ((char*)mono_array_get (params, gpointer, i) + sizeof (MonoObject));
- if (m->klass->rank == 1 && sig->param_count == 2 && m->klass->element_class->rank) {
- /* This is a ctor for jagged arrays. MS creates an array of arrays. */
- MonoArray *arr = mono_array_new_full (mono_object_domain (params), m->klass, lengths, NULL);
-
- for (i = 0; i < mono_array_length (arr); ++i) {
- MonoArray *subarray = mono_array_new_full (mono_object_domain (params), m->klass->element_class, &lengths [1], NULL);
-
- mono_array_setref_fast (arr, i, subarray);
- }
- return (MonoObject*)arr;
- }
-
if (m->klass->rank == pcount) {
/* Only lengths provided. */
lower_bounds = NULL;
size_t num_cards;
#ifdef SGEN_HAVE_OVERLAPPING_CARDS
- if (end_card < start_card) {
- guint8 *edge_card = sgen_cardtable + CARD_COUNT_IN_BYTES;
- size_t num_cards_to_edge = edge_card - start_card;
-
- num_cards = (end_card + CARD_COUNT_IN_BYTES) - start_card;
- if (init) {
- result = dest = alloc_mod_union (num_cards);
- //g_print ("%d cards for %d bytes: %p\n", num_cards, num_bytes, dest);
- }
+ size_t rest;
- update_mod_union (dest, init, start_card, edge_card);
+ rest = num_cards = cards_in_range ((mword) obj, obj_size);
- SGEN_ASSERT (0, num_cards == (edge_card - start_card) + (end_card - sgen_cardtable), "wrong number of cards");
+ if (init)
+ result = dest = alloc_mod_union (num_cards);
- dest += num_cards_to_edge;
+ while (start_card + rest > SGEN_CARDTABLE_END) {
+ size_t count = SGEN_CARDTABLE_END - start_card;
+ update_mod_union (dest, init, start_card, SGEN_CARDTABLE_END);
+ dest += count;
+ rest -= count;
start_card = sgen_cardtable;
- } else
-#endif
- {
- num_cards = end_card - start_card;
- if (init)
- result = dest = alloc_mod_union (num_cards);
}
+#else
+ num_cards = end_card - start_card;
+ if (init)
+ result = dest = alloc_mod_union (num_cards);
+#endif
update_mod_union (dest, init, start_card, end_card);
guint8 *to = sgen_card_table_get_shadow_card_address (start);
size_t bytes = cards_in_range (start, size);
- if (to + bytes > SGEN_SHADOW_CARDTABLE_END) {
+ if (bytes >= CARD_COUNT_IN_BYTES) {
+ memcpy (sgen_shadow_cardtable, sgen_cardtable, CARD_COUNT_IN_BYTES);
+ } else if (to + bytes > SGEN_SHADOW_CARDTABLE_END) {
size_t first_chunk = SGEN_SHADOW_CARDTABLE_END - to;
size_t second_chunk = MIN (CARD_COUNT_IN_BYTES, bytes) - first_chunk;
guint8 *addr = sgen_card_table_get_card_address (start);
size_t bytes = cards_in_range (start, size);
- if (addr + bytes > SGEN_CARDTABLE_END) {
+ if (bytes >= CARD_COUNT_IN_BYTES) {
+ memset (sgen_cardtable, 0, CARD_COUNT_IN_BYTES);
+ } else if (addr + bytes > SGEN_CARDTABLE_END) {
size_t first_chunk = SGEN_CARDTABLE_END - addr;
memset (addr, 0, first_chunk);
hints.ai_flags = AI_CANONNAME;
if (*hostname && getaddrinfo(hostname, NULL, &hints, &info) == -1) {
+ g_free (hostname);
return(FALSE);
}
#else
he = _wapi_gethostbyname (hostname);
#endif
- g_free(hostname);
- if (*hostname && he==NULL)
+ if (*hostname && he==NULL) {
+ g_free (hostname);
return(FALSE);
+ }
+
+ g_free (hostname);
return(hostent_to_IPHostEntry(he, h_name, h_aliases, h_addr_list, add_local_ips));
}
mono_array_set (thread->cached_culture_info, MonoObject*, i, NULL);
}
+ /*
+ * thread->synch_cs can be NULL if this was called after
+ * ves_icall_System_Threading_InternalThread_Thread_free_internal.
+ * This can happen only during shutdown.
+ * The shutting_down flag is not always set, so we can't assert on it.
+ */
if (thread->synch_cs)
LOCK_THREAD (thread);
- else
- g_assert (shutting_down);
thread->state |= ThreadState_Stopped;
thread->state &= ~ThreadState_Background;
}
/*
- * This is called from the finalizer of the internal thread object. Since threads keep a reference to their
- * thread object while running, by the time this function is called, the thread has already exited/detached,
- * i.e. thread_cleanup () has ran.
+ * This is called from the finalizer of the internal thread object.
*/
void
ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInternalThread *this, HANDLE thread)
{
THREAD_DEBUG (g_message ("%s: Closing thread %p, handle %p", __func__, this, thread));
+ /*
+ * Since threads keep a reference to their thread object while running, by the time this function is called,
+ * the thread has already exited/detached, i.e. thread_cleanup () has ran. The exception is during shutdown,
+ * when thread_cleanup () can be called after this.
+ */
if (thread)
CloseHandle (thread);
mono_amd64_get_exception_trampolines (gboolean aot) MONO_INTERNAL;
int
-mono_amd64_get_tls_gs_offset (void) MONO_INTERNAL;
+mono_amd64_get_tls_gs_offset (void) MONO_LLVM_INTERNAL;
typedef struct {
guint8 *address;
nice_ticks = strtoull (data, &data, 10);
system_ticks = strtoull (data, &data, 10);
idle_ticks = strtoull (data, &data, 10);
- strtoull (data, &data, 10); /* iowait_ticks */
+ /* iowait_ticks = strtoull (data, &data, 10); */
irq_ticks = strtoull (data, &data, 10);
sirq_ticks = strtoull (data, &data, 10);
break;