mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
Compare commits
45
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1e8599fb7 | ||
|
|
508e0a51cd | ||
|
|
e299219c3f | ||
|
|
36bff327c2 | ||
|
|
52ebfc6a5f | ||
|
|
21ba0055dd | ||
|
|
8497d797c1 | ||
|
|
2298db1166 | ||
|
|
8cfb2d6f14 | ||
|
|
0e5bfe7b13 | ||
|
|
9d8808f2e5 | ||
|
|
1fd9a5edae | ||
|
|
e317d346fb | ||
|
|
0a3328e8ab | ||
|
|
0ce68d6fec | ||
|
|
e486a575f6 | ||
|
|
176bfbc462 | ||
|
|
3555e32abd | ||
|
|
57ec3d8d41 | ||
|
|
81d238e2fc | ||
|
|
3a3cf737c3 | ||
|
|
d15c11b038 | ||
|
|
5c2959f9d0 | ||
|
|
8300404024 | ||
|
|
7bfa0c1771 | ||
|
|
5795ec2676 | ||
|
|
9bea602094 | ||
|
|
c773bf31dc | ||
|
|
0531c65cc8 | ||
|
|
1b62dca6cc | ||
|
|
0a425af914 | ||
|
|
472bc7bfa5 | ||
|
|
7c274c477d | ||
|
|
1bb562b8d5 | ||
|
|
3901f01875 | ||
|
|
cf7d241aab | ||
|
|
40f92d5cb6 | ||
|
|
0895a37089 | ||
|
|
5b8ba7e3ca | ||
|
|
0c35cf5ef0 | ||
|
|
d2a1623a18 | ||
|
|
cb725ff9de | ||
|
|
50f293135f | ||
|
|
11e1a399ac | ||
|
|
61740f8417 |
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [3.2.7],
|
||||
AC_INIT(mono, [3.2.8],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ include ../build/rules.make
|
||||
|
||||
SUBDIRS = $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
|
||||
|
||||
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_dirs)
|
||||
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs)
|
||||
|
||||
# No new makefiles for: System.Messaging, System.Web.Mobile,
|
||||
# System.ServiceProcess
|
||||
|
||||
@@ -167,9 +167,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
|
||||
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, evaluatedMetadata);
|
||||
return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase)
|
||||
? MSBuildUtils.Escape (metadata)
|
||||
: metadata;
|
||||
return MSBuildUtils.Unescape (metadata);
|
||||
}
|
||||
|
||||
if (evaluatedMetadata.Contains (metadataName))
|
||||
@@ -181,10 +179,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public string GetMetadata (string metadataName)
|
||||
{
|
||||
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
|
||||
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata);
|
||||
return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase)
|
||||
? MSBuildUtils.Escape (metadata)
|
||||
: metadata;
|
||||
return ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata);
|
||||
} else if (unevaluatedMetadata.Contains (metadataName))
|
||||
return (string) unevaluatedMetadata [metadataName];
|
||||
else
|
||||
|
||||
@@ -284,6 +284,40 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
Assert.AreEqual (String.Empty, item.GetMetadata ("AccessedTime"), "A13");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetMetadata_UnescapedItemSpec ()
|
||||
{
|
||||
string itemInclude = "a;b;c";
|
||||
string escapedItemInclude = Utilities.Escape (itemInclude);
|
||||
|
||||
item = new BuildItem ("name", itemInclude);
|
||||
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a");
|
||||
Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b");
|
||||
|
||||
Assert.AreEqual (itemInclude, item.GetMetadata ("FileName"), "#2b");
|
||||
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b");
|
||||
|
||||
Assert.AreEqual (itemInclude, item.GetMetadata ("Identity"), "#3a");
|
||||
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("Identity"), "#3b");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetMetadata_EscapedItemSpec ()
|
||||
{
|
||||
string itemInclude = "a;b;c";
|
||||
string escapedItemInclude = Utilities.Escape (itemInclude);
|
||||
|
||||
item = new BuildItem ("name", escapedItemInclude);
|
||||
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a");
|
||||
Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b");
|
||||
|
||||
Assert.AreEqual (escapedItemInclude, item.GetMetadata ("FileName"), "#2b");
|
||||
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b");
|
||||
|
||||
Assert.AreEqual (escapedItemInclude, item.GetMetadata ("Identity"), "#3a");
|
||||
Assert.AreEqual ("a;b;c", item.GetEvaluatedMetadata ("Identity"), "#3b");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentNullException))]
|
||||
public void TestGetMetadata2 ()
|
||||
|
||||
@@ -13,7 +13,7 @@ LIB_MCS_FLAGS = \
|
||||
/r:System.dll \
|
||||
/r:$(XBUILD_FRAMEWORK)
|
||||
|
||||
TEST_MCS_FLAGS = /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll
|
||||
TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll
|
||||
|
||||
include $(XBUILD_DIR)/xbuild_test.make
|
||||
include ../../build/library.make
|
||||
@@ -64,7 +64,6 @@ namespace Microsoft.Build.Utilities
|
||||
if (itemSpec == null)
|
||||
throw new ArgumentNullException ("itemSpec");
|
||||
|
||||
this.itemSpec = itemSpec;
|
||||
this.metadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
|
||||
|
||||
// FIXME: hack
|
||||
@@ -108,9 +107,9 @@ namespace Microsoft.Build.Utilities
|
||||
public string GetMetadata (string metadataName)
|
||||
{
|
||||
if (ReservedNameUtils.IsReservedMetadataName (metadataName))
|
||||
return ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata);
|
||||
return MSBuildUtils.Unescape (ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata));
|
||||
else if (metadata.Contains (metadataName))
|
||||
return (string) metadata [metadataName];
|
||||
return MSBuildUtils.Unescape ((string)metadata [metadataName]);
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
@@ -153,7 +152,7 @@ namespace Microsoft.Build.Utilities
|
||||
}
|
||||
|
||||
public string ItemSpec {
|
||||
get { return itemSpec; }
|
||||
get { return MSBuildUtils.Unescape (itemSpec); }
|
||||
set { itemSpec = value; }
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,8 @@ namespace Mono.XBuild.Utilities {
|
||||
|
||||
switch (metadataName.ToLowerInvariant ()) {
|
||||
case "fullpath":
|
||||
return Path.GetFullPath (itemSpec);
|
||||
var unescapedItemSpec = MSBuildUtils.Unescape (itemSpec);
|
||||
return MSBuildUtils.Escape (Path.GetFullPath (unescapedItemSpec));
|
||||
case "rootdir":
|
||||
if (Path.IsPathRooted (itemSpec))
|
||||
return Path.GetPathRoot (itemSpec);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using NUnit.Framework;
|
||||
@@ -115,6 +116,50 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
new TaskItem ("itemspec", null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtor_EscapedSpecialChar ()
|
||||
{
|
||||
// If we instantiate with the *escaped* metadata, it's unescaped automatically
|
||||
var metadata = "[email protected]";
|
||||
var escapedMetadata = global::Microsoft.Build.BuildEngine.Utilities.Escape ("[email protected]");
|
||||
var item = new TaskItem (escapedMetadata);
|
||||
item.SetMetadata ("mine", escapedMetadata);
|
||||
|
||||
Assert.AreEqual (metadata, item.ItemSpec, "#1");
|
||||
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
|
||||
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
|
||||
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
|
||||
Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtor_EscapedSpecialChar_BrokenEscaping ()
|
||||
{
|
||||
// This is badly escaped, but MSBuild does not care.
|
||||
var metadata = "foo%[email protected]";
|
||||
var item = new TaskItem (metadata);
|
||||
|
||||
Assert.AreEqual (metadata, item.ItemSpec, "#1");
|
||||
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
|
||||
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
|
||||
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtor_UnescapedSpecialChar ()
|
||||
{
|
||||
// If we instantiate with unescaped metadata, we get the same value back
|
||||
var metadata = "[email protected]";
|
||||
var item = new TaskItem (metadata);
|
||||
item.SetMetadata ("mine", metadata);
|
||||
|
||||
Assert.AreEqual (metadata, item.ItemSpec, "#1");
|
||||
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
|
||||
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
|
||||
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
|
||||
Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCopyConstructor ()
|
||||
{
|
||||
@@ -240,5 +285,19 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
item = new TaskItem ("lalala");
|
||||
item.SetMetadata ("Identity", "some value");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSetItemSpec ()
|
||||
{
|
||||
var itemSpec = "[email protected]";
|
||||
var escapedItemSpec = global::Microsoft.Build.BuildEngine.Utilities.Escape (itemSpec);
|
||||
|
||||
var item = new TaskItem ("foo");
|
||||
item.ItemSpec = itemSpec;
|
||||
Assert.AreEqual (itemSpec, item.ItemSpec, "#1");
|
||||
|
||||
item.ItemSpec = escapedItemSpec;
|
||||
Assert.AreEqual (itemSpec, item.ItemSpec, "#2");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ namespace System.Numerics {
|
||||
public static Complex Cosh (Complex value)
|
||||
{
|
||||
return new Complex (Math.Cosh (value.real) * Math.Cos (value.imaginary),
|
||||
-Math.Sinh (value.real) * Math.Sin (value.imaginary));
|
||||
Math.Sinh (value.real) * Math.Sin (value.imaginary));
|
||||
}
|
||||
|
||||
public static Complex Negate (Complex value)
|
||||
|
||||
@@ -918,7 +918,7 @@ namespace System.Diagnostics {
|
||||
IntPtr stderr,
|
||||
ref ProcInfo proc_info);
|
||||
|
||||
private static bool Start_shell (ProcessStartInfo startInfo)
|
||||
private static bool Start_shell (ProcessStartInfo startInfo, Process process)
|
||||
{
|
||||
ProcInfo proc_info=new ProcInfo();
|
||||
bool ret;
|
||||
@@ -945,6 +945,9 @@ namespace System.Diagnostics {
|
||||
throw new Win32Exception (-proc_info.pid);
|
||||
}
|
||||
|
||||
process.process_handle = proc_info.process_handle;
|
||||
process.pid = proc_info.pid;
|
||||
process.StartExitCallbackIfNeeded ();
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -1156,7 +1159,7 @@ namespace System.Diagnostics {
|
||||
if (startInfo.UseShellExecute) {
|
||||
if (!String.IsNullOrEmpty (startInfo.UserName))
|
||||
throw new InvalidOperationException ("UserShellExecute must be false if an explicit UserName is specified when starting a process");
|
||||
return (Start_shell (startInfo));
|
||||
return (Start_shell (startInfo, process));
|
||||
} else {
|
||||
return (Start_noshell (startInfo, process));
|
||||
}
|
||||
@@ -1176,12 +1179,9 @@ namespace System.Diagnostics {
|
||||
if (startInfo == null)
|
||||
throw new ArgumentNullException ("startInfo");
|
||||
|
||||
Process process = null;
|
||||
if (!startInfo.UseShellExecute) {
|
||||
process = new Process();
|
||||
process.StartInfo = startInfo;
|
||||
}
|
||||
if (Start_common(startInfo, process))
|
||||
Process process = new Process();
|
||||
process.StartInfo = startInfo;
|
||||
if (Start_common(startInfo, process) && process.process_handle != IntPtr.Zero)
|
||||
return process;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace System.Net {
|
||||
public bool IsIPv6Teredo {
|
||||
get {
|
||||
return m_Family != AddressFamily.InterNetwork &&
|
||||
m_Numbers[0] == 0x2001 &&
|
||||
NetworkToHostOrder ((short) m_Numbers [0]) == 0x2001 &&
|
||||
m_Numbers[1] == 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,23 +48,20 @@ namespace System
|
||||
this.item7 = item7;
|
||||
this.rest = rest;
|
||||
|
||||
bool ok = true;
|
||||
if (!typeof (TRest).IsGenericType)
|
||||
ok = false;
|
||||
if (ok) {
|
||||
Type t = typeof (TRest).GetGenericTypeDefinition ();
|
||||
if (!(t == typeof (Tuple<>) || t == typeof (Tuple<,>) || t == typeof (Tuple<,,>) || t == typeof (Tuple<,,,>) || t == typeof (Tuple<,,,,>) || t == typeof (Tuple <,,,,,>) || t == typeof (Tuple<,,,,,,>) || t == typeof (Tuple<,,,,,,,>)))
|
||||
ok = false;
|
||||
}
|
||||
if (!ok)
|
||||
if (!(rest is ITuple))
|
||||
throw new ArgumentException ("rest", "The last element of an eight element tuple must be a Tuple.");
|
||||
}
|
||||
}
|
||||
|
||||
interface ITuple
|
||||
{
|
||||
string ToString ();
|
||||
}
|
||||
|
||||
/* The rest is generated by the script at the bottom */
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
|
||||
@@ -117,14 +114,19 @@ namespace System
|
||||
return comparer.GetHashCode (item1);
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}", item1);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0})", item1);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -189,14 +191,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}", item1, item2);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1})", item1, item2);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -271,14 +278,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}", item1, item2, item3);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2})", item1, item2, item3);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -364,14 +376,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}, {3}", item1, item2, item3, item4);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2}, {3})", item1, item2, item3, item4);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -467,14 +484,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}, {3}, {4}", item1, item2, item3, item4, item5);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2}, {3}, {4})", item1, item2, item3, item4, item5);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -581,14 +603,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}", item1, item2, item3, item4, item5, item6);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2}, {3}, {4}, {5})", item1, item2, item3, item4, item5, item6);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -705,14 +732,19 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}, {6}", item1, item2, item3, item4, item5, item6, item7);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2}, {3}, {4}, {5}, {6})", item1, item2, item3, item4, item5, item6, item7);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable
|
||||
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
|
||||
{
|
||||
T1 item1;
|
||||
T2 item2;
|
||||
@@ -828,9 +860,14 @@ namespace System
|
||||
return h0;
|
||||
}
|
||||
|
||||
string ITuple.ToString ()
|
||||
{
|
||||
return String.Format ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", item1, item2, item3, item4, item5, item6, item7, ((ITuple)rest).ToString ());
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", item1, item2, item3, item4, item5, item6, item7, rest);
|
||||
return "(" + ((ITuple) this).ToString () + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,11 +893,11 @@ public class TupleGen
|
||||
Console.WriteLine ("\t[Serializable]");
|
||||
Console.Write ("\tpublic {0}class ", arity < 8 ? null : "partial ");
|
||||
Console.Write (type_name);
|
||||
Console.WriteLine (" : IStructuralEquatable, IStructuralComparable, IComparable");
|
||||
Console.WriteLine (" : IStructuralEquatable, IStructuralComparable, IComparable, ITuple");
|
||||
Console.WriteLine ("\t{");
|
||||
for (int i = 1; i <= arity; ++i)
|
||||
Console.WriteLine ("\t\t{0} {1};", GetItemTypeName (i), GetItemName (i));
|
||||
|
||||
|
||||
if (arity < 8) {
|
||||
Console.WriteLine ();
|
||||
Console.Write ("\t\tpublic Tuple (");
|
||||
@@ -890,7 +927,7 @@ public class TupleGen
|
||||
Console.WriteLine ("\t\t{");
|
||||
Console.WriteLine ("\t\t\treturn ((IStructuralComparable) this).CompareTo (obj, Comparer<object>.Default);");
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tint IStructuralComparable.CompareTo (object other, IComparer comparer)");
|
||||
Console.WriteLine ("\t\t{");
|
||||
@@ -900,7 +937,7 @@ public class TupleGen
|
||||
Console.WriteLine ("\t\t\t\tthrow new ArgumentException (\"other\");");
|
||||
Console.WriteLine ("\t\t\t}");
|
||||
Console.WriteLine ();
|
||||
|
||||
|
||||
for (int i = 1; i < arity; ++i) {
|
||||
Console.Write ("\t\t\t");
|
||||
if (i == 1)
|
||||
@@ -910,14 +947,14 @@ public class TupleGen
|
||||
Console.WriteLine ("\t\t\tif (res != 0) return res;");
|
||||
}
|
||||
Console.WriteLine ("\t\t\treturn comparer.Compare ({0}, t.{0});", GetItemName (arity));
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tpublic override bool Equals (object obj)");
|
||||
Console.WriteLine ("\t\t{");
|
||||
Console.WriteLine ("\t\t\treturn ((IStructuralEquatable) this).Equals (obj, EqualityComparer<object>.Default);");
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tbool IStructuralEquatable.Equals (object other, IEqualityComparer comparer)");
|
||||
Console.WriteLine ("\t\t{");
|
||||
@@ -926,7 +963,7 @@ public class TupleGen
|
||||
Console.WriteLine ("\t\t\t\treturn false;");
|
||||
Console.WriteLine ();
|
||||
Console.Write ("\t\t\treturn");
|
||||
|
||||
|
||||
for (int i = 1; i <= arity; ++i) {
|
||||
if (i == 1)
|
||||
Console.Write (" ");
|
||||
@@ -940,26 +977,26 @@ public class TupleGen
|
||||
Console.WriteLine (";");
|
||||
}
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tpublic override int GetHashCode ()");
|
||||
Console.WriteLine ("\t\t{");
|
||||
Console.WriteLine ("\t\t\treturn ((IStructuralEquatable) this).GetHashCode (EqualityComparer<object>.Default);");
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tint IStructuralEquatable.GetHashCode (IEqualityComparer comparer)");
|
||||
Console.WriteLine ("\t\t{");
|
||||
if (arity == 1) {
|
||||
Console.WriteLine ("\t\t\treturn comparer.GetHashCode ({0});", GetItemName (arity));
|
||||
} else {
|
||||
int varnum = IntLog2(arity);
|
||||
int varnum = IntLog2 (arity);
|
||||
Console.Write ("\t\t\tint h0");
|
||||
for (int i = 1; i < varnum; ++i)
|
||||
Console.Write (", h{0}", i);
|
||||
Console.WriteLine (";");
|
||||
|
||||
WriteHash(0, 1, arity);
|
||||
WriteHash (0, 1, arity);
|
||||
|
||||
Console.WriteLine ("\t\t\treturn h0;");
|
||||
}
|
||||
@@ -967,23 +1004,30 @@ public class TupleGen
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tpublic override string ToString ()");
|
||||
Console.WriteLine ("\t\tstring ITuple.ToString ()");
|
||||
Console.WriteLine ("\t\t{");
|
||||
Console.Write ("\t\t\treturn String.Format (\"(");
|
||||
Console.Write ("\t\t\treturn String.Format (\"");
|
||||
for (int i = 1; i <= arity; ++i) {
|
||||
Console.Write ("{" + (i - 1) + "}");
|
||||
if (i < arity)
|
||||
Console.Write (", ");
|
||||
}
|
||||
Console.Write (")\", ");
|
||||
Console.Write ("\", ");
|
||||
for (int i = 1; i <= arity; ++i) {
|
||||
Console.Write (GetItemName (i));
|
||||
var item_name = GetItemName (i);
|
||||
Console.Write (i == 8 ? "((ITuple){0}).ToString ()" : "{0}", item_name);
|
||||
if (i < arity)
|
||||
Console.Write (", ");
|
||||
}
|
||||
Console.WriteLine (");");
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("\t\tpublic override string ToString ()");
|
||||
Console.WriteLine ("\t\t{");
|
||||
Console.WriteLine ("\t\t\treturn \"(\" + ((ITuple) this).ToString () + \")\";");
|
||||
Console.WriteLine ("\t\t}");
|
||||
|
||||
Console.WriteLine ("\t}\n");
|
||||
}
|
||||
}
|
||||
@@ -1005,15 +1049,15 @@ public class TupleGen
|
||||
if (count == 1) {
|
||||
Console.WriteLine ("\t\t\th{0} = comparer.GetHashCode ({1});", destVar, GetItemName (start));
|
||||
} else {
|
||||
int subCount = 1 << IntLog2(count-1);
|
||||
computeHash(destVar, start, subCount);
|
||||
int subCount = 1 << IntLog2 (count - 1);
|
||||
WriteHash (destVar, start, subCount);
|
||||
start += subCount;
|
||||
count -= subCount;
|
||||
if (count == 1) {
|
||||
Console.WriteLine ("\t\t\th{0} = (h{0} << 5) + h{0} ^ comparer.GetHashCode ({1});", destVar, GetItemName (start));
|
||||
} else {
|
||||
WriteHash(destVar+1, start, count);
|
||||
Console.WriteLine ("\t\t\th{0} = (h{0} << 5) + h{0} ^ h{1};", destVar, destVar+1);
|
||||
WriteHash (destVar + 1, start, count);
|
||||
Console.WriteLine ("\t\t\th{0} = (h{0} << 5) + h{0} ^ h{1};", destVar, destVar + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1028,19 +1072,20 @@ public class TupleGen
|
||||
sb.Append (", ");
|
||||
}
|
||||
sb.Append (">");
|
||||
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
|
||||
static string GetItemName (int arity)
|
||||
{
|
||||
return arity < 8 ? "item" + arity.ToString () : "rest";
|
||||
}
|
||||
|
||||
|
||||
static string GetItemTypeName (int arity)
|
||||
{
|
||||
return arity < 8 ? "T" + arity.ToString () : "TRest";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// TupleTest.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar <[email protected]>
|
||||
//
|
||||
// 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_0
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System
|
||||
{
|
||||
[TestFixture]
|
||||
public class TupleTest
|
||||
{
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void TupleWithRest_Invalid ()
|
||||
{
|
||||
new Tuple<int, int, int, int, int, int, int, int> (1, 2, 3, 4, 5, 6, 7, 8);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void TupleWithRest_InvalidDueToNull ()
|
||||
{
|
||||
new Tuple<int, object, int, int, int, int, int, Tuple<string, string>> (1, null, 3, 4, 5, 6, 7, null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToStringTest ()
|
||||
{
|
||||
var t1 = new Tuple<int, object, int, int, int, int, int, Tuple<string, string>> (1, null, 3, 4, 5, 6, 7, new Tuple<string, string> (null, null));
|
||||
|
||||
Assert.AreEqual ("(1, , 3, 4, 5, 6, 7, , )", t1.ToString (), "#1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -25,6 +25,7 @@ System/ModuleHandleTest.cs
|
||||
System/ObsoleteAttributeTest.cs
|
||||
System/IntegerTryParse.cs
|
||||
System/LazyTest.cs
|
||||
System/TupleTest.cs
|
||||
System.Collections/ArrayListTest.cs
|
||||
System.Collections/BitArrayTest.cs
|
||||
System.Collections/CaseInsensitiveComparerTest.cs
|
||||
|
||||
@@ -53,6 +53,8 @@ install-pcl-targets:
|
||||
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.CSharp.targets
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5
|
||||
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.CSharp.targets
|
||||
$(INSTALL_DATA) targets/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
|
||||
$(INSTALL_DATA) targets/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
|
||||
|
||||
install-web-targets:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/v9.0/WebApplications
|
||||
@@ -69,20 +71,25 @@ EXTRA_DISTFILES = \
|
||||
data/2.0/Microsoft.Common.tasks \
|
||||
data/3.5/Microsoft.Common.tasks \
|
||||
data/4.0/Microsoft.Common.tasks \
|
||||
data/12.0/Microsoft.Common.tasks \
|
||||
data/2.0/Microsoft.Common.targets \
|
||||
data/3.5/Microsoft.Common.targets \
|
||||
data/4.0/Microsoft.Common.targets \
|
||||
data/12.0/Microsoft.Common.targets \
|
||||
data/Microsoft.CSharp.targets \
|
||||
data/Microsoft.VisualBasic.targets \
|
||||
data/MSBuild/Microsoft.Build.CommonTypes.xsd \
|
||||
data/MSBuild/Microsoft.Build.Core.xsd \
|
||||
frameworks/net_2.0.xml \
|
||||
frameworks/net_3.0.xml \
|
||||
frameworks/net_3.5.xml \
|
||||
frameworks/net_4.0.xml \
|
||||
frameworks/net_4.0_client.xml \
|
||||
frameworks/net_4.5.xml \
|
||||
targets/Microsoft.Portable.CSharp_4.0.targets \
|
||||
targets/Microsoft.Portable.CSharp_4.5.targets \
|
||||
targets/Microsoft.VisualBasic.targets \
|
||||
targets/Microsoft.Portable.Core.targets \
|
||||
targets/Microsoft.Portable.Core.props \
|
||||
targets/Microsoft.WebApplication.targets \
|
||||
targets/Microsoft.Portable.CSharp.targets \
|
||||
xbuild_tests.make
|
||||
xbuild.make \
|
||||
xbuild_test.make
|
||||
@@ -1,43 +1,5 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<AvailablePlatforms>Any CPU</AvailablePlatforms>
|
||||
|
||||
<TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
|
||||
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
|
||||
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
|
||||
<ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.Targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<ResolveReferencesDependsOn>
|
||||
$(ResolveReferencesDependsOn);
|
||||
ImplicitlyExpandTargetFramework;
|
||||
</ResolveReferencesDependsOn>
|
||||
|
||||
<ImplicitlyExpandTargetFrameworkDependsOn>
|
||||
$(ImplicitlyExpandTargetFrameworkDependsOn);
|
||||
GetReferenceAssemblyPaths
|
||||
</ImplicitlyExpandTargetFrameworkDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="ImplicitlyExpandTargetFramework"
|
||||
DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
|
||||
|
||||
<ItemGroup>
|
||||
<ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
|
||||
<ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
|
||||
<CopyLocal>false</CopyLocal>
|
||||
<ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
|
||||
<IsSystemReference>True</IsSystemReference>
|
||||
</ReferencePath>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Import Project="..\Microsoft.Portable.Core.props" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\Microsoft.Portable.Core.targets" />
|
||||
</Project>
|
||||
@@ -1,3 +1,5 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Portable.CSharp.Targets" />
|
||||
<Import Project="..\Microsoft.Portable.Core.props" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\Microsoft.Portable.Core.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<AvailablePlatforms>Any CPU</AvailablePlatforms>
|
||||
|
||||
<TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
|
||||
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
|
||||
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
|
||||
<ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ResolveReferencesDependsOn>
|
||||
$(ResolveReferencesDependsOn);
|
||||
ImplicitlyExpandTargetFramework;
|
||||
</ResolveReferencesDependsOn>
|
||||
|
||||
<ImplicitlyExpandTargetFrameworkDependsOn>
|
||||
$(ImplicitlyExpandTargetFrameworkDependsOn);
|
||||
GetReferenceAssemblyPaths
|
||||
</ImplicitlyExpandTargetFrameworkDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="ImplicitlyExpandTargetFramework"
|
||||
DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
|
||||
|
||||
<ItemGroup>
|
||||
<ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
|
||||
<ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
|
||||
<CopyLocal>false</CopyLocal>
|
||||
<ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
|
||||
<IsSystemReference>True</IsSystemReference>
|
||||
</ReferencePath>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
+14
-7
@@ -1287,6 +1287,7 @@ Mono development tools.
|
||||
%_libdir/pkgconfig/mono-lineeditor.pc
|
||||
%_libdir/pkgconfig/mono-options.pc
|
||||
%_libdir/pkgconfig/mono.pc
|
||||
%_libdir/pkgconfig/xbuild12.pc
|
||||
%_mandir/man1/al.1%ext_man
|
||||
%_mandir/man1/ccrewrite.1%ext_man
|
||||
%_mandir/man1/cccheck.1%ext_man
|
||||
@@ -1327,6 +1328,7 @@ Mono development tools.
|
||||
%_prefix/lib/mono/2.0/Microsoft.Common.tasks
|
||||
%_prefix/lib/mono/2.0/Microsoft.VisualBasic.targets
|
||||
%_prefix/lib/mono/2.0/Mono.Debugger.Soft.dll
|
||||
%_prefix/lib/mono/2.0/Mono.XBuild.Tasks.dll
|
||||
%_prefix/lib/mono/2.0/PEAPI.dll
|
||||
%_prefix/lib/mono/2.0/genxs.exe*
|
||||
%_prefix/lib/mono/2.0/ilasm.exe*
|
||||
@@ -1346,29 +1348,31 @@ Mono development tools.
|
||||
%_prefix/lib/mono/3.5/Microsoft.Common.targets
|
||||
%_prefix/lib/mono/3.5/Microsoft.Common.tasks
|
||||
%_prefix/lib/mono/3.5/Microsoft.VisualBasic.targets
|
||||
%_prefix/lib/mono/3.5/Mono.XBuild.Tasks.dll
|
||||
%_prefix/lib/mono/3.5/xbuild.exe*
|
||||
%_prefix/lib/mono/3.5/xbuild.rsp
|
||||
%_prefix/lib/mono/4.0/MSBuild
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.dll
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.Engine.dll
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.Framework.dll
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.Tasks.v4.0.dll
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.Utilities.v4.0.dll
|
||||
%_prefix/lib/mono/4.0/Microsoft.Build.xsd
|
||||
%_prefix/lib/mono/4.0/Microsoft.CSharp.targets
|
||||
%_prefix/lib/mono/4.0/Microsoft.Common.targets
|
||||
%_prefix/lib/mono/4.0/Microsoft.Common.tasks
|
||||
%_prefix/lib/mono/4.0/Microsoft.VisualBasic.targets
|
||||
%_prefix/lib/mono/4.0/Microsoft.Portable.CSharp.targets
|
||||
%_prefix/lib/mono/4.0/Mono.Debugger.Soft.dll
|
||||
%_prefix/lib/mono/4.0/Mono.XBuild.Tasks.dll
|
||||
%_prefix/lib/mono/4.0/PEAPI.dll
|
||||
%_prefix/lib/mono/4.5/MSBuild
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.dll
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.Engine.dll
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.Framework.dll
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.Tasks.v4.0.dll
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll
|
||||
%_prefix/lib/mono/4.5/Microsoft.Build.xsd
|
||||
%_prefix/lib/mono/4.5/Microsoft.CSharp.targets
|
||||
%_prefix/lib/mono/4.5/Microsoft.Common.targets
|
||||
%_prefix/lib/mono/4.5/Microsoft.Common.tasks
|
||||
%_prefix/lib/mono/4.5/Microsoft.VisualBasic.targets
|
||||
%_prefix/lib/mono/4.5/Mono.Debugger.Soft.dll
|
||||
%_prefix/lib/mono/4.5/Mono.CodeContracts.dll
|
||||
%_prefix/lib/mono/4.5/Mono.XBuild.Tasks.dll
|
||||
%_prefix/lib/mono/4.5/PEAPI.dll
|
||||
%_prefix/lib/mono/4.5/caspol.exe*
|
||||
%_prefix/lib/mono/4.5/cccheck.exe*
|
||||
@@ -1406,11 +1410,14 @@ Mono development tools.
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Tasks
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v3.5
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v4.0
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v12.0
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Utilities
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v3.5
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v4.0
|
||||
%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v12.0
|
||||
%_prefix/lib/mono/gac/Mono.CodeContracts
|
||||
%_prefix/lib/mono/gac/Mono.Debugger.Soft
|
||||
%_prefix/lib/mono/gac/Mono.XBuild.Tasks
|
||||
%_prefix/lib/mono/gac/PEAPI
|
||||
%_prefix/lib/mono/xbuild
|
||||
%_prefix/lib/mono/xbuild-frameworks
|
||||
|
||||
@@ -380,6 +380,9 @@ gboolean ShellExecuteEx (WapiShellExecuteInfo *sei)
|
||||
SetLastError (ERROR_INVALID_DATA);
|
||||
return FALSE;
|
||||
}
|
||||
/* Shell exec should not return a process handle when it spawned a GUI thing, like a browser. */
|
||||
CloseHandle (process_info.hProcess);
|
||||
process_info.hProcess = NULL;
|
||||
}
|
||||
|
||||
if (sei->fMask & SEE_MASK_NOCLOSEPROCESS) {
|
||||
|
||||
@@ -2189,7 +2189,7 @@ zero_static_data (MonoVTable *vtable)
|
||||
void *data;
|
||||
|
||||
if (klass->has_static_refs && (data = mono_vtable_get_static_field_data (vtable)))
|
||||
mono_gc_bzero (data, mono_class_data_size (klass));
|
||||
mono_gc_bzero_aligned (data, mono_class_data_size (klass));
|
||||
}
|
||||
|
||||
typedef struct unload_data {
|
||||
|
||||
@@ -758,7 +758,7 @@ mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname)
|
||||
{
|
||||
MonoTableInfo *t = &image->tables [MONO_TABLE_ASSEMBLY];
|
||||
guint32 cols [MONO_ASSEMBLY_SIZE];
|
||||
gint32 machine;
|
||||
gint32 machine, flags;
|
||||
|
||||
if (!t->rows)
|
||||
return FALSE;
|
||||
@@ -804,9 +804,16 @@ mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname)
|
||||
aname->public_key = 0;
|
||||
|
||||
machine = ((MonoCLIImageInfo*)(image->image_info))->cli_header.coff.coff_machine;
|
||||
flags = ((MonoCLIImageInfo*)(image->image_info))->cli_cli_header.ch_flags;
|
||||
switch (machine) {
|
||||
case COFF_MACHINE_I386:
|
||||
aname->arch = MONO_PROCESSOR_ARCHITECTURE_X86;
|
||||
/* https://bugzilla.xamarin.com/show_bug.cgi?id=17632 */
|
||||
if (flags & (CLI_FLAGS_32BITREQUIRED|CLI_FLAGS_PREFERRED32BIT))
|
||||
aname->arch = MONO_PROCESSOR_ARCHITECTURE_X86;
|
||||
else if ((flags & 0x70) == 0x70)
|
||||
aname->arch = MONO_PROCESSOR_ARCHITECTURE_NONE;
|
||||
else
|
||||
aname->arch = MONO_PROCESSOR_ARCHITECTURE_MSIL;
|
||||
break;
|
||||
case COFF_MACHINE_IA64:
|
||||
aname->arch = MONO_PROCESSOR_ARCHITECTURE_IA64;
|
||||
@@ -2562,16 +2569,23 @@ assembly_binding_info_parsed (MonoAssemblyBindingInfo *info, void *user_data)
|
||||
domain->assembly_bindings = g_slist_append_mempool (domain->mp, domain->assembly_bindings, info_copy);
|
||||
}
|
||||
|
||||
static int
|
||||
get_version_number (int major, int minor)
|
||||
{
|
||||
return major * 256 + minor;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
info_major_minor_in_range (MonoAssemblyBindingInfo *info, MonoAssemblyName *aname)
|
||||
{
|
||||
int aname_version_number = get_version_number (aname->major, aname->minor);
|
||||
if (!info->has_old_version_bottom)
|
||||
return FALSE;
|
||||
|
||||
if (info->old_version_bottom.major > aname->major || info->old_version_bottom.minor > aname->minor)
|
||||
if (get_version_number (info->old_version_bottom.major, info->old_version_bottom.minor) > aname_version_number)
|
||||
return FALSE;
|
||||
|
||||
if (info->has_old_version_top && (info->old_version_top.major < aname->major || info->old_version_top.minor < aname->minor))
|
||||
if (info->has_old_version_top && get_version_number (info->old_version_top.major, info->old_version_top.minor) < aname_version_number)
|
||||
return FALSE;
|
||||
|
||||
/* This is not the nicest way to do it, but it's a by-product of the way parsing is done */
|
||||
|
||||
@@ -619,7 +619,7 @@ mono_gc_wbarrier_set_arrayref (MonoArray *arr, gpointer slot_ptr, MonoObject* va
|
||||
void
|
||||
mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count)
|
||||
{
|
||||
mono_gc_memmove (dest_ptr, src_ptr, count * sizeof (gpointer));
|
||||
mono_gc_memmove_aligned (dest_ptr, src_ptr, count * sizeof (gpointer));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -642,14 +642,14 @@ mono_gc_wbarrier_generic_nostore (gpointer ptr)
|
||||
void
|
||||
mono_gc_wbarrier_value_copy (gpointer dest, gpointer src, int count, MonoClass *klass)
|
||||
{
|
||||
mono_gc_memmove (dest, src, count * mono_class_value_size (klass, NULL));
|
||||
mono_gc_memmove_atomic (dest, src, count * mono_class_value_size (klass, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src)
|
||||
{
|
||||
/* do not copy the sync state */
|
||||
mono_gc_memmove ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
mono_gc_memmove_aligned ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
mono_object_class (obj)->instance_size - sizeof (MonoObject));
|
||||
}
|
||||
|
||||
|
||||
@@ -295,6 +295,7 @@ typedef struct {
|
||||
#define CLI_FLAGS_ILONLY 0x01
|
||||
#define CLI_FLAGS_32BITREQUIRED 0x02
|
||||
#define CLI_FLAGS_STRONGNAMESIGNED 0x8
|
||||
#define CLI_FLAGS_PREFERRED32BIT 0x10
|
||||
#define CLI_FLAGS_TRACKDEBUGDATA 0x00010000
|
||||
guint32 ch_flags;
|
||||
|
||||
|
||||
@@ -468,6 +468,8 @@ match_class (MonoMethodDesc *desc, int pos, MonoClass *klass)
|
||||
gboolean
|
||||
mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
|
||||
{
|
||||
if (!desc->klass)
|
||||
return FALSE;
|
||||
if (!match_class (desc, strlen (desc->klass), method->klass))
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -2346,7 +2346,7 @@ mono_domain_add_class_static_data (MonoDomain *domain, MonoClass *klass, gpointe
|
||||
if (next >= size) {
|
||||
/* 'data' is allocated by alloc_fixed */
|
||||
gpointer *new_array = mono_gc_alloc_fixed (sizeof (gpointer) * (size * 2), MONO_GC_ROOT_DESCR_FOR_FIXED (size * 2));
|
||||
mono_gc_memmove (new_array, domain->static_data_array, sizeof (gpointer) * size);
|
||||
mono_gc_memmove_aligned (new_array, domain->static_data_array, sizeof (gpointer) * size);
|
||||
size *= 2;
|
||||
new_array [1] = GINT_TO_POINTER (size);
|
||||
mono_gc_free_fixed (domain->static_data_array);
|
||||
|
||||
@@ -360,8 +360,10 @@ BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reser
|
||||
Those functions must be used when it's possible that either destination is not
|
||||
word aligned or size is not a multiple of word size.
|
||||
*/
|
||||
void mono_gc_bzero (void *dest, size_t size) MONO_INTERNAL;
|
||||
void mono_gc_memmove (void *dest, const void *src, size_t size) MONO_INTERNAL;
|
||||
void mono_gc_bzero_atomic (void *dest, size_t size) MONO_INTERNAL;
|
||||
void mono_gc_bzero_aligned (void *dest, size_t size) MONO_INTERNAL;
|
||||
void mono_gc_memmove_atomic (void *dest, const void *src, size_t size) MONO_INTERNAL;
|
||||
void mono_gc_memmove_aligned (void *dest, const void *src, size_t size) MONO_INTERNAL;
|
||||
|
||||
guint mono_gc_get_vtable_bits (MonoClass *class) MONO_INTERNAL;
|
||||
|
||||
|
||||
+52
-36
@@ -59,39 +59,24 @@
|
||||
__d [__i] = NULL; \
|
||||
} while (0)
|
||||
|
||||
|
||||
/**
|
||||
* mono_gc_bzero:
|
||||
* mono_gc_bzero_aligned:
|
||||
* @dest: address to start to clear
|
||||
* @size: size of the region to clear
|
||||
*
|
||||
* Zero @size bytes starting at @dest.
|
||||
*
|
||||
* Use this to zero memory that can hold managed pointers.
|
||||
* The address of @dest MUST be aligned to word boundaries
|
||||
*
|
||||
* FIXME borrow faster code from some BSD libc or bionic
|
||||
*/
|
||||
void
|
||||
mono_gc_bzero (void *dest, size_t size)
|
||||
mono_gc_bzero_aligned (void *dest, size_t size)
|
||||
{
|
||||
volatile char *d = (char*)dest;
|
||||
size_t tail_bytes, word_bytes;
|
||||
|
||||
/*
|
||||
If we're copying less than a word, just use memset.
|
||||
|
||||
We cannot bail out early if both are aligned because some implementations
|
||||
use byte copying for sizes smaller than 16. OSX, on this case.
|
||||
*/
|
||||
if (size < sizeof(void*)) {
|
||||
memset (dest, 0, size);
|
||||
return;
|
||||
}
|
||||
|
||||
/*align to word boundary */
|
||||
while (unaligned_bytes (d) && size) {
|
||||
*d++ = 0;
|
||||
--size;
|
||||
}
|
||||
g_assert (unaligned_bytes (dest) == 0);
|
||||
|
||||
/* copy all words with memmove */
|
||||
word_bytes = (size_t)align_down (size);
|
||||
@@ -121,6 +106,24 @@ mono_gc_bzero (void *dest, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_gc_bzero_atomic:
|
||||
* @dest: address to start to clear
|
||||
* @size: size of the region to clear
|
||||
*
|
||||
* Zero @size bytes starting at @dest.
|
||||
*
|
||||
* Use this to zero memory without word tearing when dest is aligned.
|
||||
*/
|
||||
void
|
||||
mono_gc_bzero_atomic (void *dest, size_t size)
|
||||
{
|
||||
if (unaligned_bytes (dest))
|
||||
memset (dest, 0, size);
|
||||
else
|
||||
mono_gc_bzero_aligned (dest, size);
|
||||
}
|
||||
|
||||
#define MEMMOVE_WORDS_UPWARD(dest,src,words) do { \
|
||||
void * volatile *__d = (void* volatile*)(dest); \
|
||||
void **__s = (void**)(src); \
|
||||
@@ -139,19 +142,22 @@ mono_gc_bzero (void *dest, size_t size)
|
||||
__d [__i] = __s [__i]; \
|
||||
} while (0)
|
||||
|
||||
|
||||
/**
|
||||
* mono_gc_memmove:
|
||||
* mono_gc_memmove_aligned:
|
||||
* @dest: destination of the move
|
||||
* @src: source
|
||||
* @size: size of the block to move
|
||||
*
|
||||
* Move @size bytes from @src to @dest.
|
||||
* size MUST be a multiple of sizeof (gpointer)
|
||||
*
|
||||
*/
|
||||
void
|
||||
mono_gc_memmove (void *dest, const void *src, size_t size)
|
||||
* Use this to copy memory without word tearing when both pointers are aligned
|
||||
*/void
|
||||
mono_gc_memmove_aligned (void *dest, const void *src, size_t size)
|
||||
{
|
||||
g_assert (unaligned_bytes (dest) == 0);
|
||||
g_assert (unaligned_bytes (src) == 0);
|
||||
|
||||
/*
|
||||
If we're copying less than a word we don't need to worry about word tearing
|
||||
so we bailout to memmove early.
|
||||
@@ -170,7 +176,7 @@ mono_gc_memmove (void *dest, const void *src, size_t size)
|
||||
* using memmove, which must handle it.
|
||||
*/
|
||||
if (dest > src && ((size_t)((char*)dest - (char*)src) < size)) { /*backward copy*/
|
||||
volatile char *p = (char*)dest + size;
|
||||
volatile char *p = (char*)dest + size;
|
||||
char *s = (char*)src + size;
|
||||
char *start = (char*)dest;
|
||||
char *align_end = MAX((char*)dest, (char*)align_down (p));
|
||||
@@ -178,27 +184,18 @@ mono_gc_memmove (void *dest, const void *src, size_t size)
|
||||
size_t bytes_to_memmove;
|
||||
|
||||
while (p > align_end)
|
||||
*--p = *--s;
|
||||
*--p = *--s;
|
||||
|
||||
word_start = align_up (start);
|
||||
bytes_to_memmove = p - word_start;
|
||||
p -= bytes_to_memmove;
|
||||
s -= bytes_to_memmove;
|
||||
MEMMOVE_WORDS_DOWNWARD (p, s, bytes_to_words (bytes_to_memmove));
|
||||
|
||||
while (p > start)
|
||||
*--p = *--s;
|
||||
} else {
|
||||
volatile char *d = (char*)dest;
|
||||
const char *s = (const char*)src;
|
||||
size_t tail_bytes;
|
||||
|
||||
/*align to word boundary */
|
||||
while (unaligned_bytes (d)) {
|
||||
*d++ = *s++;
|
||||
--size;
|
||||
}
|
||||
|
||||
/* copy all words with memmove */
|
||||
MEMMOVE_WORDS_UPWARD (d, s, bytes_to_words (align_down (size)));
|
||||
|
||||
@@ -212,3 +209,22 @@ mono_gc_memmove (void *dest, const void *src, size_t size)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_gc_memmove_atomic:
|
||||
* @dest: destination of the move
|
||||
* @src: source
|
||||
* @size: size of the block to move
|
||||
*
|
||||
* Move @size bytes from @src to @dest.
|
||||
*
|
||||
* Use this to copy memory without word tearing when both pointers are aligned
|
||||
*/
|
||||
void
|
||||
mono_gc_memmove_atomic (void *dest, const void *src, size_t size)
|
||||
{
|
||||
if (unaligned_bytes (_toi (dest) | _toi (src)))
|
||||
memmove (dest, src, size);
|
||||
else
|
||||
mono_gc_memmove_aligned (dest, src, size);
|
||||
}
|
||||
+1
-1
@@ -676,7 +676,7 @@ alloc_handle (HandleData *handles, MonoObject *obj, gboolean track)
|
||||
gpointer *entries;
|
||||
|
||||
entries = mono_gc_alloc_fixed (sizeof (gpointer) * new_size, make_root_descr_all_refs (new_size, handles->type == HANDLE_PINNED));
|
||||
mono_gc_memmove (entries, handles->entries, sizeof (gpointer) * handles->size);
|
||||
mono_gc_memmove_aligned (entries, handles->entries, sizeof (gpointer) * handles->size);
|
||||
|
||||
mono_gc_free_fixed (handles->entries);
|
||||
handles->entries = entries;
|
||||
|
||||
@@ -239,7 +239,7 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
mono_gc_bzero (ea, esize);
|
||||
mono_gc_bzero_atomic (ea, esize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
|
||||
if (ec->has_references)
|
||||
mono_value_copy (ea, (char*)value + sizeof (MonoObject), ec);
|
||||
else
|
||||
mono_gc_memmove (ea, (char *)value + sizeof (MonoObject), esize);
|
||||
mono_gc_memmove_atomic (ea, (char *)value + sizeof (MonoObject), esize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ ICALL_EXPORT void
|
||||
ves_icall_System_Array_ClearInternal (MonoArray *arr, int idx, int length)
|
||||
{
|
||||
int sz = mono_array_element_size (mono_object_class (arr));
|
||||
mono_gc_bzero (mono_array_addr_with_size_fast (arr, sz, idx), length * sz);
|
||||
mono_gc_bzero_atomic (mono_array_addr_with_size_fast (arr, sz, idx), length * sz);
|
||||
}
|
||||
|
||||
ICALL_EXPORT gboolean
|
||||
@@ -744,7 +744,7 @@ ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* d
|
||||
mono_value_copy_array (dest, dest_idx, source_addr, length);
|
||||
} else {
|
||||
dest_addr = mono_array_addr_with_size_fast (dest, element_size, dest_idx);
|
||||
mono_gc_memmove (dest_addr, source_addr, element_size * length);
|
||||
mono_gc_memmove_atomic (dest_addr, source_addr, element_size * length);
|
||||
}
|
||||
} else {
|
||||
mono_array_memcpy_refs_fast (dest, dest_idx, source, source_idx, length);
|
||||
@@ -769,7 +769,7 @@ ves_icall_System_Array_GetGenericValueImpl (MonoObject *this, guint32 pos, gpoin
|
||||
esize = mono_array_element_size (ac);
|
||||
ea = (gpointer*)((char*)ao->vector + (pos * esize));
|
||||
|
||||
mono_gc_memmove (value, ea, esize);
|
||||
mono_gc_memmove_atomic (value, ea, esize);
|
||||
}
|
||||
|
||||
ICALL_EXPORT void
|
||||
@@ -798,7 +798,7 @@ ves_icall_System_Array_SetGenericValueImpl (MonoObject *this, guint32 pos, gpoin
|
||||
if (ec->has_references)
|
||||
mono_gc_wbarrier_value_copy (ea, value, 1, ec);
|
||||
else
|
||||
mono_gc_memmove (ea, value, esize);
|
||||
mono_gc_memmove_atomic (ea, value, esize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6198,7 +6198,7 @@ ves_icall_System_Buffer_BlockCopyInternal (MonoArray *src, gint32 src_offset, Mo
|
||||
if (src != dest)
|
||||
memcpy (dest_buf, src_buf, count);
|
||||
else
|
||||
mono_gc_memmove (dest_buf, src_buf, count); /* Source and dest are the same array */
|
||||
memmove (dest_buf, src_buf, count); /* Source and dest are the same array */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -12290,7 +12290,7 @@ mono_marshal_load_type_info (MonoClass* klass)
|
||||
case TYPE_ATTRIBUTE_EXPLICIT_LAYOUT:
|
||||
size = mono_marshal_type_size (field->type, info->fields [j].mspec,
|
||||
&align, TRUE, klass->unicode);
|
||||
min_align = packing;
|
||||
min_align = MAX (align, min_align);
|
||||
info->fields [j].offset = field->offset - sizeof (MonoObject);
|
||||
info->native_size = MAX (info->native_size, info->fields [j].offset + size);
|
||||
break;
|
||||
@@ -12304,9 +12304,12 @@ mono_marshal_load_type_info (MonoClass* klass)
|
||||
* If the provided Size is equal or larger than the calculated size, and there
|
||||
* was no Pack attribute, we set min_align to 1 to avoid native_size being increased
|
||||
*/
|
||||
if (layout == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT)
|
||||
if (layout == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) {
|
||||
if (native_size && native_size == info->native_size && klass->packing_size == 0)
|
||||
min_align = 1;
|
||||
else
|
||||
min_align = MIN (min_align, packing);
|
||||
}
|
||||
}
|
||||
|
||||
if (info->native_size & (min_align - 1)) {
|
||||
|
||||
@@ -82,7 +82,7 @@ mono_cq_destroy (MonoCQ *cq)
|
||||
if (!cq)
|
||||
return;
|
||||
|
||||
mono_gc_bzero (cq, sizeof (MonoCQ));
|
||||
mono_gc_bzero_aligned (cq, sizeof (MonoCQ));
|
||||
MONO_GC_UNREGISTER_ROOT (cq->tail);
|
||||
MONO_GC_UNREGISTER_ROOT (cq->head);
|
||||
g_free (cq);
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef struct {
|
||||
#define mono_ptr_array_append(ARRAY, VALUE) do { \
|
||||
if ((ARRAY).size >= (ARRAY).capacity) {\
|
||||
void *__tmp = mono_gc_alloc_fixed (sizeof (void*) * (ARRAY).capacity * 2, mono_gc_make_root_descr_all_refs ((ARRAY).capacity * 2)); \
|
||||
mono_gc_memmove (__tmp, (ARRAY).data, (ARRAY).capacity * sizeof (void*)); \
|
||||
mono_gc_memmove_aligned (__tmp, (ARRAY).data, (ARRAY).capacity * sizeof (void*)); \
|
||||
if ((ARRAY).capacity > MONO_PTR_ARRAY_MAX_ON_STACK) \
|
||||
mono_gc_free_fixed ((ARRAY).data); \
|
||||
(ARRAY).data = __tmp; \
|
||||
@@ -68,7 +68,7 @@ typedef struct {
|
||||
|
||||
#define mono_ptr_array_clear(ARRAY) do { \
|
||||
(ARRAY).size = 0; \
|
||||
mono_gc_bzero ((ARRAY).data, (ARRAY).capacity * sizeof (void*)); \
|
||||
mono_gc_bzero_aligned ((ARRAY).data, (ARRAY).capacity * sizeof (void*)); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
@@ -133,7 +133,7 @@ mono_wsq_local_push (void *obj)
|
||||
for (i = 0; i < length; i++)
|
||||
mono_array_setref (new_array, i, mono_array_get (wsq->queue, MonoObject*, (i + head) & wsq->mask));
|
||||
|
||||
mono_gc_bzero (mono_array_addr (wsq->queue, MonoObject *, 0), sizeof (MonoObject*) * length);
|
||||
mono_gc_bzero_aligned (mono_array_addr (wsq->queue, MonoObject *, 0), sizeof (MonoObject*) * length);
|
||||
wsq->queue = new_array;
|
||||
wsq->head = 0;
|
||||
wsq->tail = tail = count;
|
||||
|
||||
+15
-15
@@ -2970,7 +2970,7 @@ handle_enum:
|
||||
MonoClass *class = mono_class_from_mono_type (type);
|
||||
int size = mono_class_value_size (class, NULL);
|
||||
if (value == NULL)
|
||||
mono_gc_bzero (dest, size);
|
||||
mono_gc_bzero_atomic (dest, size);
|
||||
else
|
||||
mono_gc_wbarrier_value_copy (dest, value, 1, class);
|
||||
}
|
||||
@@ -3419,9 +3419,9 @@ mono_nullable_init (guint8 *buf, MonoObject *value, MonoClass *klass)
|
||||
if (param_class->has_references)
|
||||
mono_gc_wbarrier_value_copy (buf + klass->fields [0].offset - sizeof (MonoObject), mono_object_unbox (value), 1, param_class);
|
||||
else
|
||||
mono_gc_memmove (buf + klass->fields [0].offset - sizeof (MonoObject), mono_object_unbox (value), mono_class_value_size (param_class, NULL));
|
||||
mono_gc_memmove_atomic (buf + klass->fields [0].offset - sizeof (MonoObject), mono_object_unbox (value), mono_class_value_size (param_class, NULL));
|
||||
} else {
|
||||
mono_gc_bzero (buf + klass->fields [0].offset - sizeof (MonoObject), mono_class_value_size (param_class, NULL));
|
||||
mono_gc_bzero_atomic (buf + klass->fields [0].offset - sizeof (MonoObject), mono_class_value_size (param_class, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3449,7 +3449,7 @@ mono_nullable_box (guint8 *buf, MonoClass *klass)
|
||||
if (param_class->has_references)
|
||||
mono_gc_wbarrier_value_copy (mono_object_unbox (o), buf + klass->fields [0].offset - sizeof (MonoObject), 1, param_class);
|
||||
else
|
||||
mono_gc_memmove (mono_object_unbox (o), buf + klass->fields [0].offset - sizeof (MonoObject), mono_class_value_size (param_class, NULL));
|
||||
mono_gc_memmove_atomic (mono_object_unbox (o), buf + klass->fields [0].offset - sizeof (MonoObject), mono_class_value_size (param_class, NULL));
|
||||
return o;
|
||||
}
|
||||
else
|
||||
@@ -4591,7 +4591,7 @@ mono_object_clone (MonoObject *obj)
|
||||
} else {
|
||||
int size = obj->vtable->klass->instance_size;
|
||||
/* do not copy the sync state */
|
||||
mono_gc_memmove ((char*)o + sizeof (MonoObject), (char*)obj + sizeof (MonoObject), size - sizeof (MonoObject));
|
||||
mono_gc_memmove_atomic ((char*)o + sizeof (MonoObject), (char*)obj + sizeof (MonoObject), size - sizeof (MonoObject));
|
||||
}
|
||||
if (G_UNLIKELY (profile_allocs))
|
||||
mono_profiler_allocation (o, obj->vtable->klass);
|
||||
@@ -4626,12 +4626,12 @@ mono_array_full_copy (MonoArray *src, MonoArray *dest)
|
||||
if (klass->element_class->has_references)
|
||||
mono_value_copy_array (dest, 0, mono_array_addr_with_size_fast (src, 0, 0), mono_array_length (src));
|
||||
else
|
||||
mono_gc_memmove (&dest->vector, &src->vector, size);
|
||||
mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
|
||||
} else {
|
||||
mono_array_memcpy_refs (dest, 0, src, 0, mono_array_length (src));
|
||||
}
|
||||
#else
|
||||
mono_gc_memmove (&dest->vector, &src->vector, size);
|
||||
mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4663,12 +4663,12 @@ mono_array_clone_in_domain (MonoDomain *domain, MonoArray *array)
|
||||
if (klass->element_class->has_references)
|
||||
mono_value_copy_array (o, 0, mono_array_addr_with_size_fast (array, 0, 0), mono_array_length (array));
|
||||
else
|
||||
mono_gc_memmove (&o->vector, &array->vector, size);
|
||||
mono_gc_memmove_atomic (&o->vector, &array->vector, size);
|
||||
} else {
|
||||
mono_array_memcpy_refs (o, 0, array, 0, mono_array_length (array));
|
||||
}
|
||||
#else
|
||||
mono_gc_memmove (&o->vector, &array->vector, size);
|
||||
mono_gc_memmove_atomic (&o->vector, &array->vector, size);
|
||||
#endif
|
||||
return o;
|
||||
}
|
||||
@@ -4686,12 +4686,12 @@ mono_array_clone_in_domain (MonoDomain *domain, MonoArray *array)
|
||||
if (klass->element_class->has_references)
|
||||
mono_value_copy_array (o, 0, mono_array_addr_with_size_fast (array, 0, 0), mono_array_length (array));
|
||||
else
|
||||
mono_gc_memmove (&o->vector, &array->vector, size);
|
||||
mono_gc_memmove_atomic (&o->vector, &array->vector, size);
|
||||
} else {
|
||||
mono_array_memcpy_refs (o, 0, array, 0, mono_array_length (array));
|
||||
}
|
||||
#else
|
||||
mono_gc_memmove (&o->vector, &array->vector, size);
|
||||
mono_gc_memmove_atomic (&o->vector, &array->vector, size);
|
||||
#endif
|
||||
|
||||
return o;
|
||||
@@ -5108,7 +5108,7 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
|
||||
mono_gc_wbarrier_value_copy ((char *)res + sizeof (MonoObject), value, 1, class);
|
||||
#else
|
||||
#if NO_UNALIGNED_ACCESS
|
||||
mono_gc_memmove ((char *)res + sizeof (MonoObject), value, size);
|
||||
mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
|
||||
#else
|
||||
switch (size) {
|
||||
case 1:
|
||||
@@ -5124,7 +5124,7 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
|
||||
*(guint64 *)((guint8 *) res + sizeof (MonoObject)) = *(guint64 *) value;
|
||||
break;
|
||||
default:
|
||||
mono_gc_memmove ((char *)res + sizeof (MonoObject), value, size);
|
||||
mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -6291,10 +6291,10 @@ mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoAr
|
||||
if (class->has_references)
|
||||
mono_gc_wbarrier_value_copy (*((gpointer *)params [i]), arg + sizeof (MonoObject), 1, class);
|
||||
else
|
||||
mono_gc_memmove (*((gpointer *)params [i]), arg + sizeof (MonoObject), size);
|
||||
mono_gc_memmove_atomic (*((gpointer *)params [i]), arg + sizeof (MonoObject), size);
|
||||
} else {
|
||||
size = mono_class_value_size (mono_class_from_mono_type (pt), NULL);
|
||||
mono_gc_bzero (*((gpointer *)params [i]), size);
|
||||
mono_gc_bzero_atomic (*((gpointer *)params [i]), size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-1
@@ -604,7 +604,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr
|
||||
gboolean ret;
|
||||
|
||||
shellex.cbSize = sizeof(SHELLEXECUTEINFO);
|
||||
shellex.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_UNICODE;
|
||||
shellex.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE;
|
||||
shellex.nShow = proc_start_info->window_style;
|
||||
shellex.nShow = (shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow);
|
||||
|
||||
@@ -634,6 +634,22 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr
|
||||
}
|
||||
|
||||
ret = ShellExecuteEx (&shellex);
|
||||
if (ret == FALSE) {
|
||||
process_info->pid = -GetLastError ();
|
||||
} else {
|
||||
process_info->process_handle = shellex.hProcess;
|
||||
process_info->thread_handle = NULL;
|
||||
/* It appears that there's no way to get the pid from a
|
||||
* process handle before windows xp. Really.
|
||||
*/
|
||||
#if defined(HAVE_GETPROCESSID) && !defined(MONO_CROSS_COMPILE)
|
||||
process_info->pid = GetProcessId (shellex.hProcess);
|
||||
#else
|
||||
process_info->pid = 0;
|
||||
#endif
|
||||
process_info->tid = 0;
|
||||
}
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -7951,7 +7951,7 @@ handle_type:
|
||||
val = load_cattr_value (image, &subc->byval_arg, p, end);
|
||||
obj = mono_object_new (mono_domain_get (), subc);
|
||||
g_assert (!subc->has_references);
|
||||
mono_gc_memmove ((char*)obj + sizeof (MonoObject), val, mono_class_value_size (subc, NULL));
|
||||
mono_gc_memmove_atomic ((char*)obj + sizeof (MonoObject), val, mono_class_value_size (subc, NULL));
|
||||
g_free (val);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -135,8 +135,12 @@
|
||||
#define USE_MONO_CTX
|
||||
#define ARCH_NUM_REGS 32
|
||||
|
||||
#define ARCH_SIGCTX_SP(ctx) (UCONTEXT_GREGS((ctx))[29])
|
||||
#define ARCH_SIGCTX_IP(ctx) (UCONTEXT_REG_PC((ctx)))
|
||||
/*
|
||||
* These casts are necessary since glibc always makes the
|
||||
* gregs 64-bit values in userland.
|
||||
*/
|
||||
#define ARCH_SIGCTX_SP(ctx) ((gsize) UCONTEXT_GREGS((ctx))[29])
|
||||
#define ARCH_SIGCTX_IP(ctx) ((gsize) UCONTEXT_REG_PC((ctx)))
|
||||
|
||||
#elif defined(__s390x__)
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ sgen_card_table_wbarrier_value_copy (gpointer dest, gpointer src, int count, Mon
|
||||
TLAB_ACCESS_INIT;
|
||||
ENTER_CRITICAL_REGION;
|
||||
#endif
|
||||
mono_gc_memmove (dest, src, size);
|
||||
mono_gc_memmove_atomic (dest, src, size);
|
||||
sgen_card_table_mark_range ((mword)dest, size);
|
||||
#ifdef DISABLE_CRITICAL_REGION
|
||||
UNLOCK_GC;
|
||||
@@ -160,7 +160,7 @@ sgen_card_table_wbarrier_object_copy (MonoObject* obj, MonoObject *src)
|
||||
TLAB_ACCESS_INIT;
|
||||
ENTER_CRITICAL_REGION;
|
||||
#endif
|
||||
mono_gc_memmove ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
mono_gc_memmove_aligned ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
size - sizeof (MonoObject));
|
||||
sgen_card_table_mark_range ((mword)obj, size);
|
||||
#ifdef DISABLE_CRITICAL_REGION
|
||||
|
||||
@@ -74,10 +74,10 @@ par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword o
|
||||
;
|
||||
} else {
|
||||
/*can't trust memcpy doing word copies */
|
||||
mono_gc_memmove (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
|
||||
mono_gc_memmove_aligned (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
|
||||
}
|
||||
#else
|
||||
mono_gc_memmove (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
|
||||
mono_gc_memmove_aligned (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
|
||||
#endif
|
||||
/* adjust array->bounds */
|
||||
SGEN_ASSERT (9, vt->gc_descr, "vtable %p for class %s:%s has no gc descriptor", vt, vt->klass->name_space, vt->klass->name);
|
||||
|
||||
@@ -4305,7 +4305,7 @@ mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count)
|
||||
HEAVY_STAT (++stat_wbarrier_arrayref_copy);
|
||||
/*This check can be done without taking a lock since dest_ptr array is pinned*/
|
||||
if (ptr_in_nursery (dest_ptr) || count <= 0) {
|
||||
mono_gc_memmove (dest_ptr, src_ptr, count * sizeof (gpointer));
|
||||
mono_gc_memmove_aligned (dest_ptr, src_ptr, count * sizeof (gpointer));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4484,7 +4484,7 @@ mono_gc_wbarrier_value_copy (gpointer dest, gpointer src, int count, MonoClass *
|
||||
if (ptr_in_nursery (dest) || ptr_on_stack (dest) || !SGEN_CLASS_HAS_REFERENCES (klass)) {
|
||||
size_t element_size = mono_class_value_size (klass, NULL);
|
||||
size_t size = count * element_size;
|
||||
mono_gc_memmove (dest, src, size);
|
||||
mono_gc_memmove_atomic (dest, src, size);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4517,7 +4517,7 @@ mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src)
|
||||
|
||||
if (ptr_in_nursery (obj) || ptr_on_stack (obj)) {
|
||||
size = mono_object_class (obj)->instance_size;
|
||||
mono_gc_memmove ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
mono_gc_memmove_aligned ((char*)obj + sizeof (MonoObject), (char*)src + sizeof (MonoObject),
|
||||
size - sizeof (MonoObject));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ main (void)
|
||||
memcpy (playground, random_mem, POOL_SIZE);
|
||||
|
||||
bzero (reference + START_OFFSET + offset, size);
|
||||
mono_gc_bzero (playground + START_OFFSET + offset, size);
|
||||
mono_gc_bzero_atomic (playground + START_OFFSET + offset, size);
|
||||
|
||||
assert (!memcmp (reference, playground, POOL_SIZE));
|
||||
}
|
||||
@@ -75,7 +75,7 @@ main (void)
|
||||
memcpy (playground, random_mem, POOL_SIZE);
|
||||
|
||||
memmove (reference + START_OFFSET + dest_offset, reference + START_OFFSET + src_offset, size);
|
||||
mono_gc_memmove (playground + START_OFFSET + dest_offset, playground + START_OFFSET + src_offset, size);
|
||||
mono_gc_memmove_atomic (playground + START_OFFSET + dest_offset, playground + START_OFFSET + src_offset, size);
|
||||
|
||||
assert (!memcmp (reference, playground, POOL_SIZE));
|
||||
|
||||
@@ -84,7 +84,7 @@ main (void)
|
||||
memcpy (playground, random_mem, POOL_SIZE);
|
||||
|
||||
memmove (reference + START_OFFSET + dest_offset, reference + MEMMOVE_NONOVERLAP_START + src_offset, size);
|
||||
mono_gc_memmove (playground + START_OFFSET + dest_offset, playground + MEMMOVE_NONOVERLAP_START + src_offset, size);
|
||||
mono_gc_memmove_atomic (playground + START_OFFSET + dest_offset, playground + MEMMOVE_NONOVERLAP_START + src_offset, size);
|
||||
|
||||
assert (!memcmp (reference, playground, POOL_SIZE));
|
||||
|
||||
@@ -93,7 +93,7 @@ main (void)
|
||||
memcpy (playground, random_mem, POOL_SIZE);
|
||||
|
||||
memmove (reference + MEMMOVE_NONOVERLAP_START + dest_offset, reference + START_OFFSET + src_offset, size);
|
||||
mono_gc_memmove (playground + MEMMOVE_NONOVERLAP_START + dest_offset, playground + START_OFFSET + src_offset, size);
|
||||
mono_gc_memmove_atomic (playground + MEMMOVE_NONOVERLAP_START + dest_offset, playground + START_OFFSET + src_offset, size);
|
||||
|
||||
assert (!memcmp (reference, playground, POOL_SIZE));
|
||||
}
|
||||
|
||||
+24
-2
@@ -323,9 +323,31 @@ static gboolean handle_remove(MonoInternalThread *thread)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ensure_synch_cs_set (MonoInternalThread *thread)
|
||||
{
|
||||
CRITICAL_SECTION *synch_cs;
|
||||
|
||||
if (thread->synch_cs != NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
synch_cs = g_new0 (CRITICAL_SECTION, 1);
|
||||
InitializeCriticalSection (synch_cs);
|
||||
|
||||
if (InterlockedCompareExchangePointer ((gpointer *)&thread->synch_cs,
|
||||
synch_cs, NULL) != NULL) {
|
||||
/* Another thread must have installed this CS */
|
||||
DeleteCriticalSection (synch_cs);
|
||||
g_free (synch_cs);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
lock_thread (MonoInternalThread *thread)
|
||||
{
|
||||
if (!thread->synch_cs)
|
||||
ensure_synch_cs_set (thread);
|
||||
|
||||
g_assert (thread->synch_cs);
|
||||
EnterCriticalSection (thread->synch_cs);
|
||||
}
|
||||
@@ -1334,7 +1356,7 @@ byte_array_to_domain (MonoArray *arr, MonoDomain *domain)
|
||||
return arr;
|
||||
|
||||
copy = mono_array_new (domain, mono_defaults.byte_class, arr->max_length);
|
||||
mono_gc_memmove (mono_array_addr (copy, guint8, 0), mono_array_addr (arr, guint8, 0), arr->max_length);
|
||||
memmove (mono_array_addr (copy, guint8, 0), mono_array_addr (arr, guint8, 0), arr->max_length);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -3950,7 +3972,7 @@ free_thread_static_data_helper (gpointer key, gpointer value, gpointer user)
|
||||
if (!thread->static_data || !thread->static_data [idx])
|
||||
return;
|
||||
ptr = ((char*) thread->static_data [idx]) + (data->offset & 0xffffff);
|
||||
mono_gc_bzero (ptr, data->size);
|
||||
mono_gc_bzero_atomic (ptr, data->size);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -177,7 +177,7 @@ tp_epoll_wait (gpointer p)
|
||||
}
|
||||
LeaveCriticalSection (&socket_io_data->io_lock);
|
||||
threadpool_append_jobs (&async_io_tp, (MonoObject **) async_results, nresults);
|
||||
mono_gc_bzero (async_results, sizeof (gpointer) * nresults);
|
||||
mono_gc_bzero_aligned (async_results, sizeof (gpointer) * nresults);
|
||||
}
|
||||
}
|
||||
#undef EPOLL_NEVENTS
|
||||
|
||||
@@ -157,7 +157,7 @@ tp_kqueue_wait (gpointer p)
|
||||
}
|
||||
LeaveCriticalSection (&socket_io_data->io_lock);
|
||||
threadpool_append_jobs (&async_io_tp, (MonoObject **) async_results, nresults);
|
||||
mono_gc_bzero (async_results, sizeof (gpointer) * nresults);
|
||||
mono_gc_bzero_aligned (async_results, sizeof (gpointer) * nresults);
|
||||
}
|
||||
}
|
||||
#undef KQUEUE_NEVENTS
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "ir-emit.h"
|
||||
#include "glib.h"
|
||||
|
||||
#ifndef DISABLE_JIT
|
||||
|
||||
static gboolean
|
||||
is_int_stack_size (int type)
|
||||
{
|
||||
@@ -333,3 +335,5 @@ done:
|
||||
if (cfg->verbose_level > 2)
|
||||
mono_print_code (cfg, "AFTER ALIAS_ANALYSIS");
|
||||
}
|
||||
|
||||
#endif /* !DISABLE_JIT */
|
||||
@@ -678,6 +678,7 @@ arch_init (MonoAotCompile *acfg)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MONO_ARCH_AOT_SUPPORTED
|
||||
/*
|
||||
* arch_emit_direct_call:
|
||||
*
|
||||
@@ -724,6 +725,7 @@ arch_emit_direct_call (MonoAotCompile *acfg, const char *target, gboolean extern
|
||||
g_assert_not_reached ();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PPC32 design:
|
||||
@@ -840,6 +842,7 @@ arch_emit_got_access (MonoAotCompile *acfg, guint8 *code, int got_slot, int *cod
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MONO_ARCH_AOT_SUPPORTED
|
||||
/*
|
||||
* arch_emit_objc_selector_ref:
|
||||
*
|
||||
@@ -868,6 +871,7 @@ arch_emit_objc_selector_ref (MonoAotCompile *acfg, guint8 *code, int index, int
|
||||
g_assert_not_reached ();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* arch_emit_plt_entry:
|
||||
@@ -3815,6 +3819,9 @@ check_type_depth (MonoType *t, int depth)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
add_types_from_method_header (MonoAotCompile *acfg, MonoMethod *method);
|
||||
|
||||
/*
|
||||
* add_generic_class:
|
||||
*
|
||||
@@ -3875,9 +3882,11 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mono_method_is_generic_sharable_full (method, FALSE, FALSE, use_gsharedvt))
|
||||
if (mono_method_is_generic_sharable_full (method, FALSE, FALSE, use_gsharedvt)) {
|
||||
/* Already added */
|
||||
add_types_from_method_header (acfg, method);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (method->is_generic)
|
||||
/* FIXME: */
|
||||
@@ -4326,6 +4335,7 @@ is_direct_callable (MonoAotCompile *acfg, MonoMethod *method, MonoJumpInfo *patc
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef MONO_ARCH_AOT_SUPPORTED
|
||||
static const char *
|
||||
get_pinvoke_import (MonoAotCompile *acfg, MonoMethod *method)
|
||||
{
|
||||
@@ -4355,6 +4365,7 @@ get_pinvoke_import (MonoAotCompile *acfg, MonoMethod *method)
|
||||
|
||||
return import;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gint
|
||||
compare_lne (MonoDebugLineNumberEntry *a, MonoDebugLineNumberEntry *b)
|
||||
@@ -4485,10 +4496,13 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
|
||||
MonoJumpInfo *patch_info;
|
||||
MonoMethodHeader *header;
|
||||
MonoDebugSourceLocation **locs = NULL;
|
||||
gboolean skip, direct_call, external_call;
|
||||
gboolean skip;
|
||||
#ifdef MONO_ARCH_AOT_SUPPORTED
|
||||
gboolean direct_call, external_call;
|
||||
guint32 got_slot;
|
||||
const char *direct_call_target = 0;
|
||||
const char *direct_pinvoke;
|
||||
#endif
|
||||
|
||||
if (method) {
|
||||
header = mono_method_get_header (method);
|
||||
|
||||
+14
-14
@@ -62,11 +62,11 @@ seq_point: len:38 clob:c
|
||||
throw: src1:i len:24
|
||||
rethrow: src1:i len:20
|
||||
start_handler: len:20
|
||||
endfinally: len:20
|
||||
endfinally: len:32
|
||||
call_handler: len:16 clob:c
|
||||
endfilter: src1:i len:16
|
||||
|
||||
ckfinite: dest:f src1:f len:64
|
||||
ckfinite: dest:f src1:f len:112
|
||||
ceq: dest:i len:12
|
||||
cgt: dest:i len:12
|
||||
cgt.un: dest:i len:12
|
||||
@@ -108,7 +108,7 @@ storei4_membase_imm: dest:b len:20
|
||||
storei4_membase_reg: dest:b src1:i len:20
|
||||
storei8_membase_imm: dest:b
|
||||
storei8_membase_reg: dest:b src1:i
|
||||
storer4_membase_reg: dest:b src1:f len:12
|
||||
storer4_membase_reg: dest:b src1:f len:60
|
||||
storer8_membase_reg: dest:b src1:f len:24
|
||||
store_memindex: dest:b src1:i src2:i len:4
|
||||
storei1_memindex: dest:b src1:i src2:i len:4
|
||||
@@ -122,7 +122,7 @@ loadu2_membase: dest:i src1:b len:4
|
||||
loadi4_membase: dest:i src1:b len:4
|
||||
loadu4_membase: dest:i src1:b len:4
|
||||
loadi8_membase: dest:i src1:b
|
||||
loadr4_membase: dest:f src1:b len:8
|
||||
loadr4_membase: dest:f src1:b len:56
|
||||
loadr8_membase: dest:f src1:b len:24
|
||||
load_memindex: dest:i src1:b src2:i len:4
|
||||
loadi1_memindex: dest:i src1:b src2:i len:4
|
||||
@@ -176,15 +176,15 @@ float_rem: dest:f src1:f src2:f len:16
|
||||
float_rem_un: dest:f src1:f src2:f len:16
|
||||
float_neg: dest:f src1:f len:4
|
||||
float_not: dest:f src1:f len:4
|
||||
float_conv_to_i1: dest:i src1:f len:40
|
||||
float_conv_to_i2: dest:i src1:f len:40
|
||||
float_conv_to_i4: dest:i src1:f len:40
|
||||
float_conv_to_i8: dest:l src1:f len:40
|
||||
float_conv_to_i1: dest:i src1:f len:88
|
||||
float_conv_to_i2: dest:i src1:f len:88
|
||||
float_conv_to_i4: dest:i src1:f len:88
|
||||
float_conv_to_i8: dest:l src1:f len:88
|
||||
float_conv_to_r4: dest:f src1:f len:8
|
||||
float_conv_to_u4: dest:i src1:f len:40
|
||||
float_conv_to_u8: dest:l src1:f len:40
|
||||
float_conv_to_u2: dest:i src1:f len:40
|
||||
float_conv_to_u1: dest:i src1:f len:40
|
||||
float_conv_to_u4: dest:i src1:f len:88
|
||||
float_conv_to_u8: dest:l src1:f len:88
|
||||
float_conv_to_u2: dest:i src1:f len:88
|
||||
float_conv_to_u1: dest:i src1:f len:88
|
||||
float_conv_to_i: dest:i src1:f len:40
|
||||
float_ceq: dest:i src1:f src2:f len:16
|
||||
float_cgt: dest:i src1:f src2:f len:16
|
||||
@@ -228,8 +228,8 @@ int_not: dest:i src1:i len:4
|
||||
int_conv_to_i1: dest:i src1:i len:8
|
||||
int_conv_to_i2: dest:i src1:i len:8
|
||||
int_conv_to_i4: dest:i src1:i len:4
|
||||
int_conv_to_r4: dest:f src1:i len:36
|
||||
int_conv_to_r8: dest:f src1:i len:36
|
||||
int_conv_to_r4: dest:f src1:i len:84
|
||||
int_conv_to_r8: dest:f src1:i len:84
|
||||
int_conv_to_u4: dest:i src1:i
|
||||
int_conv_to_r_un: dest:f src1:i len:56
|
||||
int_conv_to_u2: dest:i src1:i len:8
|
||||
|
||||
@@ -6023,7 +6023,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai
|
||||
|
||||
if (addr) {
|
||||
// FIXME: Write barriers
|
||||
mono_gc_memmove (addr, val, size);
|
||||
mono_gc_memmove_atomic (addr, val, size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -6081,7 +6081,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai
|
||||
}
|
||||
|
||||
// FIXME: Write barriers
|
||||
mono_gc_memmove (addr, val, size);
|
||||
mono_gc_memmove_atomic (addr, val, size);
|
||||
break;
|
||||
case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR:
|
||||
/* Same as regoffset, but with an indirection */
|
||||
@@ -6091,7 +6091,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai
|
||||
gaddr = *(gpointer*)addr;
|
||||
g_assert (gaddr);
|
||||
// FIXME: Write barriers
|
||||
mono_gc_memmove (gaddr, val, size);
|
||||
mono_gc_memmove_atomic (gaddr, val, size);
|
||||
break;
|
||||
case MONO_DEBUG_VAR_ADDRESS_MODE_DEAD:
|
||||
NOT_IMPLEMENTED;
|
||||
|
||||
+1
-1
@@ -1542,7 +1542,7 @@ mono_main (int argc, char* argv[])
|
||||
char *build = mono_get_runtime_build_info ();
|
||||
char *gc_descr;
|
||||
|
||||
g_print ("Mono Runtime Engine version %s\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\n", build);
|
||||
g_print ("Mono JIT compiler version %s\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\n", build);
|
||||
g_free (build);
|
||||
g_print (info);
|
||||
gc_descr = mono_gc_get_description ();
|
||||
|
||||
@@ -675,69 +675,6 @@ add_line_number_file_name (MonoDwarfWriter *w, const char *name,
|
||||
return index;
|
||||
}
|
||||
|
||||
static void
|
||||
emit_line_number_info_begin (MonoDwarfWriter *w)
|
||||
{
|
||||
/* Line number info header */
|
||||
/*
|
||||
* GAS seems to emit its own data to the end of the first subsection, so we use
|
||||
* subsections 1, 2 etc:
|
||||
* 1 - contains the header
|
||||
* 2 - contains the file names
|
||||
* 3 - contains the end of the header + the data
|
||||
* 4 - the end symbol
|
||||
*/
|
||||
emit_section_change (w, ".debug_line", 0);
|
||||
emit_label (w, ".Ldebug_line_section_start");
|
||||
emit_section_change (w, ".debug_line", LINE_SUBSECTION_HEADER);
|
||||
emit_label (w, ".Ldebug_line_start");
|
||||
emit_symbol_diff (w, ".Ldebug_line_end", ".", -4); /* length */
|
||||
emit_int16 (w, 0x2); /* version */
|
||||
emit_symbol_diff (w, ".Ldebug_line_header_end", ".", -4); /* header_length */
|
||||
emit_byte (w, 1); /* minimum_instruction_length */
|
||||
emit_byte (w, 1); /* default_is_stmt */
|
||||
emit_byte (w, LINE_BASE); /* line_base */
|
||||
emit_byte (w, LINE_RANGE); /* line_range */
|
||||
emit_byte (w, OPCODE_BASE); /* opcode_base */
|
||||
emit_byte (w, 0); /* standard_opcode_lengths */
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 1);
|
||||
|
||||
/* Includes */
|
||||
emit_section_change (w, ".debug_line", LINE_SUBSECTION_INCLUDES);
|
||||
|
||||
/* End of Includes */
|
||||
emit_section_change (w, ".debug_line", LINE_SUBSECTION_FILES);
|
||||
emit_byte (w, 0);
|
||||
|
||||
/* Files */
|
||||
emit_line_number_file_name (w, "xdb.il", 0, 0);
|
||||
|
||||
/* End of Files */
|
||||
emit_section_change (w, ".debug_line", LINE_SUBSECTION_DATA);
|
||||
emit_byte (w, 0);
|
||||
|
||||
emit_label (w, ".Ldebug_line_header_end");
|
||||
|
||||
/* Emit this into a separate subsection so it gets placed at the end */
|
||||
emit_section_change (w, ".debug_line", LINE_SUBSECTION_END);
|
||||
|
||||
emit_byte (w, 0);
|
||||
emit_byte (w, 1);
|
||||
emit_byte (w, DW_LNE_end_sequence);
|
||||
|
||||
emit_label (w, ".Ldebug_line_end");
|
||||
}
|
||||
|
||||
char *
|
||||
mono_dwarf_escape_path (const char *name)
|
||||
{
|
||||
|
||||
@@ -501,7 +501,7 @@ mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
|
||||
gpointer
|
||||
mono_arch_ip_from_context (void *sigctx)
|
||||
{
|
||||
return (gpointer)UCONTEXT_REG_PC (sigctx);
|
||||
return (gpointer)(gsize)UCONTEXT_REG_PC (sigctx);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -343,8 +343,6 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
|
||||
|
||||
/* load ESP into EBP */
|
||||
x86_mov_reg_membase (code, X86_EBP, X86_EAX, G_STRUCT_OFFSET (MonoContext, esp), 4);
|
||||
/* Align it, it can be unaligned if it was captured asynchronously */
|
||||
x86_alu_reg_imm (code, X86_AND, X86_EBP, ~(MONO_ARCH_LOCALLOC_ALIGNMENT - 1));
|
||||
/* load return address into ECX */
|
||||
x86_mov_reg_membase (code, X86_ECX, X86_EAX, G_STRUCT_OFFSET (MonoContext, eip), 4);
|
||||
/* save the return addr to the restored stack - 4 */
|
||||
|
||||
@@ -4573,6 +4573,8 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
|
||||
vtable = mono_class_vtable (cfg->domain, method->klass);
|
||||
if (!vtable)
|
||||
return FALSE;
|
||||
if (cfg->compile_aot && mono_class_needs_cctor_run (method->klass, NULL))
|
||||
return FALSE;
|
||||
mono_runtime_class_init (vtable);
|
||||
} else if (method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) {
|
||||
if (cfg->run_cctors && method->klass->has_cctor) {
|
||||
|
||||
+101
-5
@@ -120,8 +120,24 @@ static gboolean iphone_abi = FALSE;
|
||||
*/
|
||||
static MonoArmFPU arm_fpu;
|
||||
|
||||
static int vfp_scratch1 = ARM_VFP_F28;
|
||||
static int vfp_scratch2 = ARM_VFP_F30;
|
||||
#if defined(ARM_FPU_VFP_HARD)
|
||||
/*
|
||||
* On armhf, d0-d7 are used for argument passing and d8-d15
|
||||
* must be preserved across calls, which leaves us no room
|
||||
* for scratch registers. So we use d14-d15 but back up their
|
||||
* previous contents to a stack slot before using them - see
|
||||
* mono_arm_emit_vfp_scratch_save/_restore ().
|
||||
*/
|
||||
static int vfp_scratch1 = ARM_VFP_D14;
|
||||
static int vfp_scratch2 = ARM_VFP_D15;
|
||||
#else
|
||||
/*
|
||||
* On armel, d0-d7 do not need to be preserved, so we can
|
||||
* freely make use of them as scratch registers.
|
||||
*/
|
||||
static int vfp_scratch1 = ARM_VFP_D0;
|
||||
static int vfp_scratch2 = ARM_VFP_D1;
|
||||
#endif
|
||||
|
||||
static int i8_align;
|
||||
|
||||
@@ -503,6 +519,11 @@ emit_float_args (MonoCompile *cfg, MonoCallInst *inst, guint8 *code, int *max_le
|
||||
for (list = inst->float_args; list; list = list->next) {
|
||||
FloatArgData *fad = list->data;
|
||||
MonoInst *var = get_vreg_to_inst (cfg, fad->vreg);
|
||||
gboolean imm = arm_is_fpimm8 (var->inst_offset);
|
||||
|
||||
/* 4+1 insns for emit_big_add () and 1 for FLDS. */
|
||||
if (imm)
|
||||
*max_len += 20 + 4;
|
||||
|
||||
*max_len += 4;
|
||||
|
||||
@@ -513,7 +534,11 @@ emit_float_args (MonoCompile *cfg, MonoCallInst *inst, guint8 *code, int *max_le
|
||||
code = cfg->native_code + *offset;
|
||||
}
|
||||
|
||||
ARM_FLDS (code, fad->hreg, var->inst_basereg, var->inst_offset);
|
||||
if (!imm) {
|
||||
code = emit_big_add (code, ARMREG_LR, var->inst_basereg, var->inst_offset);
|
||||
ARM_FLDS (code, fad->hreg, ARMREG_LR, 0);
|
||||
} else
|
||||
ARM_FLDS (code, fad->hreg, var->inst_basereg, var->inst_offset);
|
||||
|
||||
*offset = code - cfg->native_code;
|
||||
}
|
||||
@@ -521,6 +546,46 @@ emit_float_args (MonoCompile *cfg, MonoCallInst *inst, guint8 *code, int *max_le
|
||||
return code;
|
||||
}
|
||||
|
||||
static guint8 *
|
||||
mono_arm_emit_vfp_scratch_save (MonoCompile *cfg, guint8 *code, int reg)
|
||||
{
|
||||
MonoInst *inst;
|
||||
|
||||
g_assert (reg == vfp_scratch1 || reg == vfp_scratch2);
|
||||
|
||||
inst = (MonoInst *) cfg->arch.vfp_scratch_slots [reg == vfp_scratch1 ? 0 : 1];
|
||||
|
||||
if (IS_HARD_FLOAT) {
|
||||
if (!arm_is_fpimm8 (inst->inst_offset)) {
|
||||
code = emit_big_add (code, ARMREG_LR, inst->inst_basereg, inst->inst_offset);
|
||||
ARM_FSTD (code, reg, ARMREG_LR, 0);
|
||||
} else
|
||||
ARM_FSTD (code, reg, inst->inst_basereg, inst->inst_offset);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
static guint8 *
|
||||
mono_arm_emit_vfp_scratch_restore (MonoCompile *cfg, guint8 *code, int reg)
|
||||
{
|
||||
MonoInst *inst;
|
||||
|
||||
g_assert (reg == vfp_scratch1 || reg == vfp_scratch2);
|
||||
|
||||
inst = (MonoInst *) cfg->arch.vfp_scratch_slots [reg == vfp_scratch1 ? 0 : 1];
|
||||
|
||||
if (IS_HARD_FLOAT) {
|
||||
if (!arm_is_fpimm8 (inst->inst_offset)) {
|
||||
code = emit_big_add (code, ARMREG_LR, inst->inst_basereg, inst->inst_offset);
|
||||
ARM_FLDD (code, reg, ARMREG_LR, 0);
|
||||
} else
|
||||
ARM_FLDD (code, reg, inst->inst_basereg, inst->inst_offset);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
/*
|
||||
* emit_save_lmf:
|
||||
*
|
||||
@@ -1976,6 +2041,7 @@ mono_arch_create_vars (MonoCompile *cfg)
|
||||
{
|
||||
MonoMethodSignature *sig;
|
||||
CallInfo *cinfo;
|
||||
int i;
|
||||
|
||||
sig = mono_method_signature (cfg->method);
|
||||
|
||||
@@ -1983,6 +2049,15 @@ mono_arch_create_vars (MonoCompile *cfg)
|
||||
cfg->arch.cinfo = get_call_info (cfg->generic_sharing_context, cfg->mempool, sig);
|
||||
cinfo = cfg->arch.cinfo;
|
||||
|
||||
if (IS_HARD_FLOAT) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
MonoInst *inst = mono_compile_create_var (cfg, &mono_defaults.double_class->byval_arg, OP_LOCAL);
|
||||
inst->flags |= MONO_INST_VOLATILE;
|
||||
|
||||
cfg->arch.vfp_scratch_slots [i] = (gpointer) inst;
|
||||
}
|
||||
}
|
||||
|
||||
if (cinfo->ret.storage == RegTypeStructByVal)
|
||||
cfg->ret_var_is_local = TRUE;
|
||||
|
||||
@@ -3422,11 +3497,13 @@ emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size,
|
||||
{
|
||||
/* sreg is a float, dreg is an integer reg */
|
||||
if (IS_VFP) {
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
if (is_signed)
|
||||
ARM_TOSIZD (code, vfp_scratch1, sreg);
|
||||
else
|
||||
ARM_TOUIZD (code, vfp_scratch1, sreg);
|
||||
ARM_FMRS (code, dreg, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
}
|
||||
if (!is_signed) {
|
||||
if (size == 1)
|
||||
@@ -4995,26 +5072,34 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
|
||||
break;
|
||||
case OP_STORER4_MEMBASE_REG:
|
||||
g_assert (arm_is_fpimm8 (ins->inst_offset));
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
ARM_CVTD (code, vfp_scratch1, ins->sreg1);
|
||||
ARM_FSTS (code, vfp_scratch1, ins->inst_destbasereg, ins->inst_offset);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
break;
|
||||
case OP_LOADR4_MEMBASE:
|
||||
g_assert (arm_is_fpimm8 (ins->inst_offset));
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
ARM_FLDS (code, vfp_scratch1, ins->inst_basereg, ins->inst_offset);
|
||||
ARM_CVTS (code, ins->dreg, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
break;
|
||||
case OP_ICONV_TO_R_UN: {
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
case OP_ICONV_TO_R4:
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
ARM_FMSR (code, vfp_scratch1, ins->sreg1);
|
||||
ARM_FSITOS (code, vfp_scratch1, vfp_scratch1);
|
||||
ARM_CVTS (code, ins->dreg, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
break;
|
||||
case OP_ICONV_TO_R8:
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
ARM_FMSR (code, vfp_scratch1, ins->sreg1);
|
||||
ARM_FSITOD (code, ins->dreg, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
break;
|
||||
|
||||
case OP_SETFRET:
|
||||
@@ -5201,6 +5286,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
|
||||
|
||||
case OP_CKFINITE: {
|
||||
if (IS_VFP) {
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch2);
|
||||
|
||||
#ifdef USE_JUMP_TABLES
|
||||
{
|
||||
gpointer *jte = mono_jumptable_add_entries (2);
|
||||
@@ -5225,6 +5313,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
|
||||
ARM_FMSTAT (code);
|
||||
EMIT_COND_SYSTEM_EXCEPTION_FLAGS (ARMCOND_VS, "ArithmeticException");
|
||||
ARM_CPYD (code, ins->dreg, ins->sreg1);
|
||||
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
|
||||
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -5689,8 +5780,13 @@ mono_arch_emit_prolog (MonoCompile *cfg)
|
||||
break;
|
||||
}
|
||||
} else if (ainfo->storage == RegTypeFP) {
|
||||
code = mono_arm_emit_load_imm (code, ARMREG_IP, inst->inst_offset);
|
||||
ARM_ADD_REG_REG (code, ARMREG_IP, ARMREG_IP, inst->inst_basereg);
|
||||
int imm8, rot_amount;
|
||||
|
||||
if ((imm8 = mono_arm_is_rotated_imm8 (inst->inst_offset, &rot_amount)) == -1) {
|
||||
code = mono_arm_emit_load_imm (code, ARMREG_IP, inst->inst_offset);
|
||||
ARM_ADD_REG_REG (code, ARMREG_IP, ARMREG_IP, inst->inst_basereg);
|
||||
} else
|
||||
ARM_ADD_REG_IMM (code, ARMREG_IP, inst->inst_basereg, imm8, rot_amount);
|
||||
|
||||
if (ainfo->size == 8)
|
||||
ARM_FSTD (code, ainfo->reg, ARMREG_IP, 0);
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
#endif
|
||||
|
||||
#define MONO_MAX_IREGS 16
|
||||
#define MONO_MAX_FREGS 32
|
||||
|
||||
#define MONO_SAVED_GREGS 10 /* r4-r11, ip, lr */
|
||||
|
||||
@@ -77,6 +76,8 @@
|
||||
|
||||
#if defined(ARM_FPU_VFP_HARD)
|
||||
#define MONO_SAVED_FREGS 16
|
||||
#define MONO_MAX_FREGS 32
|
||||
|
||||
/*
|
||||
* d8-d15 must be preserved across function calls. We use d14-d15 as
|
||||
* scratch registers in the JIT. The rest have no meaning tied to them.
|
||||
@@ -84,12 +85,14 @@
|
||||
#define MONO_ARCH_CALLEE_FREGS 0x00005555
|
||||
#define MONO_ARCH_CALLEE_SAVED_FREGS 0x55550000
|
||||
#else
|
||||
#define MONO_SAVED_FREGS 0
|
||||
#define MONO_SAVED_FREGS 8
|
||||
#define MONO_MAX_FREGS 16
|
||||
|
||||
/*
|
||||
* No registers need to be preserved across function calls. We use d14-d15
|
||||
* No registers need to be preserved across function calls. We use d0-d1
|
||||
* as scratch registers in the JIT. The rest have no meaning tied to them.
|
||||
*/
|
||||
#define MONO_ARCH_CALLEE_FREGS 0x05555555
|
||||
#define MONO_ARCH_CALLEE_FREGS 0x55555550
|
||||
#define MONO_ARCH_CALLEE_SAVED_FREGS 0x00000000
|
||||
#endif
|
||||
|
||||
@@ -199,6 +202,7 @@ typedef struct MonoCompileArch {
|
||||
gpointer seq_point_bp_method_var;
|
||||
gboolean omit_fp, omit_fp_computed;
|
||||
gpointer cinfo;
|
||||
gpointer *vfp_scratch_slots [2];
|
||||
} MonoCompileArch;
|
||||
|
||||
#define MONO_ARCH_EMULATE_FCONV_TO_I8 1
|
||||
|
||||
@@ -158,6 +158,6 @@ mono_unwind_decode_llvm_mono_fde (guint8 *fde, int fde_len, guint8 *cie, guint8
|
||||
|
||||
GSList* mono_unwind_get_cie_program (void) MONO_INTERNAL;
|
||||
|
||||
void mono_print_unwind_info (guint8 *unwind_info, int unwind_info_len) MONO_INTERNAL;
|
||||
void mono_print_unwind_info (guint8 *unwind_info, int unwind_info_len) MONO_LLVM_INTERNAL;
|
||||
|
||||
#endif
|
||||
+12
-5
@@ -670,9 +670,9 @@ mono_tramp_info_register (MonoTrampInfo *info)
|
||||
copy->code_size = info->code_size;
|
||||
copy->name = g_strdup (info->name);
|
||||
|
||||
mono_loader_lock_if_inited ();
|
||||
mono_jit_lock ();
|
||||
tramp_infos = g_slist_prepend (tramp_infos, copy);
|
||||
mono_loader_unlock_if_inited ();
|
||||
mono_jit_unlock ();
|
||||
|
||||
mono_save_trampoline_xdebug_info (info);
|
||||
|
||||
@@ -7019,6 +7019,13 @@ delete_jump_list (gpointer key, gpointer value, gpointer user_data)
|
||||
g_slist_free (jlist->list);
|
||||
}
|
||||
|
||||
static void
|
||||
delete_got_slot_list (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
GSList *list = value;
|
||||
g_slist_free (list);
|
||||
}
|
||||
|
||||
static void
|
||||
dynamic_method_info_free (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
@@ -7060,7 +7067,7 @@ mini_free_jit_domain_info (MonoDomain *domain)
|
||||
g_hash_table_foreach (info->jump_target_hash, delete_jump_list, NULL);
|
||||
g_hash_table_destroy (info->jump_target_hash);
|
||||
if (info->jump_target_got_slot_hash) {
|
||||
g_hash_table_foreach (info->jump_target_got_slot_hash, delete_jump_list, NULL);
|
||||
g_hash_table_foreach (info->jump_target_got_slot_hash, delete_got_slot_list, NULL);
|
||||
g_hash_table_destroy (info->jump_target_got_slot_hash);
|
||||
}
|
||||
if (info->dynamic_code_hash) {
|
||||
@@ -7104,6 +7111,8 @@ mini_init (const char *filename, const char *runtime_version)
|
||||
}
|
||||
#endif
|
||||
|
||||
InitializeCriticalSection (&jit_mutex);
|
||||
|
||||
/* Happens when using the embedding interface */
|
||||
if (!default_opt_set)
|
||||
default_opt = mono_parse_default_optimizations (NULL);
|
||||
@@ -7113,8 +7122,6 @@ mini_init (const char *filename, const char *runtime_version)
|
||||
mono_set_generic_sharing_vt_supported (TRUE);
|
||||
#endif
|
||||
|
||||
InitializeCriticalSection (&jit_mutex);
|
||||
|
||||
#ifdef MONO_HAVE_FAST_TLS
|
||||
MONO_FAST_TLS_INIT (mono_jit_tls);
|
||||
MONO_FAST_TLS_INIT (mono_lmf_addr);
|
||||
|
||||
+2
-2
@@ -2652,8 +2652,8 @@ gboolean mini_is_gsharedvt_klass (MonoCompile *cfg, MonoClass *klass); /* should
|
||||
gboolean mini_is_gsharedvt_type (MonoCompile *cfg, MonoType *t) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_signature (MonoCompile *cfg, MonoMethodSignature *sig) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_type_gsctx (MonoGenericSharingContext *gsctx, MonoType *t) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_variable_type (MonoCompile *cfg, MonoType *t) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_variable_klass (MonoCompile *cfg, MonoClass *klass) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_variable_type (MonoCompile *cfg, MonoType *t) MONO_LLVM_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_variable_klass (MonoCompile *cfg, MonoClass *klass) MONO_LLVM_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_sharable_method (MonoMethod *method) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_variable_signature (MonoMethodSignature *sig) MONO_INTERNAL;
|
||||
gboolean mini_is_gsharedvt_sharable_inst (MonoGenericInst *inst) MONO_INTERNAL;
|
||||
|
||||
+48
-6
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class Test
|
||||
@@ -51,7 +52,8 @@ public class Test
|
||||
object itf;
|
||||
}
|
||||
|
||||
// Size should be 12 in both 32 and 64 bits
|
||||
// Size should be 16 in both 32 and 64 bits win/linux
|
||||
// Size should be 12 on 32bits OSX size alignment of long is 4
|
||||
[StructLayout (LayoutKind.Explicit)]
|
||||
struct TestStruct8 {
|
||||
[FieldOffset (0)]
|
||||
@@ -69,7 +71,8 @@ public class Test
|
||||
public ulong b;
|
||||
}
|
||||
|
||||
// Size should be 11 in both 32 and 64 bits
|
||||
// Size should be 16 in both 32 and 64 bits
|
||||
// Size should be 12 on 32bits OSX size alignment of long is 4
|
||||
[StructLayout (LayoutKind.Explicit)]
|
||||
struct TestStruct10 {
|
||||
[FieldOffset (0)]
|
||||
@@ -95,6 +98,34 @@ public class Test
|
||||
public int b;
|
||||
}
|
||||
|
||||
// Size should always be 12, since pack = 0, size = 0 and min alignment = 4
|
||||
//When pack is not set, we default to 8, so min (8, min alignment) -> 4
|
||||
[StructLayout (LayoutKind.Explicit)]
|
||||
struct TestStruct13 {
|
||||
[FieldOffset(0)]
|
||||
int one;
|
||||
[FieldOffset(4)]
|
||||
int two;
|
||||
[FieldOffset(8)]
|
||||
int three;
|
||||
}
|
||||
|
||||
// Size should always be 12, since pack = 8, size = 0 and min alignment = 4
|
||||
//It's aligned to min (pack, min alignment) -> 4
|
||||
[StructLayout (LayoutKind.Explicit)]
|
||||
struct TestStruct14 {
|
||||
[FieldOffset(0)]
|
||||
int one;
|
||||
[FieldOffset(4)]
|
||||
int two;
|
||||
[FieldOffset(8)]
|
||||
int three;
|
||||
}
|
||||
static bool IsOSX ()
|
||||
{
|
||||
return (int)typeof (Environment).GetMethod ("get_Platform", BindingFlags.Static | BindingFlags.NonPublic).Invoke (null, null) == 6;
|
||||
}
|
||||
|
||||
public unsafe static int Main ()
|
||||
{
|
||||
///
|
||||
@@ -181,16 +212,27 @@ public class Test
|
||||
// a VARIANT is
|
||||
if (Marshal.SizeOf (typeof (TestStruct7)) != 16)
|
||||
return 13;
|
||||
if (Marshal.SizeOf (typeof (TestStruct8)) != 16)
|
||||
return 14;
|
||||
if (IsOSX () && IntPtr.Size == 4) {
|
||||
if (Marshal.SizeOf (typeof (TestStruct8)) != 12)
|
||||
return 14;
|
||||
if (Marshal.SizeOf (typeof (TestStruct10)) != 12)
|
||||
return 16;
|
||||
} else {
|
||||
if (Marshal.SizeOf (typeof (TestStruct8)) != 16)
|
||||
return 14;
|
||||
if (Marshal.SizeOf (typeof (TestStruct10)) != 16)
|
||||
return 16;
|
||||
}
|
||||
if (Marshal.SizeOf (typeof (TestStruct9)) != 12)
|
||||
return 15;
|
||||
if (Marshal.SizeOf (typeof (TestStruct10)) != 16)
|
||||
return 16;
|
||||
if (Marshal.SizeOf (typeof (TestStruct11)) != 11)
|
||||
return 17;
|
||||
if (Marshal.SizeOf (typeof (TestStruct12)) != 6)
|
||||
return 18;
|
||||
if (Marshal.SizeOf (typeof (TestStruct13)) != 12)
|
||||
return 19;
|
||||
if (Marshal.SizeOf (typeof (TestStruct14)) != 12)
|
||||
return 20;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ mono_threads_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, guint32
|
||||
|
||||
res = CreateThread (NULL, stack_size, start, arg, creation_flags, &real_tid);
|
||||
if (out_tid)
|
||||
*out_tid = (gpointer)real_tid;
|
||||
*out_tid = real_tid;
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef pthread_t MonoNativeThreadId;
|
||||
|
||||
typedef void* mono_native_thread_return_t;
|
||||
|
||||
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) GPOINTER_TO_UINT((tid))
|
||||
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (gsize)(tid)
|
||||
|
||||
#endif /* #ifdef HOST_WIN32 */
|
||||
|
||||
|
||||
Reference in new issue
Block a user