Merge branch 'upstream'

Former-commit-id: d4630496790a64fd851379d821f5006dfed8b754
This commit is contained in:
Xamarin Public Jenkins 2016-01-18 21:31:55 -05:00
commit 2249cfc3c2
82 changed files with 495 additions and 201 deletions

View File

@ -84,8 +84,8 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in mkinstalldirs \
$(srcdir)/mono-uninstalled.pc.in COPYING.LIB ChangeLog NEWS \
compile config.guess config.rpath config.sub depcomp \
install-sh missing ltmain.sh
compile config.guess config.rpath config.sub install-sh \
missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-assembly.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-class.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-codegen.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-counters.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-debug.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-decimal.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-domains.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-dynamic-codegen.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-embedding.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-exc.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-gc.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-gchandle.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-image.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-internal.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-jit.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-jitinternal.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-marshal.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-metadata.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-methods.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-object.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-profiler.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-reflection.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-security.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-string.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-threads.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-type.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-types.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-unsorted.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-utils.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-vm.html</title>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?><span>
<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-wapi.html</title>

View File

@ -992,7 +992,12 @@ where V is the architecture number 4, 5, 6, 7 and the options can be currently b
.TP
\fBMONO_ARM_FORCE_SOFT_FLOAT\fR
When Mono is built with a soft float fallback on ARM and this variable is set to
"1", Mono will always emit soft float code, even if a VFP unit is detected.
"1", Mono will always emit soft float code, even if a VFP unit is
detected.
.TP
\fBMONO_DARWIN_WATCHER_MAXFDS\fR
This is a debugging aid used to force limits on the FileSystemWatcher
implementation in Darwin. There is no limit by default.
.TP
\fBMONO_DISABLE_AIO\fR
If set, tells mono NOT to attempt using native asynchronous I/O services. In

View File

@ -181,8 +181,8 @@ namespace System.Runtime.Serialization
void ReadISerializable (ClassDataContract classContract)
{
ConstructorInfo ctor = classContract.GetISerializableConstructor ();
context.ReadSerializationInfo (xmlReader, classContract.UnderlyingType);
ctor.Invoke (objectLocal, new object [] {context.GetStreamingContext ()});
var info = context.ReadSerializationInfo (xmlReader, classContract.UnderlyingType);
ctor.Invoke (objectLocal, new object [] {info, context.GetStreamingContext ()});
}
void ReadClass (ClassDataContract classContract)

View File

@ -469,8 +469,13 @@ namespace System.Runtime.Serialization
PrimitiveDataContract primitiveContract = PrimitiveDataContract.GetPrimitiveDataContract(memberType);
if (primitiveContract != null && !writeXsiType)
primitiveContract.XmlFormatContentWriterMethod.Invoke (writer, new object [] {memberValue});
else
InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType);
else {
// InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType);
var typeHandleValue = Type.GetTypeHandle (memberValue);
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
}
}
else
{
@ -500,22 +505,19 @@ namespace System.Runtime.Serialization
if (isNull2) {
XmlFormatGeneratorStatics.WriteNullMethod.Invoke (ctx, new object [] {writer, memberType, DataContract.IsTypeSerializable(memberType)});
} else {
InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod),
() => memberValue, memberType, writeXsiType);
var typeHandleValue = Type.GetTypeHandle (memberValue);
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
if (isNullableOfT)
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
else
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
//InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), () => memberValue, memberType, writeXsiType);
}
}
}
}
}
void InternalSerialize (MethodInfo methodInfo, Func<object> memberValue, Type memberType, bool writeXsiType)
{
var v = memberValue ();
var typeHandleValue = Type.GetTypeHandle (v);
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (v, memberType, Globals.TypeOfObject));
methodInfo.Invoke (ctx, new object [] {writer, memberValue != null ? v : null, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle});
}
object UnwrapNullableObject(Func<object> memberValue, ref Type memberType, out bool isNull)// Leaves !HasValue on stack
{
object v = memberValue ();

View File

@ -5,10 +5,12 @@ System.Runtime.Serialization/Bug2843Test.cs
System.Runtime.Serialization/Bug3258Test.cs
System.Runtime.Serialization/Bug242Test.cs
System.Runtime.Serialization/Bug695203Test.cs
System.Runtime.Serialization/Bug36100.cs
System.Runtime.Serialization/DataContractResolverTest.cs
System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs
System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs
System.Runtime.Serialization/DataContractSerializerTest_InvalidCharacters.cs
System.Runtime.Serialization/DataContractSerializerTest_ISerializable.cs
System.Runtime.Serialization/DataContractSerializerTest.cs
System.Runtime.Serialization/KnownTypeAttributeTest.cs
System.Runtime.Serialization/XmlObjectSerializerTest.cs

View File

@ -0,0 +1 @@
0eb5fd5cac80a730d30a79b0d0fbf4155fb5ddf1

View File

@ -0,0 +1,114 @@
//
// DataContractSerializerTest_ISerializable.cs
//
// Author:
// Aaron Bockover <abock@xamarin.com>
//
// Copyright 2015 Xamarin Inc. All rights reserved.
//
// 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.
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.Runtime.Serialization
{
[TestFixture]
public class DataContractSerializerTest_ISerializable
{
[Serializable]
sealed class TestClassISerializable : ISerializable
{
public string Foo { get; }
public TestClassISerializable (string foo)
{
Foo = foo;
}
TestClassISerializable (SerializationInfo info, StreamingContext context)
{
Foo = info.GetString ("foo");
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
info.AddValue ("foo", Foo);
}
}
// Tests that the ISerializable constructor is properly invoked, which
// regressed when integrating MS Reference Source DCS, et. al.:
// https://bugzilla.xamarin.com/show_bug.cgi?id=37171
[Test]
public void TestISerializableCtor ()
{
var serializer = new DataContractSerializer (
typeof(TestClassISerializable),
new DataContractSerializerSettings {
DataContractResolver = new Resolver ()
}
);
var stream = new MemoryStream ();
var expected = new TestClassISerializable ("hello world");
serializer.WriteObject (stream, expected);
stream.Flush ();
stream.Position = 0;
var actual = (TestClassISerializable)serializer.ReadObject (stream);
Assert.AreEqual (expected.Foo, actual.Foo, "#DCS_ISer_Ctor");
}
// Resolver to force DCS to serialize any type, ensuring the ISerializable
// path will be taken for objects implementing that interface
class Resolver : DataContractResolver
{
public override Type ResolveName (string typeName, string typeNamespace,
Type declaredType, DataContractResolver knownTypeResolver)
{
return Type.GetType (typeNamespace == null
? typeName
: typeNamespace + "." + typeName
);
}
public override bool TryResolveType (Type type, Type declaredType,
DataContractResolver knownTypeResolver,
out XmlDictionaryString typeName,
out XmlDictionaryString typeNamespace)
{
var name = type.FullName;
var namesp = type.Namespace;
name = name.Substring (type.Namespace.Length + 1);
typeName = new XmlDictionaryString (XmlDictionary.Empty, name, 0);
typeNamespace = new XmlDictionaryString (XmlDictionary.Empty, namesp, 0);
return true;
}
}
}
}

View File

@ -121,7 +121,9 @@ namespace System.Xml.Xsl
public void Transform (IXPathNavigable input, XsltArgumentList arguments, Stream results)
{
Transform (input.CreateNavigator (), arguments, results);
using (var sw = new StreamWriter (results)) {
Transform (input.CreateNavigator (), arguments, sw);
}
}
public void Transform (IXPathNavigable input, XmlWriter results)

View File

@ -168,5 +168,31 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
// Returns true on .NET and False on mono 2.10.2
Assert.IsTrue (xslCompiledTransform.OutputSettings.Indent, "#1");
}
[Test] // Bug 36436
public void TransformWithXmlDocument ()
{
XmlDocument doc = new XmlDocument ();
doc.LoadXml (@"<ROOT/>");
XmlDocument st = new XmlDocument ();
st.LoadXml (@"<?xml version=""1.0"" encoding=""utf-8""?>
<xsl:stylesheet version=""1.0"" xmlns:vy=""Vineyard.Elements""
xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" xmlns:xlink=""http://www.w3.org/1999/xlink"" xmlns:user=""http://www.mydomain.com/mynamespace"">
<xsl:output method=""xml""/>
<xsl:param name=""os"" select=""ios""/>
<xsl:template match=""/ROOT"" >
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>");
XslCompiledTransform xsl = new XslCompiledTransform ();
xsl.Load (st);
XsltArgumentList args = new XsltArgumentList ();
MemoryStream mstr = new MemoryStream ();
xsl.Transform (doc, args, mstr);
}
}
}

View File

@ -162,6 +162,8 @@ namespace System.IO {
class KqueueMonitor : IDisposable
{
static bool initialized;
public int Connection
{
get { return conn; }
@ -171,6 +173,13 @@ namespace System.IO {
{
this.fsw = fsw;
this.conn = -1;
if (!initialized){
int t;
initialized = true;
var maxenv = Environment.GetEnvironmentVariable ("MONO_DARWIN_WATCHER_MAXFDS");
if (maxenv != null && Int32.TryParse (maxenv, out t))
maxFds = t;
}
}
public void Dispose ()
@ -625,7 +634,7 @@ namespace System.IO {
const int F_GETPATH = 50;
const int __DARWIN_MAXPATHLEN = 1024;
static readonly kevent[] emptyEventList = new System.IO.kevent[0];
const int maxFds = 200;
int maxFds = Int32.MaxValue;
FileSystemWatcher fsw;
int conn;

View File

@ -170,6 +170,32 @@ namespace System
return ret;
}
/* Based on the BoyerMoore string search algorithm */
int LastIndexOf (Delegate[] haystack, Delegate[] needle)
{
if (haystack.Length < needle.Length)
return -1;
if (haystack.Length == needle.Length) {
for (int i = 0; i < haystack.Length; ++i)
if (!haystack [i].Equals (needle [i]))
return -1;
return 0;
}
for (int i = haystack.Length - needle.Length, j; i >= 0;) {
for (j = 0; needle [j].Equals (haystack [i]); ++i, ++j) {
if (j == needle.Length - 1)
return i - j;
}
i -= j + 1;
}
return -1;
}
protected sealed override Delegate RemoveImpl (Delegate value)
{
if (value == null)
@ -210,42 +236,23 @@ namespace System
return ret;
} else {
/* wild case : remove MulticastDelegate from MulticastDelegate
* complexity is O(m * n), with n the number of elements in
* complexity is O(m + n), with n the number of elements in
* this.delegates and m the number of elements in other.delegates */
MulticastDelegate ret = AllocDelegateLike_internal (this);
ret.delegates = new Delegate [delegates.Length];
/* we should use a set with O(1) lookup complexity
* but HashSet is implemented in System.Core.dll */
List<Delegate> other_delegates = new List<Delegate> ();
for (int i = 0; i < other.delegates.Length; ++i)
other_delegates.Add (other.delegates [i]);
int idx = delegates.Length;
if (delegates.Equals (other.delegates))
return null;
/* we need to remove elements from the end to the beginning, as
* the addition and removal of delegates behaves like a stack */
for (int i = delegates.Length - 1; i >= 0; --i) {
/* if delegates[i] is not in other_delegates,
* then we can safely add it to ret.delegates
* otherwise we remove it from other_delegates */
if (!other_delegates.Remove (delegates [i]))
ret.delegates [--idx] = delegates [i];
}
int idx = LastIndexOf (delegates, other.delegates);
if (idx == -1)
return this;
/* the elements are at the end of the array, we
* need to move them back to the beginning of it */
int count = delegates.Length - idx;
Array.Copy (ret.delegates, idx, ret.delegates, 0, count);
MulticastDelegate ret = AllocDelegateLike_internal (this);
ret.delegates = new Delegate [delegates.Length - other.delegates.Length];
if (count == 0)
return null;
if (count == 1)
return ret.delegates [0];
if (count != delegates.Length)
Array.Resize (ref ret.delegates, count);
Array.Copy (delegates, ret.delegates, idx);
Array.Copy (delegates, idx + other.delegates.Length, ret.delegates, idx, delegates.Length - idx - other.delegates.Length);
return ret;
}

View File

@ -35,6 +35,25 @@ namespace MonoTests.System.Threading
[TestFixture]
public class ThreadPoolTests
{
int minWorkerThreads;
int minCompletionPortThreads;
int maxWorkerThreads;
int maxCompletionPortThreads;
[SetUp]
public void SetUp ()
{
ThreadPool.GetMinThreads (out minWorkerThreads, out minCompletionPortThreads);
ThreadPool.GetMaxThreads (out maxWorkerThreads, out maxCompletionPortThreads);
}
[TearDown]
public void TearDown ()
{
ThreadPool.SetMinThreads (minWorkerThreads, minCompletionPortThreads);
ThreadPool.SetMaxThreads (maxWorkerThreads, maxCompletionPortThreads);
}
[Test]
public void RegisterWaitForSingleObject_InvalidArguments ()
{
@ -99,5 +118,85 @@ namespace MonoTests.System.Threading
Assert.IsTrue (ev.Wait (3000));
}
#endif
[Test]
public void SetAndGetMinThreads ()
{
int workerThreads, completionPortThreads;
int workerThreads_new, completionPortThreads_new;
ThreadPool.GetMinThreads (out workerThreads, out completionPortThreads);
Assert.IsTrue (workerThreads > 0, "#1");
Assert.IsTrue (completionPortThreads > 0, "#2");
workerThreads_new = workerThreads == 1 ? 2 : 1;
completionPortThreads_new = completionPortThreads == 1 ? 2 : 1;
ThreadPool.SetMinThreads (workerThreads_new, completionPortThreads_new);
ThreadPool.GetMinThreads (out workerThreads, out completionPortThreads);
Assert.IsTrue (workerThreads == workerThreads_new, "#3");
Assert.IsTrue (completionPortThreads == completionPortThreads_new, "#4");
}
[Test]
public void SetAndGetMaxThreads ()
{
int cpuCount = Environment.ProcessorCount;
int workerThreads, completionPortThreads;
int workerThreads_new, completionPortThreads_new;
ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
Assert.IsTrue (workerThreads > 0, "#1");
Assert.IsTrue (completionPortThreads > 0, "#2");
workerThreads_new = workerThreads == cpuCount ? cpuCount + 1 : cpuCount;
completionPortThreads_new = completionPortThreads == cpuCount ? cpuCount + 1 : cpuCount;
ThreadPool.SetMaxThreads (workerThreads_new, completionPortThreads_new);
ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
Assert.IsTrue (workerThreads == workerThreads_new, "#3");
Assert.IsTrue (completionPortThreads == completionPortThreads_new, "#4");
}
[Test]
public void GetAvailableThreads ()
{
ManualResetEvent mre = new ManualResetEvent (false);
DateTime start = DateTime.Now;
int i, workerThreads, completionPortThreads;
try {
Assert.IsTrue (ThreadPool.SetMaxThreads (Environment.ProcessorCount, Environment.ProcessorCount));
while (true) {
ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
if (workerThreads == 0)
break;
if ((DateTime.Now - start).TotalSeconds >= 10)
Assert.Fail ("did not reach 0 available threads");
ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre);
Thread.Sleep (1);
}
} finally {
mre.Set ();
}
}
void GetAvailableThreads_Callback (object state)
{
ManualResetEvent mre = (ManualResetEvent) state;
if (mre.WaitOne (0))
return;
ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre);
ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre);
ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre);
ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre);
mre.WaitOne ();
}
}
}

View File

@ -1 +1 @@
b937698af090202f18c31201001eb77a3e464dc5
18d510880a46b3f8fcc62ee6d2743c2ad6ec142f

View File

@ -1 +1 @@
ce9eb809ba177cb9c5f9387d1e2d93f17a583be9
5ea7ca0de24029a348ac8342657aa95d53925e82

View File

@ -1 +1 @@
2f48219b5156199cf909adf76dc0097708cfd932
0637251b61def8d6dff27a5c3ab15f3e34de3e9d

View File

@ -1 +1 @@
d5cb6b4dd17539ae3babb95e036964746d5bb92e
a90a1a94357eaac435b86ed064aa2078cc144b2e

View File

@ -1 +1 @@
3fa77ec9258a44fd81c7433c3534093f2984d1cf
c9845643332357f61fb6a54a17f807991c5e7270

View File

@ -1 +1 @@
b656909fcd7c7447aa1b8639357c6c089a918a74
1cc8b87d077544a9f323c682b733f0fa0d1a1567

View File

@ -1 +1 @@
ec8668e105a38b35bf91110fe79e06e0dca1ead6
d72025330154b3b52629a526c8cce5cbb390d58b

View File

@ -1 +1 @@
47b95db8a26f7b940063993c07b77a5ee36746fe
e9d53d6ca1f39de0e8e00f24d0ad7a8bc0e72500

View File

@ -315,6 +315,7 @@ OPDEF(CEE_MONO_JIT_ICALL_ADDR, "mono_jit_icall_addr", Pop0, PushI, InlineI, X, 2
OPDEF(CEE_MONO_LDPTR_INT_REQ_FLAG, "mono_ldptr_int_req_flag", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x14, NEXT)
OPDEF(CEE_MONO_LDPTR_CARD_TABLE, "mono_ldptr_card_table", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x15, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_START, "mono_ldptr_nursery_start", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x16, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_BITS, "mono_ldptr_nursery_bits", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x17, NEXT)
#ifndef OPALIAS
#define _MONO_CIL_OPALIAS_DEFINED_
#define OPALIAS(a,s,r)

View File

@ -1 +1 @@
9292a1f14d206875dd19b3483d61333eedaa2207
f49032b6fbcf3c932ab7f6c10276180a7a5cf6cd

View File

@ -220,12 +220,14 @@ emit_nursery_check (MonoMethodBuilder *mb, int *nursery_check_return_labels, gbo
*/
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_START);
mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
mono_mb_emit_byte (mb, CEE_SHR_UN);
mono_mb_emit_stloc (mb, shifted_nursery_start);
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
mono_mb_emit_byte (mb, CEE_SHR_UN);
mono_mb_emit_ldloc (mb, shifted_nursery_start);
nursery_check_return_labels [0] = mono_mb_emit_branch (mb, CEE_BEQ);
@ -234,7 +236,8 @@ emit_nursery_check (MonoMethodBuilder *mb, int *nursery_check_return_labels, gbo
// if (!ptr_in_nursery (*ptr)) return;
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_byte (mb, CEE_LDIND_I);
mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
mono_mb_emit_byte (mb, CEE_SHR_UN);
mono_mb_emit_ldloc (mb, shifted_nursery_start);
nursery_check_return_labels [1] = mono_mb_emit_branch (mb, CEE_BNE_UN);

View File

@ -876,8 +876,18 @@ monitor_thread (void)
if (all_waitsleepjoin) {
ThreadPoolCounter counter;
COUNTER_ATOMIC (counter, { counter._.max_working ++; });
hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION);
gboolean limit_worker_max_reached = FALSE;
COUNTER_ATOMIC (counter, {
if (counter._.max_working >= threadpool->limit_worker_max) {
limit_worker_max_reached = TRUE;
break;
}
counter._.max_working ++;
});
if (!limit_worker_max_reached)
hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION);
}
threadpool->cpu_usage = mono_cpu_usage (threadpool->cpu_usage_state);
@ -1421,12 +1431,16 @@ mono_threadpool_ms_resume (void)
void
ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads)
{
ThreadPoolCounter counter;
if (!worker_threads || !completion_port_threads)
return;
mono_lazy_initialize (&status, initialize);
*worker_threads = threadpool->limit_worker_max;
counter.as_gint64 = COUNTER_READ ();
*worker_threads = MAX (0, threadpool->limit_worker_max - counter._.active);
*completion_port_threads = threadpool->limit_io_max;
}
@ -1464,8 +1478,8 @@ ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads
if (completion_port_threads <= 0 || completion_port_threads > threadpool->limit_io_max)
return FALSE;
threadpool->limit_worker_max = worker_threads;
threadpool->limit_io_max = completion_port_threads;
threadpool->limit_worker_min = worker_threads;
threadpool->limit_io_min = completion_port_threads;
return TRUE;
}

View File

@ -1 +1 @@
68fe0688774e03bdf70e4f80f566f1e98cc3abf8
43a938d0fc4a0e09757c04938cbbb2ba5b269639

View File

@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.2.2.10/7b87787\"" > version.h
echo "#define FULL_VERSION \"Stable 4.2.2.29/efae6a0\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.2.2.10/7b87787\"" > version.h
echo "#define FULL_VERSION \"Stable 4.2.2.29/efae6a0\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -1 +1 @@
4b2d84dd6668bd0561add9df9659b3a3dbe4586b
89ae0acc368fbb5f2e5c94a7279510c1abc670f2

View File

@ -1 +1 @@
f90e82ac07050949995cbc363bae19c32c00b64c
46c962d8d258bbbc41ba0eb536a665e655c91493

View File

@ -1 +1 @@
8d2f08962c13e0e01c89cb1f9fd8d9c9fadc43d3
b7a04e595ac8e42f5912b4c52b21919472ebea6e

View File

@ -292,82 +292,6 @@ class Tests
return 0;
}
enum LongEnum : ulong {
A = 1
}
public static int test_0_long_enum_eq_comparer () {
var c = EqualityComparer<LongEnum>.Default;
c.GetHashCode (LongEnum.A);
return 0;
}
enum UInt32Enum : uint {
A = 1
}
enum Int32Enum : int {
A = 1
}
enum Int16Enum : short {
A = 1
}
enum UInt16Enum : ushort {
A = 1
}
enum Int8Enum : sbyte {
A = 1
}
enum UInt8Enum : byte {
A = 1
}
public static int test_0_int_enum_eq_comparer () {
var t1 = new Dictionary<Int32Enum, object> ();
t1 [Int32Enum.A] = "foo";
var t2 = new Dictionary<UInt32Enum, object> ();
t2 [UInt32Enum.A] = "foo";
var t3 = new Dictionary<UInt16Enum, object> ();
t3 [UInt16Enum.A] = "foo";
var t4 = new Dictionary<Int16Enum, object> ();
t4 [Int16Enum.A] = "foo";
var t5 = new Dictionary<Int8Enum, object> ();
t5 [Int8Enum.A] = "foo";
var t6 = new Dictionary<UInt8Enum, object> ();
t6 [UInt8Enum.A] = "foo";
return 0;
}
public static int test_0_array_accessor_runtime_invoke_ref () {
var t = typeof (string[]);
var arr = Array.CreateInstance (typeof (string), 1);
arr.GetType ().GetMethod ("Set").Invoke (arr, new object [] { 0, "A" });
var res = (string)arr.GetType ().GetMethod ("Get").Invoke (arr, new object [] { 0 });
if (res != "A")
return 1;
return 0;
}
public static void SetArrayValue_<T> (T[] values) {
values.Select (x => x).ToArray ();
}
public static int test_0_delegate_invoke_wrappers_gsharedvt () {
var enums = new LongEnum [] { LongEnum.A };
SetArrayValue_ (enums);
return 0;
}
struct LargeStruct {
public int a, b, c, d;
}

View File

@ -1718,6 +1718,33 @@ public class Tests
return 2;
return 0;
}
public interface IFaceTest {
int iface_method ();
}
public interface IFaceConstrainedIFace {
int foo<T, T2> (ref T val) where T: IFaceTest;
}
class ConstrainedIFace : IFaceConstrainedIFace {
public int foo<T, T2> (ref T val) where T: IFaceTest {
return val.iface_method ();
}
}
class ClassTest : IFaceTest {
public int iface_method () {
return 42;
}
}
// Test constrained calls on an interface made from gsharedvt methods
public static int test_42_gsharedvt_constrained_iface () {
IFaceConstrainedIFace obj = new ConstrainedIFace ();
IFaceTest t = new ClassTest ();
return obj.foo<IFaceTest, int> (ref t);
}
}
// #13191

View File

@ -1204,11 +1204,16 @@ static MonoMethod*
constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *this_arg)
{
MonoMethod *m;
int vt_slot;
int vt_slot, iface_offset;
if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
mono_set_pending_exception (mono_get_exception_execution_engine ("Not yet supported."));
return NULL;
MonoObject *this_obj;
/* Have to use the receiver's type instead of klass, the receiver is a ref type */
this_obj = *(MonoObject**)mp;
g_assert (this_obj);
klass = this_obj->vtable->klass;
}
if (mono_method_signature (cmethod)->pinvoke) {
@ -1220,8 +1225,6 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
g_assert (klass->vtable);
vt_slot = mono_method_get_vtable_slot (cmethod);
if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
int iface_offset;
iface_offset = mono_class_interface_offset (klass, cmethod->klass);
g_assert (iface_offset != -1);
vt_slot += iface_offset;
@ -1230,6 +1233,7 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
if (cmethod->is_inflated)
m = mono_class_inflate_generic_method (m, mono_method_get_context (cmethod));
}
if (klass->valuetype && (m->klass == mono_defaults.object_class || m->klass == mono_defaults.enum_class->parent || m->klass == mono_defaults.enum_class))
/*
* Calling a non-vtype method with a vtype receiver, has to box.

View File

@ -1 +1 @@
cfb7eed7bb4f48fe36aa3b8c99187b233fb8ed25
83cb83354cc749cc41c0999b8e401a52ac1c9b01

View File

@ -1 +1 @@
4ebbe548d71b7a3556b34b718274beb4d108c38a
4330a1ccf556813c171c55ef21cca201c69085f5

View File

@ -1 +1 @@
2e5dc1ce3dbfe8e7af13b7ab7a5e73b37690cfdf
7997875cd2e2752bedaea6fda2516a670c2662b3

View File

@ -55,4 +55,5 @@ PATCH_INFO(LDSTR_LIT, "ldstr_lit")
PATCH_INFO(GC_NURSERY_START, "gc_nursery_start")
PATCH_INFO(VIRT_METHOD, "virt_method")
PATCH_INFO(GC_SAFE_POINT_FLAG, "gc_safe_point_flag")
PATCH_INFO(GC_NURSERY_BITS, "gc_nursery_bits")
PATCH_INFO(NONE, "none")

View File

@ -1 +1 @@
#define FULL_VERSION "Stable 4.2.2.10/7b87787"
#define FULL_VERSION "Stable 4.2.2.29/efae6a0"

View File

@ -16,6 +16,10 @@ class Tests {
v += 4;
Console.WriteLine ("Test.F4");
}
static void F8 () {
v += 8;
Console.WriteLine ("Test.F8");
}
public static int Main () {
return TestDriver.RunTests (typeof (Tests));
@ -33,6 +37,7 @@ class Tests {
SimpleDelegate d1 = new SimpleDelegate (F1);
SimpleDelegate d2 = new SimpleDelegate (F2);
SimpleDelegate d4 = new SimpleDelegate (F4);
SimpleDelegate d8 = new SimpleDelegate (F8);
if (d1 - d1 != null)
return 1;
@ -82,21 +87,21 @@ class Tests {
if (d12 - d12 != null)
return 21;
if (!check_is_expected_v (d12 - d14, 2))
if (!check_is_expected_v (d12 - d14, 3))
return 22;
if (!check_is_expected_v (d12 - d24, 1))
if (!check_is_expected_v (d12 - d24, 3))
return 23;
if (!check_is_expected_v (d14 - d12, 4))
if (!check_is_expected_v (d14 - d12, 5))
return 24;
if (d14 - d14 != null)
return 25;
if (!check_is_expected_v (d14 - d24, 1))
if (!check_is_expected_v (d14 - d24, 5))
return 26;
if (!check_is_expected_v (d24 - d12, 4))
if (!check_is_expected_v (d24 - d12, 6))
return 27;
if (!check_is_expected_v (d24 - d14, 2))
if (!check_is_expected_v (d24 - d14, 6))
return 28;
if (d24 - d24 != null)
return 29;
@ -112,7 +117,7 @@ class Tests {
if (!check_is_expected_v (d124 - d12, 4))
return 34;
if (!check_is_expected_v (d124 - d14, 2))
if (!check_is_expected_v (d124 - d14, 7))
return 35;
if (!check_is_expected_v (d124 - d24, 1))
return 36;
@ -120,6 +125,35 @@ class Tests {
if (d124 - d124 != null)
return 37;
SimpleDelegate d1248 = d1 + d2 + d4 + d8;
if (!check_is_expected_v (d1248 - (d1 + d2), 12))
return 41;
if (!check_is_expected_v (d1248 - (d1 + d4), 15))
return 42;
if (!check_is_expected_v (d1248 - (d1 + d8), 15))
return 43;
if (!check_is_expected_v (d1248 - (d2 + d4), 9))
return 44;
if (!check_is_expected_v (d1248 - (d2 + d8), 15))
return 45;
if (!check_is_expected_v (d1248 - (d4 + d8), 3))
return 46;
if (!check_is_expected_v (d1248 - (d1 + d2 + d4), 8))
return 51;
if (!check_is_expected_v (d1248 - (d1 + d2 + d8), 15))
return 52;
if (!check_is_expected_v (d1248 - (d1 + d4 + d8), 15))
return 53;
if (!check_is_expected_v (d1248 - (d2 + d4 + d8), 1))
return 54;
if (!check_is_expected_v (d1248 - (d2 + d4 + d8), 1))
return 54;
if (d1248 - d1248 != null)
return 55;
return 0;
}

View File

@ -1 +1 @@
0154d608954f93d6ed2e6b6ee373f26cfa68c19d
1c68c9031703e146bcdb2cfd2aeaf5de8a955704

View File

@ -188,6 +188,9 @@ public class Tests {
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_ref_delegate")]
public static extern int mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del);
public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
@ -210,6 +213,8 @@ public class Tests {
public delegate return_int_delegate ReturnDelegateDelegate ();
public delegate int DelegateByrefDelegate (ref return_int_delegate del);
public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
@ -333,6 +338,20 @@ public class Tests {
return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
}
public static int return_plus_1 (int i) {
return i + 1;
}
public static int ref_delegate_delegate (ref return_int_delegate del) {
del = return_plus_1;
return 0;
}
public static int test_55_marshal_delegate_ref_delegate () {
var del = new DelegateByrefDelegate (ref_delegate_delegate);
return mono_test_marshal_delegate_ref_delegate (del);
}
/* Passing and returning strings */
public delegate String ReturnStringDelegate (String s);

Binary file not shown.

View File

@ -1 +1 @@
1d929b1ba2d06509548b3aa70c1fb24d06087c0e
6f3fb8a9d2b2b9e4b08119337dc9117d4bc61d04

Binary file not shown.

View File

@ -1 +1 @@
a87738a936bb99fc19aec669debef384ab553bdb
0acf885be28a53bab40f9d4e58120c3e4d15671b

Binary file not shown.

View File

@ -1 +1 @@
2d540bc9e9610e2115706b4863b3faf6be94ae02
d283d42f090946cff3eaa02a0725e642ed1b51bf

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mono 4.2.2\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2015-12-18 19:12-0500\n"
"POT-Creation-Date: 2016-01-18 20:20-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
87b1481e5fb0387bb972cc8ff65492ccec2a8ba3
8c9abe322c37a3e40246b2b53c20f760aec98126

View File

@ -636,5 +636,5 @@
/* #undef USE_MONO_MUTEX */
/* Version number of package */
#define VERSION "4.2.1"
#define VERSION "4.2.2"
#endif