mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11a5aa9194 | ||
|
|
4c5bc2f25d | ||
|
|
9475ea4fb5 | ||
|
|
fd9042c45f | ||
|
|
07fa020214 | ||
|
|
759c1feba6 | ||
|
|
fe326b4b03 | ||
|
|
4b2ce1dd9b | ||
|
|
e15dc436d6 | ||
|
|
87e1a9dec7 | ||
|
|
37c4bf2811 | ||
|
|
9c18adad5b | ||
|
|
ddf0c921cc | ||
|
|
c7a9db4601 | ||
|
|
2bb8b89fbb | ||
|
|
c21a1a986e | ||
|
|
e06d95aee7 | ||
|
|
d2fd8af07c | ||
|
|
b83734b685 | ||
|
|
f8449e3c83 | ||
|
|
4c841588ab | ||
|
|
69e0c474af | ||
|
|
f4252bf31f | ||
|
|
b1b43988be | ||
|
|
e714f39a69 | ||
|
|
8a5a727862 | ||
|
|
b0e53d628a | ||
|
|
6ee3ac5fdb | ||
|
|
95a02a52d4 | ||
|
|
87d50fbdb5 | ||
|
|
e7abfa0270 | ||
|
|
2a76e5b082 | ||
|
|
95278910f3 | ||
|
|
480bcd4b70 | ||
|
|
510af4b6e7 | ||
|
|
ae83f6bd02 | ||
|
|
d445cca2f2 |
No files matched your search
Vendored
+1
-1
Submodule external/nunit-lite updated: 5a80e74622...7065bc89e8.
@@ -1035,7 +1035,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
|
||||
#if XBUILD_12
|
||||
// see http://msdn.microsoft.com/en-us/library/vstudio/hh162058(v=vs.120).aspx
|
||||
if (effective_tools_version == "12.0") {
|
||||
if (effective_tools_version == "12.0" || effective_tools_version == "14.0") {
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath32", toolsPath, PropertyType.Reserved));
|
||||
|
||||
var frameworkToolsPath = ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version451);
|
||||
|
||||
@@ -128,6 +128,10 @@ namespace Microsoft.Build.Tasks {
|
||||
relatedFiles = tempRelatedFiles.Values.ToArray ();
|
||||
resolvedDependencyFiles = tempResolvedDepFiles.Values.ToArray ();
|
||||
|
||||
#if XBUILD_14
|
||||
DependsOnSystemRuntime = resolvedDependencyFiles.Any (x => Path.GetFileName (x.ItemSpec) == "System.Runtime.dll").ToString ();
|
||||
#endif
|
||||
|
||||
tempResolvedFiles.Clear ();
|
||||
tempCopyLocalFiles.Clear ();
|
||||
tempSatelliteFiles.Clear ();
|
||||
|
||||
@@ -40,65 +40,16 @@ namespace Mono.Security.Protocol.Tls
|
||||
|
||||
public static CipherSuiteCollection GetSupportedCiphers (bool server, SecurityProtocolType protocol)
|
||||
{
|
||||
CipherSuiteCollection suites;
|
||||
switch (protocol) {
|
||||
case SecurityProtocolType.Default:
|
||||
case SecurityProtocolType.Tls:
|
||||
suites = CipherSuiteFactory.GetTls1SupportedCiphers ();
|
||||
break;
|
||||
return CipherSuiteFactory.GetTls1SupportedCiphers ();
|
||||
case SecurityProtocolType.Ssl3:
|
||||
suites = CipherSuiteFactory.GetSsl3SupportedCiphers ();
|
||||
break;
|
||||
return CipherSuiteFactory.GetSsl3SupportedCiphers ();
|
||||
case SecurityProtocolType.Ssl2:
|
||||
default:
|
||||
throw new NotSupportedException ("Unsupported security protocol type");
|
||||
}
|
||||
|
||||
IEnumerable<string> list = null;
|
||||
#if INSIDE_SYSTEM
|
||||
// if SSL/TLS support is built-in System.dll (e.g. monotouch) then we can access ServicePointManager
|
||||
// extension directly
|
||||
var cb = server ? ServicePointManager.ServerCipherSuitesCallback : ServicePointManager.ClientCipherSuitesCallback;
|
||||
if (cb == null)
|
||||
return suites; // e.g. no callback was set
|
||||
|
||||
list = cb ((System.Net.SecurityProtocolType) (int) protocol, suites.GetNames ());
|
||||
#elif !BOOTSTRAP_BASIC
|
||||
// Mono.Security must work on MS.NET so it cannot depend on any Mono-specific extensions
|
||||
PropertyInfo pi = null;
|
||||
if (server) {
|
||||
if (server_callback == null)
|
||||
server_callback = spm.GetProperty ("ServerCipherSuitesCallback", BindingFlags.Static | BindingFlags.Public);
|
||||
pi = server_callback;
|
||||
} else {
|
||||
if (client_callback == null)
|
||||
client_callback = spm.GetProperty ("ClientCipherSuitesCallback", BindingFlags.Static | BindingFlags.Public);
|
||||
pi = client_callback;
|
||||
}
|
||||
if (pi == null)
|
||||
return suites; // e.g. MS runtime - return every supported suites
|
||||
|
||||
var cb = (Delegate) pi.GetGetMethod ().Invoke (null, null);
|
||||
if (cb == null)
|
||||
return suites; // e.g. no callback was set - return every supported suites
|
||||
|
||||
list = (IEnumerable<string>) cb.DynamicInvoke (new object[] {
|
||||
(System.Net.SecurityProtocolType) (int) protocol, suites.GetNames ()
|
||||
});
|
||||
#else
|
||||
// TODO: right now the callback is only available when using System.Net.* types for SSL/TLS
|
||||
return suites;
|
||||
#endif
|
||||
CipherSuiteCollection allowed = new CipherSuiteCollection (protocol);
|
||||
if (list != null) {
|
||||
foreach (var name in list) {
|
||||
// add any supported (ignore unknowns) ciphers requested by the callback
|
||||
var cipher = suites [name];
|
||||
if (cipher != null)
|
||||
allowed.Add (cipher);
|
||||
}
|
||||
}
|
||||
return allowed;
|
||||
}
|
||||
|
||||
#region Private Static Methods
|
||||
|
||||
@@ -169,17 +169,6 @@ public class TlsTest {
|
||||
ServicePointManager.CertificatePolicy = new TestCertificatePolicy ();
|
||||
ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType) (int) protocol;
|
||||
|
||||
ServicePointManager.ClientCipherSuitesCallback += (System.Net.SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
Console.WriteLine ("Protocol: {0}", p);
|
||||
// var ciphers = allCiphers;
|
||||
var ciphers = from cipher in allCiphers where !cipher.Contains ("EXPORT") select cipher;
|
||||
string prefix = p == System.Net.SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
// var ciphers = new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA", prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
foreach (var cipher in ciphers)
|
||||
Console.WriteLine ("\t{0}", cipher);
|
||||
return ciphers;
|
||||
};
|
||||
|
||||
Uri uri = new Uri (url);
|
||||
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
#include common_System.Core.dll.sources
|
||||
#include interpreter_System.Core.dll.sources
|
||||
#include monotouch_System.Core.dll.sources
|
||||
@@ -1,2 +1 @@
|
||||
#include common_System.Core.dll.sources
|
||||
#include interpreter_System.Core.dll.sources
|
||||
#include monotouch_System.Core.dll.sources
|
||||
@@ -6,6 +6,9 @@ LIBRARY = System.Net.Http.dll
|
||||
|
||||
LIB_REFS = System.Core System
|
||||
LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
|
||||
ifeq (monodroid,$(PROFILE))
|
||||
LIB_MCS_FLAGS += -d:XAMARIN_MODERN
|
||||
endif
|
||||
|
||||
TEST_LIB_REFS = System System.Core
|
||||
TEST_MCS_FLAGS =
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Net.Http {
|
||||
public partial class HttpClient {
|
||||
|
||||
public HttpClient ()
|
||||
: this (GetDefaultHandler (), true)
|
||||
{
|
||||
}
|
||||
|
||||
static HttpMessageHandler GetDefaultHandler ()
|
||||
{
|
||||
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
|
||||
if (type == null)
|
||||
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
|
||||
|
||||
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (method == null)
|
||||
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
|
||||
|
||||
object ret = method.Invoke (null, null);
|
||||
if (ret == null)
|
||||
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
|
||||
|
||||
var handler = ret as HttpMessageHandler;
|
||||
if (handler == null)
|
||||
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
|
||||
return handler;
|
||||
}
|
||||
|
||||
static HttpMessageHandler GetFallback (string message)
|
||||
{
|
||||
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
|
||||
return new HttpClientHandler ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
#include System.Net.Http.dll.sources
|
||||
System.Net.Http/HttpClient.android.cs
|
||||
@@ -62,11 +62,6 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
|
||||
[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
|
||||
// for SyndicationElementExtension
|
||||
// FIXME: mcs in 2-10 branch breaks System.ServiceModel build on resolving this. So, disabling it so far.
|
||||
// [assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=00000000000000000400000000000000")]
|
||||
#endif
|
||||
[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
|
||||
[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=" + AssemblyRef.MicrosoftPublicKey)]
|
||||
|
||||
[assembly: ComVisible (false)]
|
||||
@@ -65,16 +65,12 @@ namespace Mono.Net.Security
|
||||
public static X509Chain CreateX509Chain (XX509CertificateCollection certs)
|
||||
{
|
||||
var chain = new X509Chain ();
|
||||
chain.ChainPolicy = new X509ChainPolicy ();
|
||||
chain.ChainPolicy = new X509ChainPolicy ((X509CertificateCollection)(object)certs);
|
||||
|
||||
#if !MOBILE
|
||||
chain.ChainPolicy.RevocationMode = revocation_mode;
|
||||
#endif
|
||||
|
||||
for (int i = 1; i < certs.Count; i++) {
|
||||
chain.ChainPolicy.ExtraStore.Add (certs [i]);
|
||||
}
|
||||
|
||||
return chain;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,20 @@ using System.Collections.Generic;
|
||||
|
||||
namespace System.Net {
|
||||
|
||||
/*
|
||||
* The idea behind this API was to let the application filter the set of cipher suites received / send to
|
||||
* the remote side. This concept does not any longer work with the new native implementations.
|
||||
*/
|
||||
|
||||
[Obsolete ("This API is no longer supported.")]
|
||||
public delegate IEnumerable<string> CipherSuitesCallback (SecurityProtocolType protocol, IEnumerable<string> allCiphers);
|
||||
|
||||
public partial class ServicePointManager {
|
||||
|
||||
[Obsolete ("This API is no longer supported.", true)]
|
||||
public static CipherSuitesCallback ClientCipherSuitesCallback { get; set; }
|
||||
|
||||
[Obsolete ("This API is no longer supported.", true)]
|
||||
public static CipherSuitesCallback ServerCipherSuitesCallback { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -147,7 +147,8 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
|
||||
certArray = FromIntPtrs (secCerts);
|
||||
|
||||
host = CFStringCreateWithCharacters (IntPtr.Zero, hostName, (IntPtr) hostName.Length);
|
||||
if (!string.IsNullOrEmpty (hostName))
|
||||
host = CFStringCreateWithCharacters (IntPtr.Zero, hostName, (IntPtr) hostName.Length);
|
||||
sslsecpolicy = SecPolicyCreateSSL (true, host);
|
||||
|
||||
int code = SecTrustCreateWithCertificates (certArray, sslsecpolicy, out sectrust);
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
|
||||
private OidCollection apps;
|
||||
private OidCollection cert;
|
||||
private X509Certificate2Collection store;
|
||||
private X509CertificateCollection store;
|
||||
private X509Certificate2Collection store2;
|
||||
private X509RevocationFlag rflag;
|
||||
private X509RevocationMode mode;
|
||||
private TimeSpan timeout;
|
||||
@@ -49,6 +50,24 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
Reset ();
|
||||
}
|
||||
|
||||
/*
|
||||
* Lazy-init ExtraStore from X509CertificateCollection.
|
||||
* This is called from Mono.Net.Security.SystemCertificateValidator.CreateX509Chain.
|
||||
*
|
||||
* AppleTLS supports a lazily-initialized X509Certificate, but not X509Certificate2 so
|
||||
* we need to fall-back to using Mono.Security.X509 whenever we need an X509Certificate2.
|
||||
* To avoid unnecessary fallbacks, the private Mono.Net.Security APIs use X509Certificate
|
||||
* instead of X509Certificate2.
|
||||
*
|
||||
* Since 'ExtraStore' returns X509Certificate2Collection, we need to convert these to
|
||||
* X509Certificate2.
|
||||
*/
|
||||
internal X509ChainPolicy (X509CertificateCollection store)
|
||||
{
|
||||
this.store = store;
|
||||
Reset ();
|
||||
}
|
||||
|
||||
// properties
|
||||
|
||||
public OidCollection ApplicationPolicy {
|
||||
@@ -60,7 +79,18 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
}
|
||||
|
||||
public X509Certificate2Collection ExtraStore {
|
||||
get { return store; }
|
||||
get {
|
||||
if (store2 != null)
|
||||
return store2;
|
||||
|
||||
store2 = new X509Certificate2Collection ();
|
||||
if (store != null) {
|
||||
foreach (var cert in store) {
|
||||
store2.Add (new X509Certificate2 (cert));
|
||||
}
|
||||
}
|
||||
return store2;
|
||||
}
|
||||
}
|
||||
|
||||
public X509RevocationFlag RevocationFlag {
|
||||
@@ -106,7 +136,7 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
{
|
||||
apps = new OidCollection ();
|
||||
cert = new OidCollection ();
|
||||
store = new X509Certificate2Collection ();
|
||||
store2 = null;
|
||||
rflag = X509RevocationFlag.ExcludeRoot;
|
||||
mode = X509RevocationMode.Online;
|
||||
timeout = TimeSpan.Zero;
|
||||
|
||||
@@ -95,80 +95,6 @@ public class SslStreamTest {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClientCipherSuitesCallback ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA" };
|
||||
};
|
||||
// client will only offers AES 128 - that's fine since the server support it (and many more ciphers)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ServerCipherSuitesCallback ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// server only accept AES 256 - that's fine since the client support it (and many more ciphers)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CipherSuitesCallbacks ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA", prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA", prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// both client and server supports AES (128 and 256) - server will select 128 (first choice)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MismatchedCipherSuites ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA" };
|
||||
};
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// mismatch! server will refuse and send back an alert
|
||||
AuthenticateClientAndServer (false, false);
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void StartClientAndAuthenticate (ClientServerState state,
|
||||
IPEndPoint endPoint) {
|
||||
try {
|
||||
|
||||
@@ -75,10 +75,8 @@ CC_PROFILE := $(filter monotouch% xammac, $(PROFILE))
|
||||
ifdef CC_PROFILE
|
||||
|
||||
BUILT_SOURCES = \
|
||||
CommonCrypto/AesCryptoServiceProvider.g.cs \
|
||||
CommonCrypto/MD5CryptoServiceProvider.g.cs \
|
||||
CommonCrypto/SHA256Managed.g.cs \
|
||||
CommonCrypto/AesManaged.g.cs \
|
||||
CommonCrypto/RC2CryptoServiceProvider.g.cs \
|
||||
CommonCrypto/SHA384Managed.g.cs \
|
||||
CommonCrypto/DESCryptoServiceProvider.g.cs \
|
||||
|
||||
@@ -602,6 +602,12 @@ namespace System
|
||||
get;
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
static int get_core_clr_security_level ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
public extern int get_core_clr_security_level ();
|
||||
@@ -616,6 +622,7 @@ namespace System
|
||||
|
||||
public override bool IsSecuritySafeCritical {
|
||||
get { return get_core_clr_security_level () == 1; }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -296,6 +296,12 @@ namespace System.Reflection {
|
||||
throw new InvalidOperationException ("Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.");
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
static int get_core_clr_security_level ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
public extern int get_core_clr_security_level ();
|
||||
@@ -311,5 +317,6 @@ namespace System.Reflection {
|
||||
public override bool IsSecuritySafeCritical {
|
||||
get { return get_core_clr_security_level () == 1; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -502,9 +502,16 @@ namespace System.Reflection {
|
||||
return CustomAttributeData.GetCustomAttributes (this);
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
static int get_core_clr_security_level ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
public extern int get_core_clr_security_level ();
|
||||
#endif
|
||||
|
||||
public override bool IsSecurityTransparent {
|
||||
get { return get_core_clr_security_level () == 0; }
|
||||
@@ -752,8 +759,15 @@ namespace System.Reflection {
|
||||
return CustomAttributeData.GetCustomAttributes (this);
|
||||
}
|
||||
|
||||
#if MOBILE
|
||||
static int get_core_clr_security_level ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
public extern int get_core_clr_security_level ();
|
||||
#endif
|
||||
|
||||
public override bool IsSecurityTransparent {
|
||||
get { return get_core_clr_security_level () == 0; }
|
||||
|
||||
+13
-26
@@ -12,35 +12,22 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
return new X509CertificateImplApple (handle, false);
|
||||
}
|
||||
|
||||
public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
|
||||
static X509CertificateImpl Import (byte[] rawData)
|
||||
{
|
||||
MX.X509Certificate x509;
|
||||
IntPtr handle;
|
||||
if (password == null) {
|
||||
handle = CFHelpers.CreateCertificateFromData (rawData);
|
||||
if (handle != IntPtr.Zero)
|
||||
return new X509CertificateImplApple (handle, true);
|
||||
var handle = CFHelpers.CreateCertificateFromData (rawData);
|
||||
if (handle != IntPtr.Zero)
|
||||
return new X509CertificateImplApple (handle, true);
|
||||
|
||||
MX.X509Certificate x509;
|
||||
try {
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
x509 = X509Helper.ImportPkcs12 (rawData, null);
|
||||
} catch {
|
||||
string msg = Locale.GetText ("Unable to decode certificate.");
|
||||
// inner exception is the original (not second) exception
|
||||
throw new CryptographicException (msg, e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// try PKCS#12
|
||||
try {
|
||||
x509 = X509Helper.ImportPkcs12 (rawData, password);
|
||||
}
|
||||
catch {
|
||||
// it's possible to supply a (unrequired/unusued) password
|
||||
// fix bug #79028
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
x509 = ImportPkcs12 (rawData, null);
|
||||
} catch {
|
||||
string msg = Locale.GetText ("Unable to decode certificate.");
|
||||
// inner exception is the original (not second) exception
|
||||
throw new CryptographicException (msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,34 +148,46 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
}
|
||||
}
|
||||
|
||||
#if !MONOTOUCH && !XAMMAC
|
||||
public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
|
||||
static byte[] PEM (string type, byte[] data)
|
||||
{
|
||||
if (nativeHelper != null)
|
||||
return nativeHelper.Import (rawData, password, keyStorageFlags);
|
||||
string pem = Encoding.ASCII.GetString (data);
|
||||
string header = String.Format ("-----BEGIN {0}-----", type);
|
||||
string footer = String.Format ("-----END {0}-----", type);
|
||||
int start = pem.IndexOf (header) + header.Length;
|
||||
int end = pem.IndexOf (footer, start);
|
||||
string base64 = pem.Substring (start, (end - start));
|
||||
return Convert.FromBase64String (base64);
|
||||
}
|
||||
|
||||
static byte[] ConvertData (byte[] data)
|
||||
{
|
||||
if (data == null || data.Length == 0)
|
||||
return data;
|
||||
|
||||
// does it looks like PEM ?
|
||||
if (data [0] != 0x30) {
|
||||
try {
|
||||
return PEM ("CERTIFICATE", data);
|
||||
} catch {
|
||||
// let the implementation take care of it.
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
#if !MONOTOUCH && !XAMMAC
|
||||
static X509CertificateImpl Import (byte[] rawData)
|
||||
{
|
||||
MX.X509Certificate x509;
|
||||
if (password == null) {
|
||||
try {
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
x509 = ImportPkcs12 (rawData, null);
|
||||
} catch {
|
||||
string msg = Locale.GetText ("Unable to decode certificate.");
|
||||
// inner exception is the original (not second) exception
|
||||
throw new CryptographicException (msg, e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// try PKCS#12
|
||||
try {
|
||||
x509 = ImportPkcs12 (rawData, password);
|
||||
}
|
||||
catch {
|
||||
// it's possible to supply a (unrequired/unusued) password
|
||||
// fix bug #79028
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
x509 = ImportPkcs12 (rawData, null);
|
||||
} catch {
|
||||
string msg = Locale.GetText ("Unable to decode certificate.");
|
||||
// inner exception is the original (not second) exception
|
||||
throw new CryptographicException (msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +195,26 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
}
|
||||
#endif
|
||||
|
||||
public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
|
||||
{
|
||||
if (password == null) {
|
||||
rawData = ConvertData (rawData);
|
||||
return Import (rawData);
|
||||
}
|
||||
|
||||
MX.X509Certificate x509;
|
||||
// try PKCS#12
|
||||
try {
|
||||
x509 = ImportPkcs12 (rawData, password);
|
||||
} catch {
|
||||
// it's possible to supply a (unrequired/unusued) password
|
||||
// fix bug #79028
|
||||
x509 = new MX.X509Certificate (rawData);
|
||||
}
|
||||
|
||||
return new X509CertificateImplMono (x509);
|
||||
}
|
||||
|
||||
public static byte[] Export (X509CertificateImpl impl, X509ContentType contentType, byte[] password)
|
||||
{
|
||||
ThrowIfContextInvalid (impl);
|
||||
|
||||
@@ -159,33 +159,33 @@ namespace System.Threading
|
||||
|
||||
public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) {
|
||||
try {
|
||||
if (exitContext) {
|
||||
#if MONOTOUCH
|
||||
throw new NotSupportedException ("exitContext == true is not supported");
|
||||
#else
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.ExitContext ();
|
||||
#endif
|
||||
}
|
||||
return Wait (obj, millisecondsTimeout);
|
||||
}
|
||||
finally {
|
||||
if (exitContext) SynchronizationAttribute.EnterContext ();
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.EnterContext ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Wait(object obj, TimeSpan timeout, bool exitContext) {
|
||||
try {
|
||||
if (exitContext) {
|
||||
#if MONOTOUCH
|
||||
throw new NotSupportedException ("exitContext == true is not supported");
|
||||
#else
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.ExitContext ();
|
||||
#endif
|
||||
}
|
||||
return Wait (obj, timeout);
|
||||
}
|
||||
finally {
|
||||
if (exitContext) SynchronizationAttribute.EnterContext ();
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.EnterContext ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,16 +47,13 @@ namespace System.Threading
|
||||
|
||||
static int WaitMultiple(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext, bool WaitAll)
|
||||
{
|
||||
#if MONOTOUCH
|
||||
if (exitContext)
|
||||
throw new NotSupportedException ("exitContext == true is not supported");
|
||||
#endif
|
||||
|
||||
int release_last = -1;
|
||||
|
||||
try {
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.ExitContext ();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < waitHandles.Length; ++i) {
|
||||
try {
|
||||
@@ -70,51 +67,52 @@ namespace System.Threading
|
||||
}
|
||||
|
||||
if (WaitAll)
|
||||
return WaitAll_internal (waitHandles, millisecondsTimeout, exitContext);
|
||||
return WaitAll_internal (waitHandles, millisecondsTimeout);
|
||||
else
|
||||
return WaitAny_internal (waitHandles, millisecondsTimeout, exitContext);
|
||||
return WaitAny_internal (waitHandles, millisecondsTimeout);
|
||||
} finally {
|
||||
for (int i = release_last; i >= 0; --i) {
|
||||
waitHandles [i].SafeWaitHandle.DangerousRelease ();
|
||||
}
|
||||
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.EnterContext ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private static extern int WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
|
||||
private static extern int WaitAll_internal(WaitHandle[] handles, int ms);
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
|
||||
private static extern int WaitAny_internal(WaitHandle[] handles, int ms);
|
||||
|
||||
static int WaitOneNative (SafeHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
|
||||
{
|
||||
#if MONOTOUCH
|
||||
if (exitContext)
|
||||
throw new NotSupportedException ("exitContext == true is not supported");
|
||||
#endif
|
||||
|
||||
bool release = false;
|
||||
try {
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.ExitContext ();
|
||||
#endif
|
||||
|
||||
waitableSafeHandle.DangerousAddRef (ref release);
|
||||
|
||||
return WaitOne_internal (waitableSafeHandle.DangerousGetHandle (), (int) millisecondsTimeout, exitContext);
|
||||
return WaitOne_internal (waitableSafeHandle.DangerousGetHandle (), (int) millisecondsTimeout);
|
||||
} finally {
|
||||
if (release)
|
||||
waitableSafeHandle.DangerousRelease ();
|
||||
|
||||
#if !DISABLE_REMOTING
|
||||
if (exitContext)
|
||||
SynchronizationAttribute.EnterContext ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern int WaitOne_internal(IntPtr handle, int ms, bool exitContext);
|
||||
static extern int WaitOne_internal(IntPtr handle, int ms);
|
||||
|
||||
static int SignalAndWaitOne (SafeWaitHandle waitHandleToSignal,SafeWaitHandle waitHandleToWaitOn, int millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
|
||||
{
|
||||
@@ -123,7 +121,7 @@ namespace System.Threading
|
||||
waitHandleToSignal.DangerousAddRef (ref releaseHandleToSignal);
|
||||
waitHandleToWaitOn.DangerousAddRef (ref releaseHandleToWaitOn);
|
||||
|
||||
return SignalAndWait_Internal (waitHandleToSignal.DangerousGetHandle (), waitHandleToWaitOn.DangerousGetHandle (), millisecondsTimeout, exitContext);
|
||||
return SignalAndWait_Internal (waitHandleToSignal.DangerousGetHandle (), waitHandleToWaitOn.DangerousGetHandle (), millisecondsTimeout);
|
||||
} finally {
|
||||
if (releaseHandleToSignal)
|
||||
waitHandleToSignal.DangerousRelease ();
|
||||
@@ -133,6 +131,6 @@ namespace System.Threading
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern int SignalAndWait_Internal (IntPtr toSignal, IntPtr toWaitOn, int ms, bool exitContext);
|
||||
static extern int SignalAndWait_Internal (IntPtr toSignal, IntPtr toWaitOn, int ms);
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace System {
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#pragma warning disable 169
|
||||
private const int mono_corlib_version = 145;
|
||||
private const int mono_corlib_version = 146;
|
||||
#pragma warning restore 169
|
||||
|
||||
[ComVisible (true)]
|
||||
|
||||
@@ -656,7 +656,9 @@ namespace MonoTests.System.IO
|
||||
{
|
||||
string name = "FIT.MoveTo.SameName.Test";
|
||||
string path1 = TempFolder + DSC + name;
|
||||
string path2 = name;
|
||||
string path2 = TempFolder + DSC + "same";
|
||||
Directory.CreateDirectory (path2);
|
||||
path2 += DSC + name;
|
||||
DeleteFile (path1);
|
||||
DeleteFile (path2);
|
||||
|
||||
|
||||
@@ -1671,6 +1671,9 @@ namespace MonoTests.System.IO
|
||||
} catch (FileNotFoundException) {
|
||||
// Only run this test on platforms where /dev/zero exists
|
||||
Assert.Ignore();
|
||||
} catch (DirectoryNotFoundException) {
|
||||
// Only run this test on platforms where /dev exists
|
||||
Assert.Ignore();
|
||||
}
|
||||
|
||||
// this shouldn't throw
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace MonoTests.System.Threading
|
||||
});
|
||||
}
|
||||
|
||||
Assert.IsTrue (ce.Wait (1000), "#1");
|
||||
Assert.IsTrue (ce.Wait (10000), "#1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,6 +783,7 @@ namespace MonoTests.System
|
||||
Assert.IsTrue (timeZones.Count > 0, "GetSystemTimeZones should not return an empty collection.");
|
||||
}
|
||||
|
||||
#if !MOBILE
|
||||
[Test]
|
||||
public void WindowsRegistryTimezoneWithParentheses ()
|
||||
{
|
||||
@@ -791,6 +792,7 @@ namespace MonoTests.System
|
||||
var name = method.Invoke (null, new object [] { " <---> Central Standard Time (Mexico) ||<<>>" });
|
||||
Assert.AreEqual (name, "Central Standard Time (Mexico)", "#1");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS0023: The `?' operator cannot be applied to operand of type `T'
|
||||
// Line: 11
|
||||
|
||||
class C2<T>
|
||||
{
|
||||
C2<T> i;
|
||||
T field;
|
||||
|
||||
public void Foo ()
|
||||
{
|
||||
var x = i?.field;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// CS0023: The `?' operator cannot be applied to operand of type `T'
|
||||
// Line: 13
|
||||
|
||||
interface IFoo<T>
|
||||
{
|
||||
T Call ();
|
||||
}
|
||||
|
||||
class C1
|
||||
{
|
||||
U Foo<T, U> (IFoo<T> t)
|
||||
{
|
||||
return t?.Call ();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// CS0023: The `?' operator cannot be applied to operand of type `T'
|
||||
// Line: 8
|
||||
|
||||
class X
|
||||
{
|
||||
static void Bug<T>(System.Func<T> func)
|
||||
{
|
||||
var r = func?.Invoke ();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// CS0121: The call is ambiguous between the following methods or properties: `A.GetValues(string[], string)' and `A.GetValues(string, params string[])'
|
||||
// Line: 23
|
||||
// CSC BUG: Correct according the spec, no identity conversion to do tie-breaking
|
||||
|
||||
class A
|
||||
{
|
||||
public int GetValues (string[] s, string value = null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int GetValues (string s, params string [] args)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class B
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var a = new A ();
|
||||
a.GetValues (null);
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -1263,10 +1263,15 @@ namespace Mono.CSharp
|
||||
|
||||
if (conditionalAccess) {
|
||||
if (!ec.ConditionalAccess.Statement) {
|
||||
if (ec.ConditionalAccess.Type.IsNullableType)
|
||||
Nullable.LiftedNull.Create (ec.ConditionalAccess.Type, Location.Null).Emit (ec);
|
||||
else
|
||||
var t = ec.ConditionalAccess.Type;
|
||||
if (t.IsNullableType)
|
||||
Nullable.LiftedNull.Create (t, Location.Null).Emit (ec);
|
||||
else {
|
||||
ec.EmitNull ();
|
||||
|
||||
if (t.IsGenericParameter)
|
||||
ec.Emit (OpCodes.Unbox_Any, t);
|
||||
}
|
||||
}
|
||||
|
||||
ec.Emit (OpCodes.Br, ec.ConditionalAccess.EndLabel);
|
||||
|
||||
@@ -3926,7 +3926,9 @@ array_creation_expression
|
||||
if ($4 == null)
|
||||
report.Error (1586, GetLocation ($1), "Array creation must have array size or array initializer");
|
||||
|
||||
$$ = new ArrayCreation ((FullNamedExpression) $2, (ComposedTypeSpecifier) $3, (ArrayInitializer) $4, GetLocation ($1));
|
||||
$$ = new ArrayCreation ((FullNamedExpression) $2, (ComposedTypeSpecifier) $3, (ArrayInitializer) $4, GetLocation ($1)) {
|
||||
NoEmptyInterpolation = true
|
||||
};
|
||||
}
|
||||
| NEW rank_specifier array_initializer
|
||||
{
|
||||
|
||||
+1
-1
@@ -535,7 +535,7 @@ namespace Mono.CSharp {
|
||||
|
||||
void ResolveConditionalAccessReceiver (ResolveContext rc)
|
||||
{
|
||||
// LAMESPEC: Not sure why this is explicitly disalloed with very odd error message
|
||||
// LAMESPEC: Not sure why this is explicitly disallowed with very odd error message
|
||||
if (!rc.HasSet (ResolveContext.Options.DontSetConditionalAccessReceiver) && method_group.HasConditionalAccess ()) {
|
||||
Error_OperatorCannotBeApplied (rc, loc, "?", method_group.Type);
|
||||
}
|
||||
|
||||
+20
-12
@@ -469,8 +469,13 @@ namespace Mono.CSharp {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static TypeSpec LiftMemberType (ResolveContext rc, TypeSpec type)
|
||||
protected TypeSpec LiftMemberType (ResolveContext rc, TypeSpec type)
|
||||
{
|
||||
var tps = type as TypeParameterSpec;
|
||||
if (tps != null && !(tps.IsReferenceType || tps.IsValueType)) {
|
||||
Error_OperatorCannotBeApplied (rc, loc, "?", type);
|
||||
}
|
||||
|
||||
return TypeSpec.IsValueType (type) && !type.IsNullableType ?
|
||||
Nullable.NullableInfo.MakeType (rc.Module, type) :
|
||||
type;
|
||||
@@ -1332,7 +1337,7 @@ namespace Mono.CSharp {
|
||||
{
|
||||
}
|
||||
|
||||
public ExpressionStatement ResolveStatement (BlockContext ec)
|
||||
public virtual ExpressionStatement ResolveStatement (BlockContext ec)
|
||||
{
|
||||
Expression e = Resolve (ec);
|
||||
if (e == null)
|
||||
@@ -4653,7 +4658,9 @@ namespace Mono.CSharp {
|
||||
AParametersCollection candidate_pd = ((IParametersMember) candidate).Parameters;
|
||||
AParametersCollection best_pd = ((IParametersMember) best).Parameters;
|
||||
|
||||
bool better_at_least_one = false;
|
||||
int candidate_better_count = 0;
|
||||
int best_better_count = 0;
|
||||
|
||||
bool are_equivalent = true;
|
||||
int args_count = args == null ? 0 : args.Count;
|
||||
int j = 0;
|
||||
@@ -4708,30 +4715,31 @@ namespace Mono.CSharp {
|
||||
//
|
||||
// No optional parameters tie breaking rules for delegates overload resolution
|
||||
//
|
||||
if ((this.restrictions & Restrictions.CovariantDelegate) != 0)
|
||||
if ((restrictions & Restrictions.CovariantDelegate) != 0)
|
||||
return false;
|
||||
|
||||
better_at_least_one = false;
|
||||
|
||||
++j;
|
||||
while (j < args_count && !args [j++].IsDefaultArgument) ;
|
||||
|
||||
break;
|
||||
++best_better_count;
|
||||
continue;
|
||||
}
|
||||
|
||||
// for at least one argument, the conversion to 'ct' should be better than
|
||||
// the conversion to 'bt'.
|
||||
if (result != 0)
|
||||
better_at_least_one = true;
|
||||
++candidate_better_count;
|
||||
}
|
||||
|
||||
if (better_at_least_one)
|
||||
if (candidate_better_count != 0 && best_better_count == 0)
|
||||
return true;
|
||||
|
||||
if (best_better_count > 0 && candidate_better_count == 0)
|
||||
return false;
|
||||
|
||||
//
|
||||
// LAMESPEC: Tie-breaking rules for not equivalent parameter types
|
||||
//
|
||||
if (!are_equivalent) {
|
||||
while (j < args_count && !args [j++].IsDefaultArgument) ;
|
||||
|
||||
//
|
||||
// A candidate with no default parameters is still better when there
|
||||
// is no better expression conversion
|
||||
|
||||
+14
-2
@@ -7023,6 +7023,16 @@ namespace Mono.CSharp
|
||||
}
|
||||
}
|
||||
|
||||
bool statement_resolve;
|
||||
public override ExpressionStatement ResolveStatement (BlockContext bc)
|
||||
{
|
||||
statement_resolve = true;
|
||||
var es = base.ResolveStatement (bc);
|
||||
statement_resolve = false;
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
protected override Expression DoResolve (ResolveContext rc)
|
||||
{
|
||||
ResolveConditionalAccessReceiver (rc);
|
||||
@@ -7111,7 +7121,7 @@ namespace Mono.CSharp
|
||||
|
||||
var method = mg.BestCandidate;
|
||||
type = mg.BestCandidateReturnType;
|
||||
if (conditional_access_receiver)
|
||||
if (conditional_access_receiver && !statement_resolve)
|
||||
type = LiftMemberType (ec, type);
|
||||
|
||||
if (arguments == null && method.DeclaringType.BuiltinType == BuiltinTypeSpec.Type.Object && method.Name == Destructor.MetadataName) {
|
||||
@@ -7862,6 +7872,8 @@ namespace Mono.CSharp
|
||||
{
|
||||
}
|
||||
|
||||
public bool NoEmptyInterpolation { get; set; }
|
||||
|
||||
public ComposedTypeSpecifier Rank {
|
||||
get {
|
||||
return this.rank;
|
||||
@@ -8398,7 +8410,7 @@ namespace Mono.CSharp
|
||||
|
||||
public override void Emit (EmitContext ec)
|
||||
{
|
||||
if (EmitOptimizedEmpty (ec))
|
||||
if (!NoEmptyInterpolation && EmitOptimizedEmpty (ec))
|
||||
return;
|
||||
|
||||
var await_field = EmitToFieldSource (ec);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
class C
|
||||
{
|
||||
}
|
||||
|
||||
class Foo
|
||||
{
|
||||
public int SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int SetValue (string name, C value, C defaultValue = default(C), bool relativeToProject = true, C relativeToPath = default(C), bool mergeToMainGroup = false, string condition = null)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int SetValue (string name, object value, C defaultValue = null)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
class Test
|
||||
{
|
||||
static int Main()
|
||||
{
|
||||
var f = new Foo ();
|
||||
C b = null;
|
||||
C c = null;
|
||||
|
||||
if (f.SetValue ("a", b, c) != 2)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
class A
|
||||
{
|
||||
public int GetValues (string[] s, string value = null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int GetValues (string s, params string [] args)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class B
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
var a = new A ();
|
||||
if (a.GetValues (null) != 1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
var a = new byte[] { };
|
||||
var b = new byte[] { };
|
||||
if (a.Equals (b))
|
||||
return 1;
|
||||
|
||||
if (ReferenceEquals (a, b))
|
||||
return 2;
|
||||
|
||||
b = new byte[0];
|
||||
if (a.Equals (b))
|
||||
return 3;
|
||||
|
||||
if (ReferenceEquals (a, b))
|
||||
return 4;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
|
||||
interface IFoo<T>
|
||||
{
|
||||
T Call ();
|
||||
}
|
||||
|
||||
class C1
|
||||
{
|
||||
public void Foo<T> (IFoo<T> t) where T : class
|
||||
{
|
||||
t?.Call ();
|
||||
var x = t?.Call ();
|
||||
}
|
||||
|
||||
public void Foo2<T> (IFoo<T> t)
|
||||
{
|
||||
t?.Call ();
|
||||
}
|
||||
}
|
||||
|
||||
class C2<T> where T : class
|
||||
{
|
||||
C2<T> i;
|
||||
T field;
|
||||
|
||||
public void Foo ()
|
||||
{
|
||||
var x = i?.field;
|
||||
}
|
||||
}
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Test<T>(Func<T> func) where T : struct
|
||||
{
|
||||
var r = func?.Invoke ();
|
||||
}
|
||||
|
||||
static void Test2<T>(Func<T> func)
|
||||
{
|
||||
func?.Invoke ();
|
||||
}
|
||||
|
||||
static void Main()
|
||||
{
|
||||
new C1 ().Foo<Program> (null);
|
||||
new C1 ().Foo2<Program> (null);
|
||||
|
||||
new C2<string> ().Foo ();
|
||||
|
||||
Test (() => 1);
|
||||
Test (() => 2);
|
||||
}
|
||||
}
|
||||
@@ -10586,7 +10586,7 @@
|
||||
</type>
|
||||
<type name="ExtensibleTester`1[U]">
|
||||
<method name="Void Direct()" attrs="134">
|
||||
<size>24</size>
|
||||
<size>25</size>
|
||||
</method>
|
||||
<method name="Void .ctor(U)" attrs="6278">
|
||||
<size>15</size>
|
||||
@@ -14348,7 +14348,7 @@
|
||||
</type>
|
||||
<type name="TestIssue.Program">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>31</size>
|
||||
<size>32</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
@@ -14936,7 +14936,7 @@
|
||||
<size>7</size>
|
||||
</method>
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>36</size>
|
||||
<size>37</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
@@ -30747,6 +30747,56 @@
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="gtest-optional-38.cs">
|
||||
<type name="C">
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="Foo">
|
||||
<method name="Int32 SetValue(System.String, System.String, System.String, Boolean)" attrs="134">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Int32 SetValue(System.String, C, C, Boolean, C, Boolean, System.String)" attrs="134">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Int32 SetValue(System.String, System.Object, C)" attrs="134">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="Test">
|
||||
<method name="Int32 Main()" attrs="145">
|
||||
<size>50</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="gtest-optional-39.cs">
|
||||
<type name="A">
|
||||
<method name="Int32 GetValues(System.String[], System.String)" attrs="134">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Int32 GetValues(System.String, System.String[])" attrs="134">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="B">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>37</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="gtest-partial-01.cs">
|
||||
<type name="B`1[U]">
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
@@ -43639,7 +43689,7 @@
|
||||
<test name="test-555.cs">
|
||||
<type name="Test">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>360</size>
|
||||
<size>361</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
@@ -52042,6 +52092,16 @@
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-934.cs">
|
||||
<type name="X">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>106</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-94.cs">
|
||||
<type name="Base">
|
||||
<method name="Int32 IVehicle.Start()" attrs="481">
|
||||
@@ -68791,7 +68851,7 @@
|
||||
<size>14</size>
|
||||
</method>
|
||||
<method name="Boolean MoveNext()" attrs="486">
|
||||
<size>167</size>
|
||||
<size>168</size>
|
||||
</method>
|
||||
<method name="Void Dispose()" attrs="486">
|
||||
<size>15</size>
|
||||
@@ -69657,6 +69717,47 @@
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-null-operator-04.cs">
|
||||
<type name="C1">
|
||||
<method name="Void Foo[T](IFoo`1[T])" attrs="134">
|
||||
<size>38</size>
|
||||
</method>
|
||||
<method name="Void Foo2[T](IFoo`1[T])" attrs="134">
|
||||
<size>17</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="C2`1[T]">
|
||||
<method name="Void Foo()" attrs="134">
|
||||
<size>33</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="Program">
|
||||
<method name="Void Test[T](System.Func`1[T])" attrs="145">
|
||||
<size>31</size>
|
||||
</method>
|
||||
<method name="Void Test2[T](System.Func`1[T])" attrs="145">
|
||||
<size>17</size>
|
||||
</method>
|
||||
<method name="Void Main()" attrs="145">
|
||||
<size>102</size>
|
||||
</method>
|
||||
<method name="Int32 <Main>m__0()" attrs="145">
|
||||
<size>9</size>
|
||||
</method>
|
||||
<method name="Int32 <Main>m__1()" attrs="145">
|
||||
<size>9</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-null-operator-05.cs">
|
||||
<type name="CI">
|
||||
<method name="Void set_Item(System.String, System.String)" attrs="2182">
|
||||
|
||||
@@ -527,6 +527,7 @@ namespace Mono.Linker.Steps {
|
||||
if (type.HasMethods) {
|
||||
MarkMethodsIf (type.Methods, IsVirtualAndHasPreservedParent);
|
||||
MarkMethodsIf (type.Methods, IsStaticConstructorPredicate);
|
||||
MarkMethodsIf (type.Methods, HasSerializationAttribute);
|
||||
}
|
||||
|
||||
DoAdditionalTypeProcessing (type);
|
||||
@@ -740,6 +741,25 @@ namespace Mono.Linker.Steps {
|
||||
return method.IsConstructor && method.IsStatic;
|
||||
}
|
||||
|
||||
static bool HasSerializationAttribute (MethodDefinition method)
|
||||
{
|
||||
if (!method.HasCustomAttributes)
|
||||
return false;
|
||||
foreach (var ca in method.CustomAttributes) {
|
||||
var cat = ca.AttributeType;
|
||||
if (cat.Namespace != "System.Runtime.Serialization")
|
||||
continue;
|
||||
switch (cat.Name) {
|
||||
case "OnDeserializedAttribute":
|
||||
case "OnDeserializingAttribute":
|
||||
case "OnSerializedAttribute":
|
||||
case "OnSerializingAttribute":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsSerializable (TypeDefinition td)
|
||||
{
|
||||
return (td.Attributes & TypeAttributes.Serializable) != 0;
|
||||
|
||||
@@ -104,7 +104,10 @@
|
||||
Text="OutDir property must end with a slash."/>
|
||||
</Target>
|
||||
|
||||
<Target Name="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<PrepareForBuildDependsOn>AssignLinkMetadata</PrepareForBuildDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="PrepareForBuild" DependsOnTargets="$(PrepareForBuildDependsOn)">
|
||||
<Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
|
||||
|
||||
<!-- Look for app.config, if $(AppConfig) is specified, then use that. Else look in
|
||||
@@ -124,6 +127,18 @@
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="AssignLinkMetadata">
|
||||
<AssignLinkMetadata Items="@(EmbeddedResource)" Condition="'@(EmbeddedResource)' != '' and '%(EmbeddedResource.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
|
||||
<Output TaskParameter="OutputItems" ItemName="_EmbeddedResourceWithLinkAssigned" />
|
||||
</AssignLinkMetadata>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="@(_EmbeddedResourceWithLinkAssigned)" />
|
||||
<EmbeddedResource Include="@(_EmbeddedResourceWithLinkAssigned)" />
|
||||
<_EmbeddedResourceWithLinkAssigned Remove="@(_EmbeddedResourceWithLinkAssigned)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<GetFrameworkPathsDependsOn />
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.AL" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.AssignTargetPath" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.AssignLinkMetadata" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.AssignCulture" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.CallTarget" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
EXTRA_DIST = arm64-codegen.h
|
||||
@@ -81,7 +81,7 @@
|
||||
* Changes which are already detected at runtime, like the addition
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#define MONO_CORLIB_VERSION 145
|
||||
#define MONO_CORLIB_VERSION 146
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ void
|
||||
sgen_set_bridge_implementation (const char *name)
|
||||
{
|
||||
if (!init_bridge_processor (&bridge_processor, name))
|
||||
g_warning ("Invalid value for bridge implementation, valid values are: 'new' and 'old'.");
|
||||
g_warning ("Invalid value for bridge implementation, valid values are: 'new', 'old' and 'tarjan'.");
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -375,6 +375,8 @@ sgen_bridge_processing_finish (int generation)
|
||||
if (compare_bridge_processors ())
|
||||
compare_to_bridge_processor.processing_after_callback (generation);
|
||||
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_BRIDGE: Complete, was running for %.2fms", mono_time_since_last_stw () / 10000.0f);
|
||||
|
||||
bridge_processing_in_progress = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -727,6 +727,8 @@ extern MonoNativeTlsKey thread_info_key;
|
||||
#define SGEN_TV_GETTIME(tv) tv = mono_100ns_ticks ()
|
||||
#define SGEN_TV_ELAPSED(start,end) ((gint64)(end-start))
|
||||
|
||||
guint64 mono_time_since_last_stw (void);
|
||||
|
||||
typedef MonoSemType SgenSemaphore;
|
||||
|
||||
#define SGEN_SEMAPHORE_INIT(sem,initial) mono_os_sem_init ((sem), (initial))
|
||||
|
||||
@@ -2726,7 +2726,7 @@ sgen_client_log_timing (GGTimingInfo *info, mword last_major_num_sections, mword
|
||||
full_timing_buff [0] = '\0';
|
||||
|
||||
if (!info->is_overflow)
|
||||
sprintf (full_timing_buff, "total %.2fms, bridge %.2fms", info->stw_time / 10000.0f, (int)info->bridge_time / 10000.0f);
|
||||
sprintf (full_timing_buff, "total %.2fms", info->stw_time / 10000.0f);
|
||||
if (info->generation == GENERATION_OLD)
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR%s: (%s) pause %.2fms, %s los %dK/%dK",
|
||||
info->is_overflow ? "_OVERFLOW" : "",
|
||||
|
||||
@@ -65,9 +65,11 @@ typedef struct {
|
||||
|
||||
|
||||
/*
|
||||
* Bridge data for a single managed object
|
||||
*
|
||||
* FIXME: Optimizations:
|
||||
*
|
||||
* Don't allocate a scrs array for just one source. Most objects have
|
||||
* Don't allocate a srcs array for just one source. Most objects have
|
||||
* just one source, so use the srcs pointer itself.
|
||||
*/
|
||||
typedef struct _HashEntry {
|
||||
@@ -80,10 +82,12 @@ typedef struct _HashEntry {
|
||||
struct _HashEntry *forwarded_to;
|
||||
} dfs1;
|
||||
struct {
|
||||
// Index in sccs array of SCC this object was folded into
|
||||
int scc_index;
|
||||
} dfs2;
|
||||
} v;
|
||||
|
||||
// "Source" managed objects pointing at this destination
|
||||
DynPtrArray srcs;
|
||||
} HashEntry;
|
||||
|
||||
@@ -92,12 +96,19 @@ typedef struct {
|
||||
double weight;
|
||||
} HashEntryWithAccounting;
|
||||
|
||||
// The graph of managed objects/HashEntries is reduced to a graph of strongly connected components
|
||||
typedef struct _SCC {
|
||||
int index;
|
||||
int api_index;
|
||||
|
||||
// How many bridged objects does this SCC hold references to?
|
||||
int num_bridge_entries;
|
||||
|
||||
gboolean flag;
|
||||
|
||||
/*
|
||||
* Index in global sccs array of SCCs holding pointers to this SCC
|
||||
*
|
||||
* New and old xrefs are typically mutually exclusive. Only when TEST_NEW_XREFS is
|
||||
* enabled we do both, and compare the results. This should only be done for
|
||||
* debugging, obviously.
|
||||
@@ -110,6 +121,7 @@ typedef struct _SCC {
|
||||
#endif
|
||||
} SCC;
|
||||
|
||||
// Maps managed objects to corresponding HashEntry stricts
|
||||
static SgenHashTable hash_table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_BRIDGE_HASH_TABLE, INTERNAL_MEM_BRIDGE_HASH_TABLE_ENTRY, sizeof (HashEntry), mono_aligned_addr_hash, NULL);
|
||||
|
||||
static guint32 current_time;
|
||||
|
||||
@@ -41,11 +41,12 @@ typedef struct {
|
||||
DynArray array;
|
||||
} DynSCCArray;
|
||||
|
||||
|
||||
/*
|
||||
* Bridge data for a single managed object
|
||||
*
|
||||
* FIXME: Optimizations:
|
||||
*
|
||||
* Don't allocate a scrs array for just one source. Most objects have
|
||||
* Don't allocate a srcs array for just one source. Most objects have
|
||||
* just one source, so use the srcs pointer itself.
|
||||
*/
|
||||
typedef struct _HashEntry {
|
||||
@@ -56,8 +57,10 @@ typedef struct _HashEntry {
|
||||
|
||||
int finishing_time;
|
||||
|
||||
// "Source" managed objects pointing at this destination
|
||||
DynPtrArray srcs;
|
||||
|
||||
// Index in sccs array of SCC this object was folded into
|
||||
int scc_index;
|
||||
} HashEntry;
|
||||
|
||||
@@ -66,13 +69,19 @@ typedef struct {
|
||||
double weight;
|
||||
} HashEntryWithAccounting;
|
||||
|
||||
// The graph of managed objects/HashEntries is reduced to a graph of strongly connected components
|
||||
typedef struct _SCC {
|
||||
int index;
|
||||
int api_index;
|
||||
|
||||
// How many bridged objects does this SCC hold references to?
|
||||
int num_bridge_entries;
|
||||
|
||||
// Index in global sccs array of SCCs holding pointers to this SCC
|
||||
DynIntArray xrefs; /* these are incoming, not outgoing */
|
||||
} SCC;
|
||||
|
||||
// Maps managed objects to corresponding HashEntry stricts
|
||||
static SgenHashTable hash_table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE, INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE_ENTRY, sizeof (HashEntry), mono_aligned_addr_hash, NULL);
|
||||
|
||||
static int current_time;
|
||||
|
||||
@@ -32,6 +32,18 @@
|
||||
static void sgen_unified_suspend_restart_world (void);
|
||||
static void sgen_unified_suspend_stop_world (void);
|
||||
|
||||
static TV_DECLARE (end_of_last_stw);
|
||||
|
||||
guint64 mono_time_since_last_stw ()
|
||||
{
|
||||
if (end_of_last_stw == 0)
|
||||
return 0;
|
||||
|
||||
TV_DECLARE (current_time);
|
||||
TV_GETTIME (current_time);
|
||||
return TV_ELAPSED (end_of_last_stw, current_time);
|
||||
}
|
||||
|
||||
unsigned int sgen_global_stop_count = 0;
|
||||
|
||||
inline static void*
|
||||
@@ -241,8 +253,7 @@ sgen_client_restart_world (int generation, GGTimingInfo *timing)
|
||||
{
|
||||
TV_DECLARE (end_sw);
|
||||
TV_DECLARE (start_handshake);
|
||||
TV_DECLARE (end_bridge);
|
||||
unsigned long usec, bridge_usec;
|
||||
unsigned long usec;
|
||||
|
||||
/* notify the profiler of the leftovers */
|
||||
/* FIXME this is the wrong spot at we can STW for non collection reasons. */
|
||||
@@ -269,6 +280,7 @@ sgen_client_restart_world (int generation, GGTimingInfo *timing)
|
||||
time_restart_world += TV_ELAPSED (start_handshake, end_sw);
|
||||
usec = TV_ELAPSED (stop_world_time, end_sw);
|
||||
max_pause_usec = MAX (usec, max_pause_usec);
|
||||
end_of_last_stw = end_sw;
|
||||
|
||||
SGEN_LOG (2, "restarted (pause time: %d usec, max: %d)", (int)usec, (int)max_pause_usec);
|
||||
|
||||
@@ -284,12 +296,8 @@ sgen_client_restart_world (int generation, GGTimingInfo *timing)
|
||||
*/
|
||||
release_gc_locks ();
|
||||
|
||||
TV_GETTIME (end_bridge);
|
||||
bridge_usec = TV_ELAPSED (end_sw, end_bridge);
|
||||
|
||||
if (timing) {
|
||||
timing [0].stw_time = usec;
|
||||
timing [0].bridge_time = bridge_usec;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -924,11 +924,6 @@ processing_stw_step (void)
|
||||
#if defined (DUMP_GRAPH)
|
||||
printf ("-----------------\n");
|
||||
#endif
|
||||
/*
|
||||
* bridge_processing_in_progress must be set with the world
|
||||
* stopped. If not there would be race conditions.
|
||||
*/
|
||||
bridge_processing_in_progress = TRUE;
|
||||
|
||||
SGEN_TV_GETTIME (curtime);
|
||||
|
||||
@@ -1134,7 +1129,6 @@ processing_after_callback (int generation)
|
||||
|
||||
cache_hits = cache_misses = 0;
|
||||
ignored_objects = 0;
|
||||
bridge_processing_in_progress = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -96,10 +96,10 @@ gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle);
|
||||
void ves_icall_System_Threading_Events_CloseEvent_internal (HANDLE handle);
|
||||
HANDLE ves_icall_System_Threading_Events_OpenEvent_internal (MonoString *name, gint32 rights, gint32 *error);
|
||||
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms, gboolean exitContext);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms, gboolean exitContext);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms);
|
||||
gint32 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms);
|
||||
|
||||
MonoArray* ves_icall_System_Threading_Thread_ByteArrayToRootDomain (MonoArray *arr);
|
||||
MonoArray* ves_icall_System_Threading_Thread_ByteArrayToCurrentDomain (MonoArray *arr);
|
||||
|
||||
@@ -1600,8 +1600,7 @@ mono_wait_uninterrupted (MonoInternalThread *thread, gboolean multiple, guint32
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* FIXME: exitContext isnt documented */
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms)
|
||||
{
|
||||
HANDLE *handles;
|
||||
guint32 numhandles;
|
||||
@@ -1638,8 +1637,7 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_ha
|
||||
return ret == WAIT_FAILED ? 0x7fffffff : ret;
|
||||
}
|
||||
|
||||
/* FIXME: exitContext isnt documented */
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms)
|
||||
{
|
||||
HANDLE handles [MAXIMUM_WAIT_OBJECTS];
|
||||
uintptr_t numhandles;
|
||||
@@ -1687,8 +1685,7 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_ha
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: exitContext isnt documented */
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms, gboolean exitContext)
|
||||
gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms)
|
||||
{
|
||||
guint32 ret;
|
||||
MonoInternalThread *thread = mono_thread_internal_current ();
|
||||
@@ -1712,7 +1709,7 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gin
|
||||
}
|
||||
|
||||
gint32
|
||||
ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms, gboolean exitContext)
|
||||
ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms)
|
||||
{
|
||||
guint32 ret;
|
||||
MonoInternalThread *thread = mono_thread_internal_current ();
|
||||
|
||||
@@ -816,7 +816,6 @@ typedef struct {
|
||||
gboolean is_overflow;
|
||||
gint64 total_time;
|
||||
gint64 stw_time;
|
||||
gint64 bridge_time;
|
||||
} GGTimingInfo;
|
||||
|
||||
void sgen_stop_world (int generation);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/*HACK, move this to an eventual mono-signal.c*/
|
||||
#if defined( __linux__) || defined(__sun) || defined(__APPLE__) || defined(__NetBSD__) || \
|
||||
defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#ifdef HAVE_SIGACTION
|
||||
#if defined(HAVE_SIGACTION) || defined(__APPLE__) // the __APPLE__ check is required for the tvos simulator, which has ucontext_t but not sigaction
|
||||
#define MONO_SIGNAL_USE_UCONTEXT_T 1
|
||||
#endif
|
||||
#endif
|
||||
@@ -152,7 +152,7 @@ typedef struct {
|
||||
|
||||
#if !defined( HOST_WIN32 ) && !defined(__native_client__) && !defined(__native_client_codegen__)
|
||||
|
||||
#ifdef HAVE_SIGACTION
|
||||
#if defined(HAVE_SIGACTION) || defined(__APPLE__) // the __APPLE__ check is required for the tvos simulator, which has ucontext_t but not sigaction
|
||||
#define MONO_SIGNAL_USE_UCONTEXT_T 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,12 +7,11 @@ CPPSHARP_REFS = -r:$(CPPSHARP_DIR)/CppSharp.dll \
|
||||
|
||||
SRC_ROOT = ../..
|
||||
|
||||
MONO_OPTIONS_SRC = $(SRC_ROOT)/mono/mcs/class/Mono.Options/Mono.Options/Options.cs
|
||||
MONO_OPTIONS_SRC = $(SRC_ROOT)/mcs/class/Mono.Options/Mono.Options/Options.cs
|
||||
|
||||
.stamp-clone:
|
||||
@if [ ! -d $(CPPSHARP_DIR) ]; then \
|
||||
git clone git@github.com:xamarin/CppSharpBinaries.git $(CPPSHARP_DIR); \
|
||||
touch $@; \
|
||||
git clone git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_DIR) && touch $@; \
|
||||
fi
|
||||
|
||||
MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
|
||||
|
||||
Reference in new issue
Block a user