Compare commits

...
Author SHA1 Message Date
Zoltan Varga 45d0ba1bc0 [runtime] Fix the leaking of mach ports introduced by 98bbf8512a. Fixes #22068. 2014-08-15 10:19:13 -04:00
Alexander Köplinger 69104ca6c7 [System] Use xamarin.com instead of mono-project.com for DNS tests
The latter is now hosted on a different IP behind a CDN and the IP may change depending on location.
Using xamarin.com instead fixes the tests for now.
2014-08-14 20:24:29 -04:00
Rodrigo Kumpera 62a857ec77 Revert "[mcs] Use closed delegate over static generated methods from anonymous methods"
This reverts commit 7edcd42a15.

Conflicts:
	mcs/tests/ver-il-net_4_5.xml
2014-08-12 19:40:17 -04:00
Zoltan Varga 2e5f57cc6c Revert "[mcs] Use closed delegate over static generated methods from anonymous methods"
This reverts commit 7edcd42a15.

Revert this as it causes blocker https://bugzilla.xamarin.com/show_bug.cgi?id=21651.
2014-08-12 19:23:41 -04:00
Marek Safar 992e9ff54b [System.Net.Http] Handle quoted filename value. Fixes #21960 2014-08-12 10:35:52 +02:00
Zoltan Varga 1a2c7216c1 [runtime] Fix Process.PrivateMemorySize64 etc. on ios. Fixes #21882. 2014-08-07 15:51:34 +02:00
Zoltan Varga 7348882b0b [jit] Fix enum->int casts in gsharedvt code. Fixes #21893. 2014-08-07 15:48:28 +02:00
Zoltan Varga 9ffca33e57 [jit] Avoid making generic calls from gsharedvt methods normally, go through the rgctx infrastructure instead. Fixes #21677. 2014-07-31 22:16:56 +02:00
Marek Safar 3b5a8e7214 [mcs] Update codegen for boolean loads. Fixes #21685 2014-07-31 18:41:09 +02:00
Alexis Christoforides 44ae3e4969 Bump Mono version -> 3.8.0 2014-07-30 14:50:28 -04:00
12 changed files with 856 additions and 755 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [3.6.1],
AC_INIT(mono, [3.8.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -211,6 +211,10 @@ namespace System.Net.Http.Headers
static string EncodeBase64Value (string value)
{
bool quoted = value.Length > 1 && value [0] == '"' && value [value.Length - 1] == '"';
if (quoted)
value = value.Substring (1, value.Length - 2);
for (int i = 0; i < value.Length; ++i) {
var ch = value[i];
if (ch > 127) {
@@ -220,7 +224,7 @@ namespace System.Net.Http.Headers
}
}
if (!Lexer.IsValidToken (value))
if (quoted || !Lexer.IsValidToken (value))
return "\"" + value + "\"";
return value;
@@ -215,6 +215,14 @@ namespace MonoTests.System.Net.Http.Headers
value.FileName = "(@)";
Assert.AreEqual ("\"(@)\"", value.FileName, "#21");
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"(@)\""), value.Parameters.First (), "#22");
value.FileName = "\"č\"";
Assert.AreEqual ("č", value.FileName, "#31");
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#32");
value.FileName = "\"quoted\"";
Assert.AreEqual ("\"quoted\"", value.FileName, "#41");
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"quoted\""), value.Parameters.First (), "#42");
}
[Test]
+4 -4
View File
@@ -28,8 +28,8 @@ namespace MonoTests.System.Net
[TestFixture]
public class DnsTest
{
private String site1Name = "mono-project.com",
site1Dot = "96.126.105.110",
private String site1Name = "xamarin.com",
site1Dot = "50.19.126.231",
site2Name = "info.diku.dk",
site2Dot = "130.225.96.4",
noneExistingSite = "unlikely.xamarin.com";
@@ -44,7 +44,7 @@ namespace MonoTests.System.Net
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
IPHostEntry entry = Dns.EndGetHostByName (async);
SubTestValidIPHostEntry (entry);
Assert.IsTrue (entry.HostName == "www.mono-project.com" || entry.HostName == "mono-project.com");
Assert.IsTrue (entry.HostName == "www.xamarin.com" || entry.HostName == "xamarin.com");
}
void GetHostByNameCallback (IAsyncResult ar)
@@ -191,7 +191,7 @@ namespace MonoTests.System.Net
[Test]
public void GetHostByName ()
{
SubTestGetHostByName ("www.mono-project.com", site1Dot);
SubTestGetHostByName ("www.xamarin.com", site1Dot);
SubTestGetHostByName (site2Name, site2Dot);
try {
var entry = Dns.GetHostByName (noneExistingSite);
+6 -2
View File
@@ -1792,8 +1792,12 @@ namespace Mono.CSharp {
// this argument is generated during compilation which speeds up dispatch
// by about 25%
//
method_parameters = ParametersCompiled.Prefix (method_parameters,
new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
//
// Disabled for now due to JIT bug
//
//method_parameters = ParametersCompiled.Prefix (method_parameters,
// new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
}
if (storey == null && hoisted_tparams == null)
+4 -4
View File
@@ -540,8 +540,8 @@ namespace Mono.CSharp
// bool array can actually store any byte value
//
ig.Emit (OpCodes.Ldelem_U1);
ig.Emit (OpCodes.Ldc_I4_1);
ig.Emit (OpCodes.And);
ig.Emit (OpCodes.Ldc_I4_0);
ig.Emit (OpCodes.Cgt_Un);
break;
case BuiltinTypeSpec.Type.Byte:
ig.Emit (OpCodes.Ldelem_U1);
@@ -762,8 +762,8 @@ namespace Mono.CSharp
break;
case BuiltinTypeSpec.Type.Bool:
ig.Emit (OpCodes.Ldind_I1);
ig.Emit (OpCodes.Ldc_I4_1);
ig.Emit (OpCodes.And);
ig.Emit (OpCodes.Ldc_I4_0);
ig.Emit (OpCodes.Cgt_Un);
break;
case BuiltinTypeSpec.Type.ULong:
case BuiltinTypeSpec.Type.Long:
+25
View File
@@ -1,3 +1,5 @@
// Compiler options: -unsafe
using System;
class BoolArrayWithByteValues
@@ -18,6 +20,26 @@ class BoolArrayWithByteValues
return 0;
}
static unsafe bool Ptr ()
{
bool rv;
var arr = new byte [256];
for (int i = 0; i < arr.Length; i++)
arr [i] = (byte) i;
fixed (byte* bptr = arr) {
rv = true;
for (int i = 0; i < arr.Length; i++) {
bool* boptr = (bool*)(bptr + i);
if (arr[i] > 0 && !*boptr)
rv = false;
System.Console.WriteLine ("#{0} = {1}", i, *boptr);
}
}
return rv;
}
static int Main()
{
var a = new bool[1];
@@ -49,6 +71,9 @@ class BoolArrayWithByteValues
if (res != 0)
return res;
if (!Ptr ())
return 6;
return 0;
}
}
File diff suppressed because it is too large. Load diff
+46
View File
@@ -40,6 +40,12 @@ class GFoo3<T> {
// The tests use arrays to pass/receive values to keep the calling convention of the methods stable, which is a current limitation of the runtime support for gsharedvt.
//
//
// Interfaces are used to prevent the AOT compiler from discovering instantiations, thus forcing the usage of the gsharedvt
// versions of methods. Unused vtype type arguments are used to test gsharedvt methods with ref type arguments, i.e.
// when calling foo<T,T2> as foo<object,bool>, the gsharedvt version is used, but with a ref type argument.
//
// FIXME: Add mixed ref/noref tests, i.e. Dictionary<string, int>
#if MOBILE
@@ -221,6 +227,9 @@ public class Tests
res = iface.Unbox<AnEnum, int> (AnEnum.One, 0, AnEnum.Two);
if (res != AnEnum.Two)
return 2;
int res2 = iface.Unbox<int, AnEnum> (0, AnEnum.One, AnEnum.Two);
if (res2 != 1)
return 3;
return 0;
}
@@ -1019,6 +1028,7 @@ public class Tests
return action(null, state);
}
[Category ("!FULLAOT")]
public static int test_0_delegate_wrappers () {
Func<object, Pair<int, int>, Pair<int, int>> del1 = delegate (object o, Pair<int, int> p) { return p; };
Func<object, Pair<int, int>, Pair<int, int>> del2 = delegate (object o, Pair<int, int> p) { return p; };
@@ -1459,6 +1469,42 @@ public class Tests
var c = new ReadOnlyCollection<AnEnum> (arr);
return c.Contains (AnEnum.Two) == false ? 0 : 1;
}
interface IFaceCallPatching {
bool caller<T, T2> ();
}
class CallPatching2<T> {
T t;
public object o;
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public bool callee () {
return (string)o == "ABC";
}
}
class CallPatching : IFaceCallPatching {
public bool caller<T, T2> () {
var c = new CallPatching2<T> ();
c.o = "ABC";
return c.callee ();
}
}
//
// This tests that generic calls made from gsharedvt methods are not patched normally.
// If they are, the first call to 'caller' would patch in the gshared version of
// 'callee', causing the second call to fail because the gshared version of callee
// wouldn't work with CallPatching2<bool> since it has a different object layout.
//
public static int test_0_call_patching () {
IFaceCallPatching c = new CallPatching ();
c.caller<object, bool> ();
if (!c.caller<bool, bool> ())
return 1;
return 0;
}
}
// #13191
+4 -2
View File
@@ -1061,6 +1061,7 @@ MonoObject*
mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
{
MonoJitTlsData *jit_tls = NULL;
MonoClass *oklass;
if (mini_get_debug_options ()->better_cast_details) {
jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
@@ -1070,13 +1071,14 @@ mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
if (!obj)
return NULL;
if (klass->enumtype && obj->vtable->klass == klass->element_class)
oklass = obj->vtable->klass;
if ((klass->enumtype && oklass == klass->element_class) || (oklass->enumtype && klass == oklass->element_class))
return obj;
if (mono_object_isinst (obj, klass))
return obj;
if (mini_get_debug_options ()->better_cast_details) {
jit_tls->class_cast_from = obj->vtable->klass;
jit_tls->class_cast_from = oklass;
jit_tls->class_cast_to = klass;
}
+3 -1
View File
@@ -8390,8 +8390,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
/*
* Making generic calls out of gsharedvt methods.
* This needs to be used for all generic calls, not just ones with a gsharedvt signature, to avoid
* patching gshared method addresses into a gsharedvt method.
*/
if (cmethod && cfg->gsharedvt && mini_is_gsharedvt_signature (cfg, fsig)) {
if (cmethod && cfg->gsharedvt && (mini_is_gsharedvt_signature (cfg, fsig) || cmethod->is_inflated || cmethod->klass->generic_class)) {
MonoRgctxInfoType info_type;
if (virtual) {
+11 -4
View File
@@ -408,11 +408,17 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
struct task_basic_info t_info;
mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
if (pid == getpid ()) {
/* task_for_pid () doesn't work on ios, even for the current process */
task = mach_task_self ();
} else {
if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
}
if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
mach_port_deallocate (mach_task_self (), task);
if (pid != getpid ())
mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
}
@@ -425,7 +431,8 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
else
ret = 0;
mach_port_deallocate (mach_task_self (), task);
if (pid != getpid ())
mach_port_deallocate (mach_task_self (), task);
return ret;
#else