Compare commits

...
Author SHA1 Message Date
Zoltan Varga 7aab49b912 [llvm] Disable llvm instead of asserting in some cases. Fixes #17527. 2014-04-07 22:10:23 +02:00
Marek Safar d1c2fc2dce Merge pull request #911 from Daniel15/fix-catchall-routing
Fix routing of CatchAll tokens (Bug #17960)
2014-02-24 08:47:44 +01:00
Daniel Lo Nigro cf123b125a Fix routing of CatchAll tokens 2014-02-23 22:24:32 -08:00
Alex Rønne Petersen b1e8599fb7 Fix some warnings on !MONO_ARCH_AOT_SUPPORTED targets. 2014-02-19 03:44:03 +01:00
Alex Rønne Petersen 508e0a51cd Fix another mips32 warning. 2014-02-19 03:34:19 +01:00
Alex Rønne Petersen e299219c3f Fix some warnings on mips32. 2014-02-19 03:17:54 +01:00
Alex Rønne Petersen 36bff327c2 Fix a warning. Do not try to pick this into master. 2014-02-19 03:17:32 +01:00
Alex Rønne Petersen 52ebfc6a5f Revert "[xbuild] Define VisualStudioVersion, since F# projects can depend on it"
This reverts commit 0a425af914.

Taking this out of 3.2.8 as per Don's comment:
https://github.com/mono/mono/commit/28163fd254422ee52b3dea41bb2a8eaf4cbaa567#commitcomment-5195420
2014-02-19 01:30:05 +01:00
Alex Rønne Petersen 21ba0055dd Remove unused emit_line_number_info_begin () function. Fixes a warning. 2014-02-19 01:26:42 +01:00
Ashley Winters 8497d797c1 Include xbuild_4_0_dirs in dist; fixes 425fdc03
In commit 425fdc03fa:

  [xbuild] Build & install MSBuild 12.0 assemblies

The net_3_5_only_dirs containing the Build classes were moved to
various xbuild_X_dirs variables, but an undefined $(xbuild_dirs)
variable was appended to DIST_ONLY_SUBDIRS.

This patch adds $(xbuild_4_0_dirs) instead.
2014-02-19 00:50:42 +01:00
Ashley Winters 2298db1166 Update mono-core.spec.in with xbuild reorganization 2014-02-19 00:50:24 +01:00
Rodrigo Kumpera 8cfb2d6f14 [metadata] Fix a potential crasher. 2014-02-19 00:44:20 +01:00
Zoltan Varga 0e5bfe7b13 [runtime] Fix the DISABLE_JIT build. 2014-02-19 00:43:46 +01:00
Rodrigo Kumpera 9d8808f2e5 [runtime] Handle native size of structs with explicit layout and min alignment smaller than default packing. Fixes #4510
The calculating the native size of structs with explicit layout we need to take into consideration the minimum alignment
needed and the packing asked.

If no packing is supplied, we should respect the minimum alignment. If packing is supplied we should use the minimum required.
2014-02-19 00:43:23 +01:00
Zoltan Varga 1fd9a5edae [jit] Hopefully fix the loaded LLVM build. 2014-02-19 00:42:44 +01:00
Zoltan Varga e317d346fb [runtime] Fix the computation of AssemblyName.ProcessorArchitecture () to be compatible with MS.NET. Fixes #17632. 2014-02-19 00:40:28 +01:00
Andrés G. Aragoneses 0a3328e8ab Add types from the method header even for gshared methods. 2014-02-19 00:40:22 +01:00
Zoltan Varga 0ce68d6fec [jit] Fix the freeing of AOT jump target lists. Fixes #17201. 2014-02-19 00:39:14 +01:00
Zoltan Varga e486a575f6 Revert "[jit] Align the stack in mono_arch_restore_context () on x86 since it might be unaligned if it was captured asynchronously."
This reverts commit 7798b94706.

Revert this as it breaks debugging on android/x86 (#17410).
2014-02-19 00:38:17 +01:00
Zoltan Varga 176bfbc462 [jit] Avoid running class cctors during AOT when using the AggressiveInlining attribute. Fixes #17558. 2014-02-19 00:37:06 +01:00
Zoltan Varga 3555e32abd [arm] Increase the length of the endfinally instruction. Fixes #17589. 2014-02-19 00:36:53 +01:00
Andrea Canciani 57ec3d8d41 [corlib] Fix implementation of Tuple hash generator
The Tuples.cs code generator dies with:

Unhandled Exception:
System.NotImplementedException: The requested feature is not implemented.
  at TupleGen.computeHash (Int32 destVar, Int32 start, Int32 count) [0x00000] in <filename unknown>:0
  at TupleGen.WriteHash (Int32 destVar, Int32 start, Int32 count) [0x00000] in <filename unknown>:0
  at TupleGen.Main () [0x00000] in <filename unknown>:0

This is caused by the incorrect definition of WriteHash(), which
instead of recursively calling itself is calling computeHash().

Thanks to Marek Safar for reporting the issue in
https://github.com/fsharp/fsharp/issues/188#issuecomment-34351850
2014-02-19 00:35:32 +01:00
Marek Safar 81d238e2fc [corlib] Fixes formatting of nested tuples 2014-02-19 00:35:18 +01:00
Marek Safar 3a3cf737c3 [numerics] Fix type in Cosh 2014-02-19 00:32:21 +01:00
Rodrigo Kumpera d15c11b038 [runtime] Fix the linux build. 2014-02-19 00:30:14 +01:00
Rodrigo Kumpera 5c2959f9d0 [runtime] Add two variants of mono_gc_bzero and mono_gc_memmove. They better convey the behavior we need.
After reviewing all usage of mono_gc_bzero and mono_gc_memmove, I found that there are two usage patterns
we care for:

1)Aligned pointer, any size, have managed pointers.
This happens when directly dealing with managed objects like when cloning of boxing.
On this case, all pointers MUST be aligned.

2)Maybe aligned pointer, any size, might have managed pointers.
This happens for functions dealing with structs, specially around boxing and unboxing them.
Our data layout code ensures that structs with managed layout are aligned to at least a word.
This means that if the pointer is unaligned, no managed pointer can exists in the memory range
been processed.

Given those two scenarios, lets introduce two variants that enforce those constrains.

_aligned:
Pointers must be aligned, ensures atomicity of word copies;

_atomic:
If pointers are aligned, works like _aligned, otherwise it inherits the behavior of the
system memmove&memset.

The above split ensures we won't have to deal with any RISC unaligned load nonsense.

It also adds some sanity checks to code that must respect alignment.

We still need fast code for mono_gc_memmove_aligned and mono_gc_bzero_aligned.

We still need to verify if a version of memcpy version is needed. Maybe the extra
branch is not such a perf penalty.
2014-02-19 00:30:06 +01:00
Alex Rønne Petersen 8300404024 ARM: Emit shorter floating point load/store sequences when possible. 2014-02-19 00:29:56 +01:00
Alex Rønne Petersen 7bfa0c1771 ARM: Handle large offsets in emit_float_args (). 2014-02-19 00:29:48 +01:00
Alex Rønne Petersen 5795ec2676 ARM: Back up VFP scratch registers before using them on hard float.
This is because d0-d7 are argument registers and d8-d15 are
preserved registers - we can't use any of them as scratch
registers without restoring their previous values.
2014-02-19 00:29:42 +01:00
Zoltan Varga 9bea602094 [arm] Use d0/d1 as fp scratch regs on non-hard float platforms. Hopefully fixes #17597. 2014-02-19 00:28:31 +01:00
Rolf Bjarne Kvinge c773bf31dc Properly preserve VPF registers in iOS. Fixes #17793. 2014-02-19 00:27:01 +01:00
Rodrigo Kumpera 0531c65cc8 Bump mono to 3.2.8 2014-02-18 18:13:58 -05:00
Michael Hutchinson 1b62dca6cc [xbuild] Fix PCL 4.5 targets 2014-02-18 12:09:48 -05:00
Michael Hutchinson 0a425af914 [xbuild] Define VisualStudioVersion, since F# projects can depend on it 2014-02-18 12:09:12 -05:00
Ashley Winters 472bc7bfa5 Fix 'make dist' broken since 35287878
In commit 35287878b9:

    [xbuild] Reorganize xbuild targets/frameworks/bin data

Several files were shuffled around, but the EXTRA_DISTFILES was
not fully updated with the new file paths.

This patch is required to build a 3.2.7 tarball.
2014-02-18 12:09:04 -05:00
Alex Rønne Petersen 7c274c477d Merge pull request #893 from antoniusriha/fixregression
[runtime] Fix a regression caused by a0afa38296
2014-02-18 16:46:24 +01:00
Alex Rønne Petersen 1bb562b8d5 Merge pull request #894 from antoniusriha/fixIsIPv6Teredo
[System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
2014-02-18 03:42:03 +01:00
Alexander Köplinger 3901f01875 [System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
The property was introduced with PR #870 but it missed to convert network byte order to host byte order, so the comparison
wasn't working correctly and the corresponding unit test failed. @marek-safar erroneously "fixed" the test in 27e07c7.

This is the corrected implementation and the original test now works as intended.
2014-02-09 13:02:33 +01:00
Zoltan Varga cf7d241aab [runtime] Fix a regression caused by a0afa38296. 2014-02-09 10:27:40 +01:00
Rodrigo Kumpera 40f92d5cb6 [System] Fix process creation when UseShellExecute is set to false.
This fixes the behavior of process spawning when UseShellExecute is
set to true.

The right behavior is to return no process only when we used the system
launcher. So, spawning /bin/cat should behave in the same way independent
of how UseShellExecute is set.
2014-02-06 15:56:14 -05:00
Rodrigo Kumpera 0895a37089 Revert "[runtime] Don't pass SEE_MASK_NOCLOSEPROCESS to ShellExecuteEx as we don't care for the launched process. Part 1/3 of Bug #16119."
This reverts commit 6c06d10995.
2014-02-06 15:56:01 -05:00
Zoltan Varga 5b8ba7e3ca [runtime] Put back ensure_synch_cs_set () which was removed in a157ac79e8 to work around some shutdown crashes. 2014-02-06 20:09:05 +01:00
Alan McGovern 0c35cf5ef0 [Microsoft.Build.Utilities] Properly escape/unescape ItemSpec
With tests.
2014-01-28 16:28:22 -05:00
Alan McGovern d2a1623a18 [Microsoft.Build.Utilities] Fix the escaping/unescaping of ItemSpec
This should hopefully fix compilation of projects using files with
names like '[email protected]' in various places like embedded resources
or content items which must be copied to the output directory.

With tests.
2014-01-28 16:28:16 -05:00
Alan McGovern cb725ff9de [Microsoft.Build.Engine] Fix the escaping/unescaping of FullPath metadata
It is incorrect to escape the FullPath metadata for a build item when
we invoke GetEvaluatedMetadata. If we do this we end up completely breaking
every file with a special character in it as things like this would always
fail as we'd pass an escaped path to the filesystem:
	File.Exists (item.GetEvaluatedMetadata ("FullPath"))

The iOS designer encountered this issue when we added retina images
called "[email protected]" to our solution.

With tests.
2014-01-28 16:28:11 -05:00
Rodrigo Kumpera 50f293135f Properly compare assembly versions when performing binding. Fixes #17368.
The right way to compare assembly versions is by translating the major/minor
pair into a single number and compare that.

Since each element can only be one byte long, we multiply major by 256
before adding to minor.

This solves the problem where version 100.0.0.0 was not after 3.5.0.0.
2014-01-27 16:39:38 -05:00
Aaron Bockover 11e1a399ac driver.c: Revert "Update message"
This reverts commit 85841d0bbd.

Some scripts unfortunately depend on the verbage "Mono JIT compiler"
in the "mono --version" message. While this was never a blessed
or supported way of getting the version (use pkg-config) of Mono,
nonetheless this breaks some important stuff. We can use the better
message in the (somewhat distant) future.
2014-01-16 18:05:25 -05:00
Zoltan Varga 61740f8417 [jit] Use the jit lock instead of the loader lock in mono_tramp_info_register (). 2014-01-15 18:51:58 +01:00
66 changed files with 768 additions and 332 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [3.2.7],
AC_INIT(mono, [3.2.8],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
+1 -1
View File
@@ -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 ()
+1 -1
View File
@@ -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)
@@ -606,7 +606,7 @@ namespace System.Web.Routing
pendingPartsAreAllSafe = true;
pendingParts.Append (token.Name);
} else {
if (token.Type == PatternTokenType.Standard) {
if (token.Type == PatternTokenType.Standard || token.Type == PatternTokenType.CatchAll) {
if (pendingPartsAreAllSafe) {
// Accept
if (pendingParts.Length > 0) {
@@ -1723,6 +1723,36 @@ namespace MonoTests.System.Web.Routing
Assert.AreEqual("2013/08/hello-world", vp.VirtualPath, "#2");
}
[Test (Description = "Xamarin Bug #17960")]
public void GetVirtualPathWithCatchall1()
{
var r = new MyRoute("HelloWorld/{*path}", new MyRouteHandler());
var hc = new HttpContextStub2("~/", String.Empty);
var values = new RouteValueDictionary()
{
{ "path", "foobar" },
};
var vp = r.GetVirtualPath(new RequestContext(hc, new RouteData()), values);
Assert.IsNotNull(vp, "#1");
Assert.AreEqual("HelloWorld/foobar", vp.VirtualPath, "#2");
}
[Test (Description = "Xamarin Bug #17960")]
public void GetVirtualPathWithCatchall2()
{
var r = new MyRoute("HelloWorld/{*path}", new MyRouteHandler());
var hc = new HttpContextStub2("~/", String.Empty);
var values = new RouteValueDictionary()
{
{ "path", "foo/bar/baz" },
};
var vp = r.GetVirtualPath(new RequestContext(hc, new RouteData()), values);
Assert.IsNotNull(vp, "#1");
Assert.AreEqual("HelloWorld/foo/bar/baz", vp.VirtualPath, "#2");
}
// Bug #500739
[Test]
public void RouteGetRequiredStringWithDefaults ()
@@ -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;
}
+1 -1
View File
@@ -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;
}
}
+93 -48
View File
@@ -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
+63
View File
@@ -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
+1
View File
@@ -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
+10 -3
View File
@@ -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
View File
@@ -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
+3
View File
@@ -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) {
+1 -1
View File
@@ -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 {
+18 -4
View File
@@ -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 */
+3 -3
View File
@@ -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));
}
+1
View File
@@ -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;
+2
View File
@@ -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;
+1 -1
View File
@@ -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);
+4 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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;
+7 -7
View File
@@ -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;
}
+5 -2
View File
@@ -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)) {
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
+1 -1
View File
@@ -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;
}
+6 -2
View File
@@ -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__)
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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);
+3 -3
View File
@@ -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;
}
+4 -4
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+4
View File
@@ -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 */
+16 -2
View File
@@ -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
View File
@@ -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
+3 -3
View File
@@ -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
View File
@@ -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 ();
-63
View File
@@ -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)
{
+1 -1
View File
@@ -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);
}
/*
-2
View File
@@ -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 */
+2
View File
@@ -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
View File
@@ -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);
+8 -4
View File
@@ -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
+3
View File
@@ -4551,6 +4551,9 @@ mono_llvm_emit_method (MonoCompile *cfg)
g_assert (LLVMTypeOf (ctx->addresses [sreg1]) == LLVMTypeOf (values [phi->dreg]));
LLVMAddIncoming (values [phi->dreg], &ctx->addresses [sreg1], &in_bb, 1);
} else {
if (LLVMTypeOf (values [sreg1]) != LLVMTypeOf (values [phi->dreg]))
// FIXME:
LLVM_FAILURE (ctx, "incoming phi arg type mismatch");
g_assert (LLVMTypeOf (values [sreg1]) == LLVMTypeOf (values [phi->dreg]));
LLVMAddIncoming (values [phi->dreg], &values [sreg1], &in_bb, 1);
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 */