mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96c0883549 | ||
|
|
60b980b3bb | ||
|
|
3c84401ec8 | ||
|
|
44162b8a8b | ||
|
|
355944f0d6 | ||
|
|
9f4a644133 | ||
|
|
c83b0a3f98 | ||
|
|
b7422c2c22 | ||
|
|
c9e78b5322 | ||
|
|
7898a926f0 | ||
|
|
a3000fbb7f | ||
|
|
df4669b216 | ||
|
|
76db8b168c | ||
|
|
0f76c2acec | ||
|
|
1a431e6183 | ||
|
|
0e86b9e40b | ||
|
|
ce75ab6aed | ||
|
|
75367e0413 | ||
|
|
044b7d4ac8 | ||
|
|
707e9c6b03 | ||
|
|
ce9765ffe0 | ||
|
|
85d51db4f0 | ||
|
|
af502ec4df | ||
|
|
b72ef417bc | ||
|
|
bc699443c1 | ||
|
|
addce38b83 | ||
|
|
b2250d8ecf | ||
|
|
cfe2428963 | ||
|
|
e51d521ff9 | ||
|
|
d5885b1996 | ||
|
|
b429bfe794 | ||
|
|
48e94bd5f6 | ||
|
|
726b2befe9 | ||
|
|
bff4165b8d | ||
|
|
b4ec38c280 | ||
|
|
d5cfcd6b2a | ||
|
|
1ee454fce3 | ||
|
|
24775d13d4 | ||
|
|
934465474b | ||
|
|
8c1b959850 | ||
|
|
26c39f88fb | ||
|
|
92f7d7ac14 | ||
|
|
2636235a82 | ||
|
|
5267bcb2b7 | ||
|
|
d03c1a55e0 | ||
|
|
63798ae475 | ||
|
|
31c099d7ca | ||
|
|
ad9daeaf58 | ||
|
|
829534374f | ||
|
|
6ce90d742b | ||
|
|
28dcb2abb3 | ||
|
|
1438e3a015 | ||
|
|
b403e9b528 | ||
|
|
f02e94d25c | ||
|
|
c93b4d1722 | ||
|
|
5d37aa59b9 | ||
|
|
3c7e98aa62 | ||
|
|
0e2248ca22 | ||
|
|
ec43cc1dc4 | ||
|
|
3cd2ccce57 | ||
|
|
eaff739a03 | ||
|
|
742e703eb4 | ||
|
|
fe214b46bd | ||
|
|
c843b3f25f | ||
|
|
b5e1cb7236 | ||
|
|
47f6b08657 | ||
|
|
1d8c43241a | ||
|
|
90be24e928 | ||
|
|
34a97709ce | ||
|
|
632c5e8e1c | ||
|
|
b0527fafe3 | ||
|
|
e3a2754a33 | ||
|
|
0deb1fd312 | ||
|
|
3ffbfe94c9 | ||
|
|
51599d15b2 | ||
|
|
68fc0a509f | ||
|
|
6eaec1bb59 | ||
|
|
de06b9c866 | ||
|
|
ec16c55370 | ||
|
|
dcc1d41ffb | ||
|
|
d6af8351b4 | ||
|
|
c3c06baf61 | ||
|
|
c5a0d0e011 | ||
|
|
5e8d4de0f7 | ||
|
|
b4632e0789 | ||
|
|
141d8fafaa | ||
|
|
259864a1d3 | ||
|
|
3eb8d6d178 | ||
|
|
3deebbf487 | ||
|
|
0e486b814f | ||
|
|
04f45d88f9 | ||
|
|
fdd7beb707 | ||
|
|
0ec03cb37c | ||
|
|
03298038d7 | ||
|
|
310bba2a01 | ||
|
|
db62348438 | ||
|
|
f5040c4e67 | ||
|
|
1d366da8f0 | ||
|
|
ed0f1b4992 | ||
|
|
e9f63bbd97 | ||
|
|
640748df04 | ||
|
|
3f3e41781e | ||
|
|
74a8e56233 | ||
|
|
0e38c766cc | ||
|
|
73d4810c70 | ||
|
|
15bd67a390 | ||
|
|
6af040720f | ||
|
|
d7767d7f41 | ||
|
|
ba0a5b09ae | ||
|
|
94d9ccc8b7 | ||
|
|
759ae465ea | ||
|
|
c4c358fcb3 | ||
|
|
a88a2802d8 | ||
|
|
884e4bffa0 | ||
|
|
9417be0f11 | ||
|
|
c212bccc3d | ||
|
|
1dd426f94b | ||
|
|
fe021658d9 |
No files matched your search
+75
-5
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [5.5.0],
|
||||
AC_INIT(mono, [5.6.0],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -40,8 +40,8 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
|
||||
# This can be reset to 0 when Mono's version number is bumped
|
||||
# since it's part of the corlib version (the prefix '1' in the full
|
||||
# version number is to ensure the number isn't treated as octal in C)
|
||||
MONO_CORLIB_COUNTER=3
|
||||
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
|
||||
MONO_CORLIB_COUNTER=0
|
||||
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
|
||||
|
||||
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
|
||||
AC_SUBST(MONO_CORLIB_VERSION)
|
||||
@@ -529,6 +529,73 @@ AC_CHECK_FUNCS(_finite, , AC_MSG_CHECKING(for _finite in math.h)
|
||||
# for Linux statfs support
|
||||
AC_CHECK_HEADERS(linux/magic.h)
|
||||
|
||||
# For Android NDK unified headers
|
||||
if test x$platform_android = xyes; then
|
||||
AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
|
||||
AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
|
||||
|
||||
# Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
|
||||
# API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
|
||||
# libc APIs to obtain values for SIGRT{MIN,MAX}. We perform the check only if android/legacy_signal_inlines.h
|
||||
# is found because in other cases the macros will either work (for NDK < 14) or fail if the legacy header
|
||||
# doesn't contain the required definitions (NDK 14)
|
||||
if test x$have_android_signal_inlines = xyes; then
|
||||
AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([#include <android/legacy_signal_inlines.h>],[
|
||||
int i;
|
||||
for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
|
||||
}
|
||||
])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
android_sigrtminmax_work=yes
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
android_sigrtminmax_work=no
|
||||
]
|
||||
)
|
||||
|
||||
if test x$android_sigrtminmax_work = xno; then
|
||||
AC_MSG_ERROR([Android SIGRTMIN/SIGRTMAX macros don't work in this NDK])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Attempt to detect whether we're using Android NDK unified headers
|
||||
AC_CHECK_HEADERS(android/api-level.h, [have_android_api_level=yes], [have_android_api_level=no])
|
||||
AC_CHECK_HEADERS(android/versioning.h, [have_android_versioning=yes], [have_android_versioning=no])
|
||||
|
||||
android_unified_headers=no
|
||||
if test x$have_android_api_level = xyes; then
|
||||
if test x$have_android_versioning = xyes; then
|
||||
AC_MSG_CHECKING([whether using Android NDK unified headers])
|
||||
|
||||
# Both macros are defined only in the NDK unified headers
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <android/api-level.h>
|
||||
#include <android/versioning.h>
|
||||
],[
|
||||
#if __ANDROID_API_O__ == 26 && defined(__INTRODUCED_IN)
|
||||
return 0
|
||||
#else
|
||||
#error __ANDROID_API_O__ != 26 or the __INTRODUCED_IN macro not defined
|
||||
#endif
|
||||
])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
android_unified_headers=yes
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
android_unified_headers=no
|
||||
]
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$android_unified_headers = xyes; then
|
||||
AC_DEFINE(ANDROID_UNIFIED_HEADERS, 1, [Whether Android NDK unified headers are used])
|
||||
fi
|
||||
fi # Android
|
||||
|
||||
# not 64 bit clean in cross-compile
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
|
||||
@@ -783,7 +850,10 @@ if test $csc_compiler = default; then
|
||||
if test $endian = big; then
|
||||
csc_compiler=mcs
|
||||
elif test $endian = little; then
|
||||
csc_compiler=roslyn
|
||||
case "$host" in
|
||||
powerpc*) csc_compiler=mcs ;;
|
||||
*) csc_compiler=roslyn ;;
|
||||
esac
|
||||
else
|
||||
csc_compiler=mcs
|
||||
fi
|
||||
@@ -4324,7 +4394,7 @@ AC_SUBST(mono_build_root)
|
||||
mono_runtime=mono/mini/mono
|
||||
AC_SUBST(mono_runtime)
|
||||
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe
|
||||
|
||||
if test $csc_compiler = mcs; then
|
||||
CSC=$mcs_topdir/class/lib/build/mcs.exe
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Release notes for Mono are hosted on the web, please see:
|
||||
|
||||
http://www.mono-project.com/docs/about-mono/releases/
|
||||
@@ -127,7 +127,7 @@ get_pw_data (void)
|
||||
{
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
struct passwd pw;
|
||||
struct passwd *result;
|
||||
struct passwd *result = NULL;
|
||||
char buf [4096];
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,7 @@ get_pw_data (void)
|
||||
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
if (home_dir == NULL || user_name == NULL) {
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
|
||||
if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0 && result) {
|
||||
if (home_dir == NULL)
|
||||
home_dir = g_strdup (pw.pw_dir);
|
||||
if (user_name == NULL)
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ g_assertion_message (const gchar *format, ...)
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#if TARGET_ANDROID
|
||||
#if PLATFORM_ANDROID
|
||||
#include <android/log.h>
|
||||
|
||||
static android_LogPriority
|
||||
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: 3a121c2d1a...c1a7bd7e02.
Vendored
+1
-1
Submodule external/binary-reference-assemblies updated: 142cbeb62f...e34076ffd0.
Vendored
+1
-1
Submodule external/bockbuild updated: b445017309...5a701284b6.
Vendored
+1
-1
Submodule external/cecil updated: 14e17dfbeb...81ae509855.
Vendored
+1
-1
Submodule external/linker updated: 305e0f6053...7c4dab5f12.
Vendored
+1
-1
Submodule external/nuget-buildtasks updated: 8d307472ea...b58ba42823.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 80b86f340b...1904c7d068.
@@ -30,6 +30,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyColumnMappingCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyOptions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlClientFactory))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlClientMetaDataCollectionNames))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlCommand))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlConnection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlConnectionStringBuilder))]
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngProvider))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIPolicy))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIProtectionLevels))]
|
||||
// TODO: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSACng))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsaCng))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECKeyXmlFormat))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSACng))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDESCng))]
|
||||
@@ -36,6 +36,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportUsage))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpBindingBase))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpClientCredentialType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpProxyCredentialType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpTransportSecurity))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpBinding))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpsBinding))]
|
||||
|
||||
@@ -45,19 +45,18 @@ namespace MonoTests.Mono.Data.Tds
|
||||
public void CheckNullException()
|
||||
{
|
||||
|
||||
TcpListener Listener = null;
|
||||
|
||||
//set up dummy sql listener, if there is a real sql server on this
|
||||
//machine at that port, in theory this part will fail, but that's ok
|
||||
//becuase something will be listening on the port and that's all we
|
||||
//require at this point: a listener on port 1433...
|
||||
|
||||
try{
|
||||
Socket Listener = new Socket(AddressFamily.InterNetwork,
|
||||
SocketType.Stream,
|
||||
ProtocolType.Tcp);
|
||||
IPAddress hostIP =Dns.GetHostEntry("localhost").AddressList[0];
|
||||
IPEndPoint ep = new IPEndPoint(hostIP, 1433);
|
||||
Listener.Bind(ep);
|
||||
Listener.Listen(1);
|
||||
IPEndPoint ep = new IPEndPoint(hostIP, 1433);
|
||||
Listener = new TcpListener (ep);
|
||||
Listener.Start ();
|
||||
} catch (Exception){
|
||||
//ignore
|
||||
}
|
||||
@@ -103,6 +102,7 @@ namespace MonoTests.Mono.Data.Tds
|
||||
|
||||
pool.ReleaseConnection(tds);
|
||||
|
||||
Listener.Stop ();
|
||||
//exit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
#include monodroid_Mono.Posix_test.dll.new-exclude.sources
|
||||
Mono.Unix.Android/TestHelper.cs
|
||||
@@ -163,5 +163,14 @@ namespace Mono.Security.Interface
|
||||
X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
|
||||
ref MonoSslPolicyErrors errors, ref int status11);
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
|
||||
internal abstract bool SupportsCleanShutdown {
|
||||
get;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,13 @@ namespace Mono.Security.Interface
|
||||
get; set;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is only supported if MonoTlsProvider.SupportsCleanShutdown is true.
|
||||
*/
|
||||
internal bool SendCloseNotify {
|
||||
get; set;
|
||||
}
|
||||
|
||||
/*
|
||||
* If you set this here, then it will override 'ServicePointManager.SecurityProtocol'.
|
||||
*/
|
||||
@@ -173,6 +180,7 @@ namespace Mono.Security.Interface
|
||||
EnabledProtocols = other.EnabledProtocols;
|
||||
EnabledCiphers = other.EnabledCiphers;
|
||||
CertificateValidationTime = other.CertificateValidationTime;
|
||||
SendCloseNotify = other.SendCloseNotify;
|
||||
if (other.TrustAnchors != null)
|
||||
TrustAnchors = new X509CertificateCollection (other.TrustAnchors);
|
||||
if (other.CertificateSearchPaths != null) {
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
|
||||
return null;
|
||||
|
||||
foreach (X509Certificate certificate in this.Context.ClientSettings.Certificates) {
|
||||
if (cert.GetName () == cert.GetIssuerName ())
|
||||
if (certificate.GetName () == cert.GetIssuerName ())
|
||||
return certificate;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -92,7 +92,9 @@ namespace PEAPI {
|
||||
/// </summary>
|
||||
public enum ImplAttr { IL, Native, Runtime = 0x03, Unmanaged = 0x04,
|
||||
ForwardRef = 0x10, PreserveSig = 0x0080, InternalCall = 0x1000,
|
||||
Synchronised = 0x0020, Synchronized = 0x0020, NoInLining = 0x0008, NoOptimization = 0x0040, Optil = 0x0002}
|
||||
Synchronised = 0x0020, Synchronized = 0x0020, NoInLining = 0x0008, NoOptimization = 0x0040, Optil = 0x0002,
|
||||
AggressiveInlining = 0x0100
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Storage location for initial field data
|
||||
|
||||
@@ -37,6 +37,12 @@ namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
}
|
||||
|
||||
protected SafeNCryptHandle (IntPtr handle, System.Runtime.InteropServices.SafeHandle parentHandle)
|
||||
: base (false)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override bool IsInvalid { get { throw new NotImplementedException (); } }
|
||||
|
||||
protected override bool ReleaseHandle ()
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
public sealed class SafeNCryptKeyHandle : SafeNCryptHandle
|
||||
@@ -34,6 +36,12 @@ namespace Microsoft.Win32.SafeHandles
|
||||
{
|
||||
}
|
||||
|
||||
public SafeNCryptKeyHandle (IntPtr handle, System.Runtime.InteropServices.SafeHandle parentHandle)
|
||||
: base (handle, parentHandle)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override bool ReleaseNativeHandle ()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -71,6 +71,7 @@ corefx/SR.missing.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
|
||||
|
||||
|
||||
@@ -14,6 +14,5 @@ System.Security.Cryptography/SHA512Cng.cs
|
||||
|
||||
../referencesource/System.Core/System/Security/Cryptography/AesManaged.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
|
||||
../referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs
|
||||
|
||||
../referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs
|
||||
@@ -133,28 +133,28 @@ namespace Mono.AppleTls
|
||||
targetHost = targetHost.Substring (0, pos);
|
||||
}
|
||||
|
||||
var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost);
|
||||
var trust = new SecTrust (certificates, policy);
|
||||
using (var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost))
|
||||
using (var trust = new SecTrust (certificates, policy)) {
|
||||
if (validator.Settings.TrustAnchors != null) {
|
||||
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
trust.SetAnchorCertificatesOnly (false);
|
||||
}
|
||||
|
||||
if (validator.Settings.TrustAnchors != null) {
|
||||
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
trust.SetAnchorCertificatesOnly (false);
|
||||
if (validator.Settings.CertificateValidationTime != null) {
|
||||
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
}
|
||||
|
||||
var result = trust.Evaluate ();
|
||||
if (result == SecTrustResult.Unspecified || result == SecTrustResult.Proceed)
|
||||
return true;
|
||||
|
||||
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validator.Settings.CertificateValidationTime != null) {
|
||||
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
|
||||
if (status != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (status.ToString ());
|
||||
}
|
||||
|
||||
var result = trust.Evaluate ();
|
||||
if (result == SecTrustResult.Unspecified)
|
||||
return true;
|
||||
|
||||
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,32 +235,41 @@ namespace Mono.AppleTls
|
||||
*
|
||||
*/
|
||||
|
||||
var trust = GetPeerTrust (!IsServer);
|
||||
X509CertificateCollection certificates;
|
||||
|
||||
if (trust == null || trust.Count == 0) {
|
||||
remoteCertificate = null;
|
||||
if (!IsServer)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
certificates = null;
|
||||
} else {
|
||||
if (trust.Count > 1)
|
||||
Debug ("WARNING: Got multiple certificates in SecTrust!");
|
||||
|
||||
certificates = new X509CertificateCollection ();
|
||||
for (int i = 0; i < trust.Count; i++)
|
||||
certificates.Add (trust [(IntPtr)i].ToX509Certificate ());
|
||||
|
||||
remoteCertificate = certificates [0];
|
||||
Debug ("Got peer trust: {0}", remoteCertificate);
|
||||
}
|
||||
|
||||
bool ok;
|
||||
SecTrust trust = null;
|
||||
X509CertificateCollection certificates = null;
|
||||
|
||||
try {
|
||||
trust = GetPeerTrust (!IsServer);
|
||||
|
||||
if (trust == null || trust.Count == 0) {
|
||||
remoteCertificate = null;
|
||||
if (!IsServer)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
certificates = null;
|
||||
} else {
|
||||
if (trust.Count > 1)
|
||||
Debug ("WARNING: Got multiple certificates in SecTrust!");
|
||||
|
||||
certificates = new X509CertificateCollection ();
|
||||
for (int i = 0; i < trust.Count; i++)
|
||||
certificates.Add (trust.GetCertificate (i));
|
||||
|
||||
remoteCertificate = new X509Certificate (certificates [0]);
|
||||
Debug ("Got peer trust: {0}", remoteCertificate);
|
||||
}
|
||||
|
||||
ok = ValidateCertificate (certificates);
|
||||
} catch (Exception ex) {
|
||||
Debug ("Certificate validation failed: {0}", ex);
|
||||
throw new TlsException (AlertDescription.CertificateUnknown, "Certificate validation threw exception.");
|
||||
} finally {
|
||||
if (trust != null)
|
||||
trust.Dispose ();
|
||||
if (certificates != null) {
|
||||
for (int i = 0; i < certificates.Count; i++)
|
||||
certificates [i].Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
@@ -665,7 +674,7 @@ namespace Mono.AppleTls
|
||||
if (value == IntPtr.Zero)
|
||||
throw new TlsException (AlertDescription.CertificateUnknown);
|
||||
}
|
||||
return (value == IntPtr.Zero) ? null : new SecTrust (value);
|
||||
return (value == IntPtr.Zero) ? null : new SecTrust (value, true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -850,24 +859,7 @@ namespace Mono.AppleTls
|
||||
|
||||
public override void Shutdown ()
|
||||
{
|
||||
if (Interlocked.Exchange (ref pendingIO, 1) == 1)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
Debug ("Shutdown");
|
||||
|
||||
lastException = null;
|
||||
|
||||
try {
|
||||
if (closed || disposed)
|
||||
return;
|
||||
|
||||
var status = SSLClose (Handle);
|
||||
Debug ("Shutdown done: {0}", status);
|
||||
CheckStatusAndThrow (status);
|
||||
} finally {
|
||||
closed = true;
|
||||
pendingIO = 0;
|
||||
}
|
||||
closed = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -65,6 +65,10 @@ namespace Mono.AppleTls
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
internal override bool SupportsCleanShutdown {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override SslProtocols SupportedProtocols {
|
||||
get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ namespace Mono.AppleTls {
|
||||
foreach (var certificate in certificates)
|
||||
array [i++] = new SecCertificate (certificate);
|
||||
Initialize (array, policy);
|
||||
for (i = 0; i < array.Length; i++)
|
||||
array [i].Dispose ();
|
||||
}
|
||||
|
||||
void Initialize (SecCertificate[] array, SecPolicy policy)
|
||||
@@ -122,6 +124,17 @@ namespace Mono.AppleTls {
|
||||
}
|
||||
}
|
||||
|
||||
internal X509Certificate GetCertificate (int index)
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new ObjectDisposedException ("SecTrust");
|
||||
if (index < 0 || index >= Count)
|
||||
throw new ArgumentOutOfRangeException ("index");
|
||||
|
||||
var ptr = SecTrustGetCertificateAtIndex (handle, (IntPtr)index);
|
||||
return new X509Certificate (ptr);
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
|
||||
|
||||
|
||||
@@ -364,7 +364,8 @@ namespace Mono.Btls
|
||||
public override void Shutdown ()
|
||||
{
|
||||
Debug ("Shutdown!");
|
||||
// ssl.SetQuietShutdown ();
|
||||
if (Settings == null || !Settings.SendCloseNotify)
|
||||
ssl.SetQuietShutdown ();
|
||||
ssl.Shutdown ();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,10 @@ namespace Mono.Btls
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
internal override bool SupportsCleanShutdown {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override SslProtocols SupportedProtocols {
|
||||
get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ namespace Mono.Net.Security
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
internal override bool SupportsCleanShutdown {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override SslProtocols SupportedProtocols {
|
||||
get { return SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace System.ComponentModel
|
||||
case 32: /* ERROR_SHARING_VIOLATION */ return "Sharing violation";
|
||||
case 33: /* ERROR_LOCK_VIOLATION */ return "Lock violation";
|
||||
case 50: /* ERROR_NOT_SUPPORTED */ return "Operation not supported";
|
||||
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
|
||||
case 87: /* ERROR_INVALID_PARAMETER */ return "Invalid parameter";
|
||||
case 120: /* ERROR_CALL_NOT_IMPLEMENTED */ return "Call not implemented";
|
||||
case 123: /* ERROR_INVALID_NAME */ return "Invalid name";
|
||||
@@ -143,7 +144,6 @@ namespace System.ComponentModel
|
||||
case 52: /* ERROR_DUP_NAME */ return "Duplicate name";
|
||||
case 53: /* ERROR_BAD_NETPATH */ return "Bad netpath";
|
||||
case 54: /* ERROR_NETWORK_BUSY */ return "Network busy";
|
||||
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
|
||||
case 56: /* ERROR_TOO_MANY_CMDS */ return "Too many commands";
|
||||
case 57: /* ERROR_ADAP_HDW_ERR */ return "ADAP HDW error";
|
||||
case 58: /* ERROR_BAD_NET_RESP */ return "Bad net response";
|
||||
|
||||
@@ -1902,7 +1902,7 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError, is_b
|
||||
sockares.Size -= total;
|
||||
|
||||
if (sockares.socket.CleanedUp) {
|
||||
sockares.Complete (total);
|
||||
sockares.Complete (sent_so_far);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1914,7 +1914,7 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError, is_b
|
||||
sockares.Total = sent_so_far;
|
||||
}
|
||||
|
||||
sockares.Complete (total);
|
||||
sockares.Complete (sent_so_far);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace System.Net
|
||||
object socketLock = new object ();
|
||||
IWebConnectionState state;
|
||||
WebExceptionStatus status;
|
||||
WaitCallback initConn;
|
||||
bool keepAlive;
|
||||
byte [] buffer;
|
||||
EventHandler abortHandler;
|
||||
|
||||
@@ -1737,6 +1737,9 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void BeginConnectAddressPortNull ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -1779,7 +1782,11 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#else
|
||||
[ExpectedException (typeof(ObjectDisposedException))]
|
||||
#endif
|
||||
public void BeginConnectAddressPortClosed ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -1909,6 +1916,9 @@ namespace MonoTests.System.Net.Sockets
|
||||
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void BeginConnectMultipleNull ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -1958,7 +1968,11 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#else
|
||||
[ExpectedException (typeof(ObjectDisposedException))]
|
||||
#endif
|
||||
public void BeginConnectMultipleClosed ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -2246,6 +2260,9 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void ConnectAddressPortNull ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -2287,7 +2304,11 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#else
|
||||
[ExpectedException (typeof(ObjectDisposedException))]
|
||||
#endif
|
||||
public void ConnectAddressPortClosed ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -2395,6 +2416,9 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void ConnectMultipleNull ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -2442,7 +2466,11 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#else
|
||||
[ExpectedException (typeof(ObjectDisposedException))]
|
||||
#endif
|
||||
public void ConnectMultipleClosed ()
|
||||
{
|
||||
Socket sock = new Socket (AddressFamily.InterNetwork,
|
||||
@@ -3721,6 +3749,9 @@ namespace MonoTests.System.Net.Sockets
|
||||
// Test case for https://bugzilla.novell.com/show_bug.cgi?id=443346
|
||||
// See also https://bugzilla.xamarin.com/show_bug.cgi?id=52157
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void ConnectedProperty ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (WebException))] // Something catches the PlatformNotSupportedException and re-throws an WebException
|
||||
#endif
|
||||
public void DownloadTwice ()
|
||||
{
|
||||
WebClient wc = new WebClient();
|
||||
|
||||
@@ -79,6 +79,9 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (AggregateException))] // Something catches the PlatformNotSupportedException and re-throws an AggregateException
|
||||
#endif
|
||||
public void DownloadFileTaskAsync ()
|
||||
{
|
||||
WebClient wc = new WebClient ();
|
||||
|
||||
@@ -499,7 +499,7 @@ namespace System
|
||||
|
||||
m = Method;
|
||||
|
||||
return (m != null ? m.GetHashCode () : GetType ().GetHashCode ()) ^ (m_target != null ? m_target.GetHashCode () : 0);
|
||||
return (m != null ? m.GetHashCode () : GetType ().GetHashCode ()) ^ RuntimeHelpers.GetHashCode (m_target);
|
||||
}
|
||||
|
||||
protected virtual MethodInfo GetMethodImpl ()
|
||||
|
||||
@@ -49,9 +49,15 @@ namespace MonoTests.System.Globalization
|
||||
|
||||
c = CultureInfo.InvariantCulture;
|
||||
Assert.AreEqual (2, c.NumberFormat.CurrencyDecimalDigits, "#3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AllCulturesCanParseNegativeNumber ()
|
||||
{
|
||||
foreach (var c in CultureInfo.GetCultures (CultureTypes.AllCultures))
|
||||
{
|
||||
int.Parse ("-1", c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2709,8 +2709,10 @@ namespace MonoTests.System.IO
|
||||
File.Delete (path2);
|
||||
|
||||
try {
|
||||
symlink (path1, path2);
|
||||
symlink (path2, path1);
|
||||
if (symlink (path1, path2) != 0)
|
||||
Assert.Fail ("symlink #1 failed with errno={0}", Marshal.GetLastWin32Error ());
|
||||
if (symlink (path2, path1) != 0)
|
||||
Assert.Fail ("symlink #2 failed with errno={0}", Marshal.GetLastWin32Error ());
|
||||
|
||||
Assert.IsTrue (File.Exists (path1), "File.Exists must return true for path1 symlink loop");
|
||||
Assert.IsTrue (File.Exists (path2), "File.Exists must return true for path2 symlink loop");
|
||||
|
||||
@@ -480,5 +480,97 @@ namespace MonoTests.System.Reflection.Emit
|
||||
Assert.AreEqual (0x02, il [14]); //typedef
|
||||
Assert.AreEqual (0x01, il [19]); //typeref
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodRefTokenSame () {
|
||||
// Get the same non-virtual method from a base and a derived type so
|
||||
// that the MemberInfo:DeclaredType differs but the tokens are the same.
|
||||
//
|
||||
// Regression test for bugzilla #59364
|
||||
|
||||
DefineBasicMethod ();
|
||||
|
||||
var m1 = typeof (object).GetMethod ("GetType");
|
||||
var m2 = typeof (string).GetMethod ("GetType");
|
||||
|
||||
var value_getter = typeof (RuntimeMethodHandle).GetProperty ("Value").GetMethod;
|
||||
|
||||
var il = il_gen;
|
||||
|
||||
var loc = il.DeclareLocal (typeof (RuntimeMethodHandle));
|
||||
|
||||
// return ((int)(RuntimeMethodHandle (m1).Value == RuntimeMethodHandle (m2).Value)).ToString ()
|
||||
il.Emit (OpCodes.Ldtoken, m1);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ldtoken, m2);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ceq);
|
||||
il.Emit (OpCodes.Box, typeof (Int32));
|
||||
il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
|
||||
il.Emit (OpCodes.Ret);
|
||||
|
||||
var baked = tb.CreateType ();
|
||||
|
||||
var x = Activator.CreateInstance (baked);
|
||||
var m = baked.GetMethod ("F");
|
||||
|
||||
var s = m.Invoke (x, null);
|
||||
|
||||
Assert.AreEqual ("1", s);
|
||||
|
||||
}
|
||||
|
||||
public class Base {
|
||||
public int x;
|
||||
}
|
||||
|
||||
public class Derived : Base {
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FieldRefTokenSame () {
|
||||
DefineBasicMethod ();
|
||||
|
||||
// Get the same field from a base and a derived type so hat
|
||||
// the MemberInfo:DeclaredType differs but the tokens are the same.
|
||||
//
|
||||
// Regression test for bugzilla #59364
|
||||
|
||||
var f1 = typeof (Base).GetField ("x");
|
||||
var f2 = typeof (Derived).GetField ("x");
|
||||
|
||||
var value_getter = typeof (RuntimeFieldHandle).GetProperty("Value").GetMethod;
|
||||
|
||||
var il = il_gen;
|
||||
|
||||
var loc = il.DeclareLocal (typeof (RuntimeFieldHandle));
|
||||
|
||||
il.Emit (OpCodes.Ldtoken, f1);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ldtoken, f2);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ceq);
|
||||
il.Emit (OpCodes.Box, typeof (Int32));
|
||||
il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
|
||||
il.Emit (OpCodes.Ret);
|
||||
|
||||
var baked = tb.CreateType ();
|
||||
|
||||
var x = Activator.CreateInstance (baked);
|
||||
var m = baked.GetMethod ("F");
|
||||
|
||||
var s = m.Invoke (x, null);
|
||||
|
||||
Assert.AreEqual ("1", s);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// MonoTests.System.Runtime.Remoting.Proxies.RealProxyTest.cs
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Proxies;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Runtime.Remoting.Proxies {
|
||||
[TestFixture]
|
||||
public class RealProxyTest {
|
||||
|
||||
public class ExampleInterfaceProxy : RealProxy {
|
||||
public bool Called;
|
||||
|
||||
public ExampleInterfaceProxy () : base (typeof(IComparable))
|
||||
{
|
||||
Called = false;
|
||||
}
|
||||
|
||||
public override IMessage Invoke (IMessage msg)
|
||||
{
|
||||
Called = true;
|
||||
return new ReturnMessage (typeof(IComparable), null, 0, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InterfaceProxyGetTypeOkay ()
|
||||
{
|
||||
// Regression test for #17325
|
||||
// Check that GetType () for a proxy of an interface
|
||||
// returns the interface.
|
||||
var prox = new ExampleInterfaceProxy ();
|
||||
var tprox = prox.GetTransparentProxy ();
|
||||
|
||||
Assert.IsNotNull (tprox, "#1");
|
||||
|
||||
var tproxType = tprox.GetType ();
|
||||
|
||||
Assert.IsFalse (prox.Called, "#2"); // this is true on .NET Framework, but false on Mono.
|
||||
|
||||
Assert.IsNotNull (tproxType, "#3");
|
||||
Assert.IsTrue (tproxType.IsAssignableFrom (typeof(IComparable)), "#4");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InterfaceProxyGetTypeViaReflectionOkay ()
|
||||
{
|
||||
// Regression test for #17325
|
||||
// Check that GetType () for a proxy of an interface
|
||||
// returns the interface.
|
||||
//
|
||||
// This versions calls GetType using reflection, which
|
||||
// avoids the fast path in the JIT.
|
||||
var prox = new ExampleInterfaceProxy ();
|
||||
var tprox = prox.GetTransparentProxy ();
|
||||
|
||||
Assert.IsNotNull (tprox, "#1");
|
||||
|
||||
|
||||
var m = typeof(object).GetMethod ("GetType");
|
||||
|
||||
var tproxType = m.Invoke (tprox, null);
|
||||
|
||||
Assert.IsTrue (prox.Called, "#2");
|
||||
|
||||
Assert.IsNotNull (tproxType, "#3");
|
||||
Assert.IsTrue (tproxType is Type, "#4");
|
||||
Assert.IsTrue ((tproxType as Type).IsAssignableFrom (typeof(IComparable)), "#5");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -341,7 +341,7 @@ namespace MonoTests.System.Runtime.Remoting
|
||||
Thread tr = new Thread (new ThreadStart (CallbackThread));
|
||||
tr.Start();
|
||||
|
||||
bool terminated = tr.Join(2000);
|
||||
bool terminated = tr.Join(10000);
|
||||
Assert.IsTrue(terminated, "Thread didn't get lock of context bound object.");
|
||||
|
||||
Assert.IsTrue (!otResult, "Concurrency detected in CallbackThread");
|
||||
|
||||
@@ -1258,7 +1258,7 @@ namespace MonoTests.System.Threading.Tasks
|
||||
{
|
||||
var t = Task.Delay (300);
|
||||
Assert.IsTrue (TaskStatus.WaitingForActivation == t.Status || TaskStatus.Running == t.Status, "#1");
|
||||
Assert.IsTrue (t.Wait (400), "#2");
|
||||
Assert.IsTrue (t.Wait (1200), "#2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -3619,6 +3619,38 @@ namespace MonoTests.System
|
||||
public int field;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsAssignableFromGenericArgumentsWithConstraints ()
|
||||
{
|
||||
// Regression test for #58809
|
||||
|
||||
// Generic Parameters of a gtd should have their
|
||||
// constraints respected even when those constraints
|
||||
// are other generic parameters themselves.
|
||||
|
||||
var ps = typeof (GenericWithParamConstraints<,,>).GetGenericArguments ();
|
||||
|
||||
var a = ps[0];
|
||||
var b = ps[1];
|
||||
var c = ps[2];
|
||||
|
||||
// Foo<C>
|
||||
var fooOfC = typeof (Foo<>).MakeGenericType (c);
|
||||
|
||||
// constraint B : Foo <C>
|
||||
Assert.IsTrue (fooOfC.IsAssignableFrom (b), "#1");
|
||||
|
||||
// constraint A : B
|
||||
Assert.IsTrue (b.IsAssignableFrom (a), "#2");
|
||||
|
||||
// A : Foo<C> since A : B and B : Foo<C>
|
||||
Assert.IsTrue (fooOfC.IsAssignableFrom (a), "#3");
|
||||
}
|
||||
|
||||
class GenericWithParamConstraints<A, B, C> where B : Foo<C> where A : B
|
||||
{
|
||||
}
|
||||
|
||||
[Test] // Bug #612780
|
||||
public void CannotMakeDerivedTypesFromTypedByRef ()
|
||||
{
|
||||
|
||||
@@ -205,6 +205,7 @@ System.Runtime.Remoting.Channels/ChannelServicesTest.cs
|
||||
System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs
|
||||
System.Runtime.Remoting.Messaging/CallContextTest.cs
|
||||
System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinaryTest.cs
|
||||
System.Runtime.Remoting.Proxies/RealProxyTest.cs
|
||||
System.Runtime.Serialization/FormatterServicesTests.cs
|
||||
System.Runtime.Serialization/ObjectIDGeneratorTests.cs
|
||||
System.Runtime.Serialization/SerializationBinderTest.cs
|
||||
|
||||
@@ -40,6 +40,7 @@ System.Runtime.Remoting.Channels/ChannelServicesTest.cs
|
||||
System.Runtime.Remoting.Contexts/SynchronizationAttributeTest.cs
|
||||
System.Runtime.Remoting.Messaging/CallContextTest.cs
|
||||
System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinaryTest.cs
|
||||
System.Runtime.Remoting.Proxies/RealProxyTest.cs
|
||||
System.Security.AccessControl/AuthorizationRuleTest.cs
|
||||
System.Security.AccessControl/CommonAceTest.cs
|
||||
System.Security.AccessControl/CommonAclTest.cs
|
||||
|
||||
@@ -38,6 +38,7 @@ install-local:
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.6.1/*.dll $(PROFILE_DIR)/4.6.1-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.6.2/*.dll $(PROFILE_DIR)/4.6.2-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.7/*.dll $(PROFILE_DIR)/4.7-api
|
||||
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.5/Facades/*.dll $(PROFILE_DIR)/4.5-api/Facades
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.5.1/Facades/*.dll $(PROFILE_DIR)/4.5.1-api/Facades
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.5.2/Facades/*.dll $(PROFILE_DIR)/4.5.2-api/Facades
|
||||
@@ -46,6 +47,16 @@ install-local:
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.6.2/Facades/*.dll $(PROFILE_DIR)/4.6.2-api/Facades
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.7/Facades/*.dll $(PROFILE_DIR)/4.7-api/Facades
|
||||
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/2.0-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.0-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.5-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.5.1-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.5.2-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.6-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.6.1-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.6.2-api
|
||||
$(INSTALL_LIB) ../../../external/binary-reference-assemblies/mono/*.dll $(PROFILE_DIR)/4.7-api
|
||||
|
||||
# Unfortunately, a few programs (most notably NUnit and FSharp) have hardcoded checks for <prefix>/lib/mono/4.0/mscorlib.dll or Mono.Posix.dll,
|
||||
# so we need to place something there or those tools break. We decided to symlink to the reference assembly for now.
|
||||
# See https://bugzilla.xamarin.com/show_bug.cgi?id=38331 and https://bugzilla.xamarin.com/show_bug.cgi?id=41052
|
||||
@@ -71,6 +82,7 @@ DISTFILES = \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/v4.0/*.dll) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/v3.5/*.dll) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/v2.0/*.dll) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/mono/*.dll) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v4.7/Facades/*.cs) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v4.6.2/Facades/*.cs) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v4.6.1/Facades/*.cs) \
|
||||
@@ -88,6 +100,7 @@ DISTFILES = \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v4.0/*.cs) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v3.5/*.cs) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/v2.0/*.cs) \
|
||||
$(wildcard ../../../external/binary-reference-assemblies/src/mono/*.cs) \
|
||||
../../../external/binary-reference-assemblies/v4.7/Makefile \
|
||||
../../../external/binary-reference-assemblies/v4.6.2/Makefile \
|
||||
../../../external/binary-reference-assemblies/v4.6.1/Makefile \
|
||||
@@ -98,6 +111,7 @@ DISTFILES = \
|
||||
../../../external/binary-reference-assemblies/v4.0/Makefile \
|
||||
../../../external/binary-reference-assemblies/v3.5/Makefile \
|
||||
../../../external/binary-reference-assemblies/v2.0/Makefile \
|
||||
../../../external/binary-reference-assemblies/mono/Makefile \
|
||||
../../../external/binary-reference-assemblies/Makefile \
|
||||
Makefile
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace System.Security.Cryptography {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public CngAlgorithm HashAlgorithm { get; set; }
|
||||
|
||||
public CngKey Key {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
@@ -52,6 +54,38 @@ namespace System.Security.Cryptography {
|
||||
public override bool VerifyHash(byte[] hash, byte[] signature) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void FromXmlString (string xml, ECKeyXmlFormat format) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public byte[] SignData (byte[] data) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public byte[] SignData (System.IO.Stream data) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public byte[] SignData (byte[] data, int offset, int count) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public string ToXmlString (ECKeyXmlFormat format) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool VerifyData (byte[] data, byte[] signature) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool VerifyData (System.IO.Stream data, byte[] signature) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool VerifyData (byte[] data, int offset, int count, byte[] signature) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#else
|
||||
private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(256, 384, 128), new KeySizes(521, 521, 0) };
|
||||
|
||||
|
||||
@@ -288,6 +288,7 @@ namespace Mono.ILASM {
|
||||
/* Keywords */
|
||||
%token K_AT
|
||||
%token K_AS
|
||||
%token K_AGGRESSIVEINLINING
|
||||
%token K_IMPLICITCOM
|
||||
%token K_IMPLICITRES
|
||||
%token K_NOAPPDOMAIN
|
||||
@@ -2016,6 +2017,7 @@ impl_attr : /* EMPTY */ { $$ = new ImplAttr (); }
|
||||
| impl_attr K_SYNCHRONIZED { $$ = (ImplAttr) $1 | ImplAttr.Synchronised; }
|
||||
| impl_attr K_NOINLINING { $$ = (ImplAttr) $1 | ImplAttr.NoInLining; }
|
||||
| impl_attr K_NOOPTIMIZATION { $$ = (ImplAttr) $1 | ImplAttr.NoOptimization; }
|
||||
| impl_attr K_AGGRESSIVEINLINING{ $$ = (ImplAttr) $1 | ImplAttr.AggressiveInlining; }
|
||||
;
|
||||
|
||||
sig_args : /* EMPTY */
|
||||
|
||||
@@ -321,6 +321,7 @@ namespace Mono.ILASM {
|
||||
keywords ["legacy"] = new ILToken (Token.K_LEGACY, "legacy");
|
||||
keywords ["library"] = new ILToken (Token.K_LIBRARY, "library");
|
||||
keywords ["auto"] = new ILToken (Token.K_AUTO, "auto");
|
||||
keywords ["aggressiveinlining"] = new ILToken (Token.K_AGGRESSIVEINLINING, "aggressiveinlining");
|
||||
|
||||
return keywords;
|
||||
}
|
||||
|
||||
+4
-4
@@ -234,15 +234,15 @@ namespace Mono.CSharp
|
||||
public static bool CheckOverrideName (TypeSpec type, TypeSpec baseType)
|
||||
{
|
||||
var btype_ntuple = baseType as NamedTupleSpec;
|
||||
var mtype_ntupe = type as NamedTupleSpec;
|
||||
if (btype_ntuple == null && mtype_ntupe == null)
|
||||
var mtype_ntuple = type as NamedTupleSpec;
|
||||
if (btype_ntuple == null && mtype_ntuple == null)
|
||||
return true;
|
||||
|
||||
if (btype_ntuple != null || mtype_ntupe != null)
|
||||
if (btype_ntuple == null || mtype_ntuple == null)
|
||||
return false;
|
||||
|
||||
var b_elements = btype_ntuple.elements;
|
||||
var m_elements = mtype_ntupe.elements;
|
||||
var m_elements = mtype_ntuple.elements;
|
||||
for (int i = 0; i < b_elements.Count; ++i) {
|
||||
if (b_elements [i] != m_elements [i])
|
||||
return false;
|
||||
|
||||
+22
-4
@@ -3,24 +3,42 @@ include ../build/rules.make
|
||||
|
||||
ROSLYN_CSC_DIR = $(dir $(CSC_LOCATION))
|
||||
|
||||
ROSLYN_FILES = \
|
||||
ROSLYN_FILES_FOR_MONO = \
|
||||
$(ROSLYN_CSC_DIR)/csc.exe \
|
||||
$(ROSLYN_CSC_DIR)/csc.rsp \
|
||||
$(ROSLYN_CSC_DIR)/csc.exe.config \
|
||||
$(ROSLYN_CSC_DIR)/csi.exe \
|
||||
$(ROSLYN_CSC_DIR)/csi.exe.config \
|
||||
$(ROSLYN_CSC_DIR)/csi.rsp \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.CSharp.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.CSharp.Scripting.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.VisualBasic.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CodeAnalysis.Scripting.dll \
|
||||
$(ROSLYN_CSC_DIR)/System.Collections.Immutable.dll \
|
||||
$(ROSLYN_CSC_DIR)/System.Reflection.Metadata.dll
|
||||
$(ROSLYN_CSC_DIR)/System.Reflection.Metadata.dll \
|
||||
$(ROSLYN_CSC_DIR)/VBCSCompiler.exe \
|
||||
$(ROSLYN_CSC_DIR)/VBCSCompiler.exe.config
|
||||
|
||||
DISTFILES = $(ROSLYN_FILES)
|
||||
ROSLYN_FILES_TO_COPY_FOR_MSBUILD = \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.Build.Tasks.CodeAnalysis.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CSharp.Core.targets \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.VisualBasic.Core.targets
|
||||
|
||||
DISTFILES = $(ROSLYN_FILES_FOR_MONO) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD)
|
||||
|
||||
ifeq ($(PROFILE), $(DEFAULT_PROFILE))
|
||||
|
||||
TARGET_DIR = $(DESTDIR)$(mono_libdir)/mono/$(FRAMEWORK_VERSION)
|
||||
MSBUILD_ROSLYN_DIR = $(DESTDIR)$(mono_libdir)/mono/msbuild/15.0/bin/Roslyn
|
||||
|
||||
install-local:
|
||||
$(MKINSTALLDIRS) $(TARGET_DIR)
|
||||
$(INSTALL_LIB) $(ROSLYN_FILES) $(TARGET_DIR)
|
||||
$(INSTALL_LIB) $(ROSLYN_FILES_FOR_MONO) $(TARGET_DIR)
|
||||
$(MKINSTALLDIRS) $(MSBUILD_ROSLYN_DIR)
|
||||
$(INSTALL_LIB) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) $(MSBUILD_ROSLYN_DIR)
|
||||
|
||||
(cd $(MSBUILD_ROSLYN_DIR); for asm in $(ROSLYN_FILES_FOR_MONO); do ln -fs ../../../../$(FRAMEWORK_VERSION)/$$(basename $$asm) . ; done)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
class Base
|
||||
{
|
||||
public virtual (int, long rest) Foo ()
|
||||
{
|
||||
return (1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
class Test : Base
|
||||
{
|
||||
public override (int, long rest) Foo ()
|
||||
{
|
||||
return (3, 4);
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -73115,6 +73115,27 @@
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-tuple-06.cs">
|
||||
<type name="Base">
|
||||
<method name="System.ValueTuple`2[System.Int32,System.Int64] Foo()" attrs="454">
|
||||
<size>17</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="Test">
|
||||
<method name="System.ValueTuple`2[System.Int32,System.Int64] Foo()" attrs="198">
|
||||
<size>17</size>
|
||||
</method>
|
||||
<method name="Void Main()" attrs="150">
|
||||
<size>2</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-var-01.cs">
|
||||
<type name="Test">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\BaseStep.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\BlacklistStep.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\CleanStep.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\ConsoleLogger.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\IStep.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\LoadI18nAssemblies.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\LoadReferencesStep.cs" />
|
||||
@@ -73,6 +74,7 @@
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\AssemblyResolver.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\Driver.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\I18nAssemblies.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\ILogger.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\IXApiVisitor.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\LinkContext.cs" />
|
||||
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\LoadException.cs" />
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
../../../external/linker/linker/Mono.Linker/AssemblyAction.cs
|
||||
../../../external/linker/linker/Mono.Linker/Driver.cs
|
||||
../../../external/linker/linker/Mono.Linker/I18nAssemblies.cs
|
||||
../../../external/linker/linker/Mono.Linker/ILogger.cs
|
||||
../../../external/linker/linker/Mono.Linker/ConsoleLogger.cs
|
||||
../../../external/linker/linker/Mono.Linker/MethodAction.cs
|
||||
../../../external/linker/linker/Mono.Linker/XApiReader.cs
|
||||
../../../external/linker/linker/Mono.Linker/IXApiVisitor.cs
|
||||
|
||||
@@ -252,7 +252,12 @@ namespace Xamarin.ApiDiff {
|
||||
|
||||
public override void Removed (XElement source)
|
||||
{
|
||||
Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
|
||||
string name = State.Namespace + "." + GetTypeName (source);
|
||||
|
||||
if (State.IgnoreRemoved.Any (re => re.IsMatch (name)))
|
||||
return;
|
||||
|
||||
Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}</span></h3>", name);
|
||||
}
|
||||
|
||||
public virtual string GetTypeName (XElement type)
|
||||
|
||||
@@ -133,10 +133,15 @@ namespace Xamarin.ApiDiff {
|
||||
if (parameters != null) {
|
||||
var list = new List<string> ();
|
||||
foreach (var p in parameters.Elements ("parameter")) {
|
||||
var pTypeName = p.GetTypeName ("type");
|
||||
list.Add (State.IgnoreParameterNameChanges
|
||||
? pTypeName
|
||||
: pTypeName + " " + p.GetAttribute ("name"));
|
||||
var param = p.GetTypeName ("type");
|
||||
if (!State.IgnoreParameterNameChanges)
|
||||
param += " " + p.GetAttribute ("name");
|
||||
|
||||
var direction = p.GetAttribute ("direction");
|
||||
if (direction?.Length > 0)
|
||||
param = direction + " " + param;
|
||||
|
||||
list.Add (param);
|
||||
}
|
||||
sb.Append (String.Join (", ", list));
|
||||
}
|
||||
|
||||
@@ -91,6 +91,10 @@ namespace Xamarin.ApiDiff {
|
||||
public override void Removed (XElement source)
|
||||
{
|
||||
var name = source.Attribute ("name").Value;
|
||||
|
||||
if (State.IgnoreRemoved.Any (re => re.IsMatch (name)))
|
||||
return;
|
||||
|
||||
Output.WriteLine ("<!-- start namespace {0} --> <div>", name);
|
||||
Output.WriteLine ("<h2>Removed Namespace {0}</h2>", name);
|
||||
Output.WriteLine ();
|
||||
|
||||
@@ -22,6 +22,7 @@ endif
|
||||
|
||||
PORTABLE_TARGETS_SRC:=data/Portable/Targets
|
||||
PCL5_FX_SRC:=data/Portable/Frameworks/v5.0
|
||||
DENIED_ASSEMBLY_LIST_SRC=data/deniedAssembliesList.txt
|
||||
|
||||
NETFRAMEWORK_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework
|
||||
PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
|
||||
@@ -39,7 +40,7 @@ endif
|
||||
install-versioned-files: install-bin-data install-nuget-imports
|
||||
|
||||
#install files that are only installed once across all xbuild versions
|
||||
install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets
|
||||
install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets install-msbuild-specific-files
|
||||
|
||||
install-bin-data:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/MSBuild
|
||||
@@ -126,6 +127,10 @@ install-pcl5-framework:
|
||||
$(INSTALL_DATA) "$(PCL5_FX_SRC)/ASP.NET Core 1.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/ASP.NET Core 1.0.xml"
|
||||
$(INSTALL_DATA) "$(PCL5_FX_SRC)/Windows Universal 10.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/Windows Universal 10.0.xml"
|
||||
|
||||
install-msbuild-specific-files:
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild
|
||||
$(INSTALL_DATA) $(DENIED_ASSEMBLY_LIST_SRC) $(DESTDIR)$(mono_libdir)/mono/xbuild
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
data/xbuild.rsp \
|
||||
data/xbuild.exe.config.in \
|
||||
@@ -168,6 +173,7 @@ EXTRA_DISTFILES = \
|
||||
"data/Portable/Frameworks/v5.0/ASP.NET Core 1.0.xml" \
|
||||
"data/Portable/Frameworks/v5.0/FrameworkList.xml" \
|
||||
"data/Portable/Frameworks/v5.0/Windows Universal 10.0.xml" \
|
||||
data/deniedAssembliesList.txt \
|
||||
frameworks/net_2.0.xml \
|
||||
frameworks/net_3.0.xml \
|
||||
frameworks/net_3.5.xml \
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
System.Globalization.Extensions.dll,475DBF02-9F68-44F1-8FB5-C9F69F1BD2B1,4,0,0,0
|
||||
System.Globalization.Extensions.dll,5FCD54F0-4B97-4259-875D-30E481F02EA2,4,0,1,0
|
||||
System.Globalization.Extensions.dll,E9FCFF5B-4DE1-4BDC-9CE8-08C640FC78CC,4,0,2,0
|
||||
System.IO.Compression.dll,44FCA06C-A510-4B3E-BDBF-D08D697EF65A,4,1,0,0
|
||||
System.IO.Compression.dll,3A58A219-266B-47C3-8BE8-4E4F394147AB,4,1,2,0
|
||||
System.Net.Http.dll,269B562C-CC15-4736-B1B1-68D4A43CAA98,4,1,0,0
|
||||
System.Net.Http.dll,EA2EC6DC-51DD-479C-BFC2-E713FB9E7E47,4,1,0,1
|
||||
System.Net.Http.dll,C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0,4,1,1,0
|
||||
System.Net.Http.dll,817F01C3-4011-477D-890A-98232B85553D,4,1,1,0
|
||||
System.Net.Http.dll,09D4A140-061C-4884-9B63-22067E841931,4,1,1,1
|
||||
System.Runtime.InteropServices.RuntimeInformation.dll,F13660F8-9D0D-419F-BA4E-315693DD26EA,4,0,0,0
|
||||
System.Runtime.InteropServices.RuntimeInformation.dll,DD91439F-3167-478E-BD2C-BF9C036A1395,4,0,1,0
|
||||
System.Text.Encoding.CodePages.dll,C142254F-DEB5-46A7-AE43-6F10320D1D1F,4,0,1,0
|
||||
System.Text.Encoding.CodePages.dll,FD178CD4-EF4F-44D5-9C3F-812B1E25126B,4,0,2,0
|
||||
System.Text.Encoding.CodePages.dll,F5CCCBEC-E1AD-4DBB-9B44-9B42C86B94B8,4,1,0,0
|
||||
System.Threading.Overlapped.dll,9F5D4F09-787A-458A-BA08-553AA71470F1,4,0,0,0
|
||||
System.Threading.Overlapped.dll,FCBD003B-2BB4-4940-BAEF-63AF520C2336,4,0,1,0
|
||||
System.Threading.Overlapped.dll,87697E71-D192-4F0B-BAD4-02BBC7793005,4,0,2,0
|
||||
@@ -1174,7 +1174,13 @@ mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, Mo
|
||||
params [0] = MONO_HANDLE_RAW (fname);
|
||||
params[1] = requesting ? MONO_HANDLE_RAW (requesting_handle) : NULL;
|
||||
params [2] = &isrefonly;
|
||||
MonoReflectionAssemblyHandle result = MONO_HANDLE_NEW (MonoReflectionAssembly, mono_runtime_invoke_checked (method, domain->domain, params, error));
|
||||
MonoObject *exc = NULL;
|
||||
MonoReflectionAssemblyHandle result = MONO_HANDLE_NEW (MonoReflectionAssembly, mono_runtime_try_invoke (method, domain->domain, params, &exc, error));
|
||||
if (!is_ok (error) || exc != NULL) {
|
||||
if (is_ok (error))
|
||||
mono_error_set_exception_instance (error, (MonoException*)exc);
|
||||
goto leave;
|
||||
}
|
||||
ret = !MONO_HANDLE_IS_NULL (result) ? MONO_HANDLE_GETVAL (result, assembly) : NULL;
|
||||
|
||||
if (ret && !refonly && ret->ref_only) {
|
||||
|
||||
@@ -37,8 +37,10 @@ typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
|
||||
|
||||
#ifdef ENABLE_ICALL_EXPORT
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#define ICALL_DECL_EXPORT MONO_API
|
||||
#define ICALL_EXPORT MONO_API
|
||||
#else
|
||||
#define ICALL_DECL_EXPORT
|
||||
#define ICALL_EXPORT static
|
||||
#endif
|
||||
|
||||
|
||||
+39
-15
@@ -1512,6 +1512,7 @@ mono_class_set_type_load_failure_causedby_class (MonoClass *klass, const MonoCla
|
||||
* Sets the following fields in \p klass:
|
||||
* - all the fields initialized by mono_class_init_sizes ()
|
||||
* - element_class/cast_class (for enums)
|
||||
* - sizes:element_size (for arrays)
|
||||
* - field->type/offset for all fields
|
||||
* - fields_inited
|
||||
*
|
||||
@@ -1771,6 +1772,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
|
||||
MonoClassField *field;
|
||||
gboolean blittable;
|
||||
int instance_size = base_instance_size;
|
||||
int element_size = -1;
|
||||
int class_size, min_align;
|
||||
int *field_offsets;
|
||||
gboolean *fields_has_references;
|
||||
@@ -2100,6 +2102,9 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
|
||||
else if (klass->byval_arg.type == MONO_TYPE_PTR)
|
||||
instance_size = sizeof (MonoObject) + sizeof (gpointer);
|
||||
|
||||
if (klass->byval_arg.type == MONO_TYPE_SZARRAY || klass->byval_arg.type == MONO_TYPE_ARRAY)
|
||||
element_size = mono_class_array_element_size (klass->element_class);
|
||||
|
||||
/* Publish the data */
|
||||
mono_loader_lock ();
|
||||
if (klass->instance_size && !klass->image->dynamic) {
|
||||
@@ -2130,6 +2135,9 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
|
||||
klass->fields [i].offset = field_offsets [i];
|
||||
}
|
||||
|
||||
if (klass->byval_arg.type == MONO_TYPE_SZARRAY || klass->byval_arg.type == MONO_TYPE_ARRAY)
|
||||
klass->sizes.element_size = element_size;
|
||||
|
||||
mono_memory_barrier ();
|
||||
klass->size_inited = 1;
|
||||
mono_loader_unlock ();
|
||||
@@ -4879,7 +4887,7 @@ mono_class_init (MonoClass *klass)
|
||||
GSList *init_list = (GSList *)mono_native_tls_get_value (init_pending_tls_id);
|
||||
if (g_slist_find (init_list, klass)) {
|
||||
mono_class_set_type_load_failure (klass, "Recursive type definition detected");
|
||||
goto leave;
|
||||
goto leave_no_init_pending;
|
||||
}
|
||||
init_list = g_slist_prepend (init_list, klass);
|
||||
mono_native_tls_set_value (init_pending_tls_id, init_list);
|
||||
@@ -5078,10 +5086,12 @@ mono_class_init (MonoClass *klass)
|
||||
|
||||
goto leave;
|
||||
|
||||
leave:
|
||||
leave:
|
||||
init_list = mono_native_tls_get_value (init_pending_tls_id);
|
||||
init_list = g_slist_remove (init_list, klass);
|
||||
mono_native_tls_set_value (init_pending_tls_id, init_list);
|
||||
|
||||
leave_no_init_pending:
|
||||
if (locked)
|
||||
mono_loader_unlock ();
|
||||
|
||||
@@ -6595,7 +6605,7 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
|
||||
/* element_size -1 is ok as this is not an instantitable type*/
|
||||
klass->sizes.element_size = -1;
|
||||
} else
|
||||
klass->sizes.element_size = mono_class_array_element_size (eclass);
|
||||
klass->sizes.element_size = -1;
|
||||
|
||||
mono_class_setup_supertypes (klass);
|
||||
|
||||
@@ -8209,22 +8219,31 @@ mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass)
|
||||
return mono_gparam_is_assignable_from (klass, oklass);
|
||||
}
|
||||
|
||||
if (MONO_CLASS_IS_INTERFACE (klass)) {
|
||||
if ((oklass->byval_arg.type == MONO_TYPE_VAR) || (oklass->byval_arg.type == MONO_TYPE_MVAR)) {
|
||||
MonoGenericParam *gparam = oklass->byval_arg.data.generic_param;
|
||||
MonoClass **constraints = mono_generic_container_get_param_info (gparam->owner, gparam->num)->constraints;
|
||||
int i;
|
||||
/* This can happen if oklass is a tyvar that has a constraint which is another tyvar which in turn
|
||||
* has a constraint which is a class type:
|
||||
*
|
||||
* class Foo { }
|
||||
* class G<T1, T2> where T1 : T2 where T2 : Foo { }
|
||||
*
|
||||
* In this case, Foo is assignable from T1.
|
||||
*/
|
||||
if ((oklass->byval_arg.type == MONO_TYPE_VAR) || (oklass->byval_arg.type == MONO_TYPE_MVAR)) {
|
||||
MonoGenericParam *gparam = oklass->byval_arg.data.generic_param;
|
||||
MonoClass **constraints = mono_generic_container_get_param_info (gparam->owner, gparam->num)->constraints;
|
||||
int i;
|
||||
|
||||
if (constraints) {
|
||||
for (i = 0; constraints [i]; ++i) {
|
||||
if (mono_class_is_assignable_from (klass, constraints [i]))
|
||||
return TRUE;
|
||||
}
|
||||
if (constraints) {
|
||||
for (i = 0; constraints [i]; ++i) {
|
||||
if (mono_class_is_assignable_from (klass, constraints [i]))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return mono_class_has_parent (oklass, klass);
|
||||
}
|
||||
|
||||
if (MONO_CLASS_IS_INTERFACE (klass)) {
|
||||
|
||||
/* interface_offsets might not be set for dynamic classes */
|
||||
if (mono_class_get_ref_info_handle (oklass) && !oklass->interface_bitmap) {
|
||||
/*
|
||||
@@ -8633,11 +8652,16 @@ handle_enum:
|
||||
* \param ac pointer to a \c MonoArrayClass
|
||||
*
|
||||
* \returns The size of single array element.
|
||||
*
|
||||
* LOCKING: Acquires the loader lock.
|
||||
*/
|
||||
gint32
|
||||
mono_array_element_size (MonoClass *ac)
|
||||
{
|
||||
g_assert (ac->rank);
|
||||
if (G_UNLIKELY (!ac->size_inited)) {
|
||||
mono_class_setup_fields (ac);
|
||||
}
|
||||
return ac->sizes.element_size;
|
||||
}
|
||||
|
||||
|
||||
+1287
-1292
File diff suppressed because it is too large.
Load diff
@@ -355,7 +355,6 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
|
||||
image->method_aux_hash = g_hash_table_new (NULL, NULL);
|
||||
image->vararg_aux_hash = g_hash_table_new (NULL, NULL);
|
||||
image->handleref = g_hash_table_new (NULL, NULL);
|
||||
image->handleref_managed = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module reference-to-token table");
|
||||
image->tokens = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module tokens table");
|
||||
image->generic_def_objects = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module generic definitions table");
|
||||
image->typespec = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
|
||||
@@ -475,7 +474,6 @@ void
|
||||
mono_dynamic_image_release_gc_roots (MonoDynamicImage *image)
|
||||
{
|
||||
release_hashtable (&image->token_fixups);
|
||||
release_hashtable (&image->handleref_managed);
|
||||
release_hashtable (&image->tokens);
|
||||
release_hashtable (&image->remapped_tokens);
|
||||
release_hashtable (&image->generic_def_objects);
|
||||
@@ -495,8 +493,6 @@ mono_dynamic_image_free (MonoDynamicImage *image)
|
||||
g_hash_table_destroy (di->typeref);
|
||||
if (di->handleref)
|
||||
g_hash_table_destroy (di->handleref);
|
||||
if (di->handleref_managed)
|
||||
mono_g_hash_table_destroy (di->handleref_managed);
|
||||
if (di->tokens)
|
||||
mono_g_hash_table_destroy (di->tokens);
|
||||
if (di->remapped_tokens)
|
||||
|
||||
@@ -1256,7 +1256,13 @@ ves_icall_System_Object_GetType (MonoObjectHandle obj, MonoError *error)
|
||||
if (mono_class_is_transparent_proxy (klass)) {
|
||||
MonoTransparentProxyHandle proxy_obj = MONO_HANDLE_CAST (MonoTransparentProxy, obj);
|
||||
MonoRemoteClass *remote_class = MONO_HANDLE_GETVAL (proxy_obj, remote_class);
|
||||
MonoType *proxy_type = &remote_class->proxy_class->byval_arg;
|
||||
/* If it's a transparent proxy for an interface, return the
|
||||
* interface type, not the unhelpful proxy_class class (which
|
||||
* is just MarshalByRefObject). */
|
||||
MonoType *proxy_type =
|
||||
mono_remote_class_is_interface_proxy (remote_class) ?
|
||||
&remote_class->interfaces[0]->byval_arg :
|
||||
&remote_class->proxy_class->byval_arg;
|
||||
return mono_type_get_object_handle (domain, proxy_type, error);
|
||||
} else
|
||||
#endif
|
||||
|
||||
+8
-10
@@ -1113,6 +1113,11 @@ Right now the list of nugets are the ones that provide the assemblies in $ignore
|
||||
|
||||
This is to be removed once a proper fix is shipped through nuget.
|
||||
|
||||
Please keep this in sync with mcs/tools/xbuild/data/deniedAssembliesList.txt
|
||||
If any assemblies are added/removed, then this should be regenerated with:
|
||||
|
||||
$ mono tools/nuget-hash-extractor/nuget-hash-extractor.exe nugets guids_for_msbuild > mcs/tools/xbuild/data/deniedAssembliesList.txt
|
||||
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@@ -1121,8 +1126,7 @@ typedef enum {
|
||||
SYS_IO_COMPRESSION = 2, //System.IO.Compression
|
||||
SYS_NET_HTTP = 3, //System.Net.Http
|
||||
SYS_TEXT_ENC_CODEPAGES = 4, //System.Text.Encoding.CodePages
|
||||
SYS_REF_DISP_PROXY = 5, //System.Reflection.DispatchProxy
|
||||
SYS_THREADING_OVERLAPPED = 6, //System.Threading.Overlapped
|
||||
SYS_THREADING_OVERLAPPED = 5, //System.Threading.Overlapped
|
||||
} IgnoredAssemblyNames;
|
||||
|
||||
typedef struct {
|
||||
@@ -1142,7 +1146,6 @@ const char *ignored_assemblies_file_names[] = {
|
||||
"System.IO.Compression.dll",
|
||||
"System.Net.Http.dll",
|
||||
"System.Text.Encoding.CodePages.dll",
|
||||
"System.Reflection.DispatchProxy.dll",
|
||||
"System.Threading.Overlapped.dll"
|
||||
};
|
||||
|
||||
@@ -1159,13 +1162,11 @@ static const IgnoredAssembly ignored_assemblies [] = {
|
||||
IGNORED_ASSEMBLY (0x8437178B, SYS_NET_HTTP, "C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0", "4.3.0 net46"),
|
||||
IGNORED_ASSEMBLY (0xFAFDA422, SYS_NET_HTTP, "817F01C3-4011-477D-890A-98232B85553D", "4.3.1 net46"),
|
||||
IGNORED_ASSEMBLY (0x472FA630, SYS_NET_HTTP, "09D4A140-061C-4884-9B63-22067E841931", "4.3.2 net46"),
|
||||
IGNORED_ASSEMBLY (0x4A15555E, SYS_REF_DISP_PROXY, "E40AFEB4-CABE-4124-8412-B46AB79C92FD", "4.0.0 net46"),
|
||||
IGNORED_ASSEMBLY (0xD20D9783, SYS_REF_DISP_PROXY, "2A69F0AD-B86B-40F2-8E4C-5B671E47479F", "4.0.1 netstandard1.3"),
|
||||
IGNORED_ASSEMBLY (0xA33A7E68, SYS_REF_DISP_PROXY, "D4E8D2DB-BD65-4168-99EA-D2C1BDEBF9CC", "4.3.0 netstandard1.3"),
|
||||
IGNORED_ASSEMBLY (0x46A4A1C5, SYS_RT_INTEROP_RUNTIME_INFO, "F13660F8-9D0D-419F-BA4E-315693DD26EA", "4.0.0 net45"),
|
||||
IGNORED_ASSEMBLY (0xD07383BB, SYS_RT_INTEROP_RUNTIME_INFO, "DD91439F-3167-478E-BD2C-BF9C036A1395", "4.3.0 net45"),
|
||||
IGNORED_ASSEMBLY (0x911D9EC3, SYS_TEXT_ENC_CODEPAGES, "C142254F-DEB5-46A7-AE43-6F10320D1D1F", "4.0.1 net46"),
|
||||
IGNORED_ASSEMBLY (0xFA686A38, SYS_TEXT_ENC_CODEPAGES, "FD178CD4-EF4F-44D5-9C3F-812B1E25126B", "4.3.0 net46"),
|
||||
IGNORED_ASSEMBLY (0xF6D18A2E, SYS_TEXT_ENC_CODEPAGES, "F5CCCBEC-E1AD-4DBB-9B44-9B42C86B94B8", "4.4.0 net461"),
|
||||
IGNORED_ASSEMBLY (0xAA21986B, SYS_THREADING_OVERLAPPED, "9F5D4F09-787A-458A-BA08-553AA71470F1", "4.0.0 net46"),
|
||||
IGNORED_ASSEMBLY (0x7D927C2A, SYS_THREADING_OVERLAPPED, "FCBD003B-2BB4-4940-BAEF-63AF520C2336", "4.0.1 net46"),
|
||||
IGNORED_ASSEMBLY (0x6FE03EE2, SYS_THREADING_OVERLAPPED, "87697E71-D192-4F0B-BAD4-02BBC7793005", "4.3.0 net46")
|
||||
@@ -1178,7 +1179,6 @@ const char *ignored_assemblies_names[] = {
|
||||
"System.IO.Compression",
|
||||
"System.Net.Http",
|
||||
"System.Text.Encoding.CodePages",
|
||||
"System.Reflection.DispatchProxy",
|
||||
"System.Threading.Overlapped"
|
||||
};
|
||||
|
||||
@@ -1194,13 +1194,11 @@ static const IgnoredAssemblyVersion ignored_assembly_versions [] = {
|
||||
IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 1),
|
||||
IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 0),
|
||||
IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 1),
|
||||
IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 0, 0),
|
||||
IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 1, 0),
|
||||
IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 2, 0),
|
||||
IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 0, 0),
|
||||
IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 1, 0),
|
||||
IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 1, 0),
|
||||
IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 2, 0),
|
||||
IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 1, 0, 0),
|
||||
IGNORED_ASM_VER (SYS_THREADING_OVERLAPPED, 4, 0, 0, 0),
|
||||
IGNORED_ASM_VER (SYS_THREADING_OVERLAPPED, 4, 0, 1, 0),
|
||||
IGNORED_ASM_VER (SYS_THREADING_OVERLAPPED, 4, 0, 2, 0),
|
||||
|
||||
+11
-3
@@ -313,9 +313,17 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
|
||||
mono_class_init (k);
|
||||
if (retklass)
|
||||
*retklass = k;
|
||||
field = mono_class_get_field (k, token);
|
||||
if (!field) {
|
||||
mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
|
||||
if (mono_class_has_failure (k)) {
|
||||
MonoError causedby_error;
|
||||
error_init (&causedby_error);
|
||||
mono_error_set_for_class_failure (&causedby_error, k);
|
||||
mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x, due to: %s", token, mono_error_get_message (&causedby_error));
|
||||
mono_error_cleanup (&causedby_error);
|
||||
} else {
|
||||
field = mono_class_get_field (k, token);
|
||||
if (!field) {
|
||||
mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11590,7 +11590,6 @@ mono_marshal_load_type_info (MonoClass* klass)
|
||||
|
||||
layout = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK;
|
||||
|
||||
/* The mempool is protected by the loader lock */
|
||||
info = (MonoMarshalType *)mono_image_alloc0 (klass->image, MONO_SIZEOF_MARSHAL_TYPE + sizeof (MonoMarshalField) * count);
|
||||
info->num_fields = count;
|
||||
|
||||
@@ -11677,8 +11676,11 @@ mono_marshal_load_type_info (MonoClass* klass)
|
||||
info->min_align = min_align;
|
||||
|
||||
/* Update the class's blittable info, if the layouts don't match */
|
||||
if (info->native_size != mono_class_value_size (klass, NULL))
|
||||
if (info->native_size != mono_class_value_size (klass, NULL)) {
|
||||
mono_loader_lock ();
|
||||
klass->blittable = FALSE;
|
||||
mono_loader_unlock ();
|
||||
}
|
||||
|
||||
/* If this is an array type, ensure that we have element info */
|
||||
if (klass->rank && !mono_marshal_is_loading_type_info (klass->element_class)) {
|
||||
@@ -12364,7 +12366,7 @@ ftnptr_eh_callback_default (guint32 gchandle)
|
||||
|
||||
mono_gchandle_free (gchandle);
|
||||
|
||||
mono_raise_exception (exc);
|
||||
mono_reraise_exception (exc);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -503,7 +503,6 @@ struct _MonoDynamicImage {
|
||||
GHashTable *typespec;
|
||||
GHashTable *typeref;
|
||||
GHashTable *handleref;
|
||||
MonoGHashTable *handleref_managed;
|
||||
MonoGHashTable *tokens;
|
||||
GHashTable *blob_cache;
|
||||
GHashTable *standalonesig_cache;
|
||||
|
||||
@@ -643,6 +643,7 @@ typedef struct {
|
||||
gboolean (*mono_current_thread_has_handle_block_guard) (void);
|
||||
gboolean (*mono_above_abort_threshold) (void);
|
||||
void (*mono_clear_abort_threshold) (void);
|
||||
void (*mono_reraise_exception) (MonoException *ex);
|
||||
} MonoRuntimeExceptionHandlingCallbacks;
|
||||
|
||||
MONO_COLD void mono_set_pending_exception (MonoException *exc);
|
||||
@@ -1574,6 +1575,9 @@ ves_icall_array_new_specific (MonoVTable *vtable, uintptr_t n);
|
||||
MonoRemoteClass*
|
||||
mono_remote_class (MonoDomain *domain, MonoStringHandle class_name, MonoClass *proxy_class, MonoError *error);
|
||||
|
||||
gboolean
|
||||
mono_remote_class_is_interface_proxy (MonoRemoteClass *remote_class);
|
||||
|
||||
MonoObject *
|
||||
mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg, MonoObject **exc, MonoArray **out_args, MonoError *error);
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ DECL_OFFSET(MonoThreadsSync, status)
|
||||
DECL_OFFSET(MonoThreadsSync, nest)
|
||||
|
||||
DECL_OFFSET(MonoProfilerCallContext, method)
|
||||
DECL_OFFSET(MonoProfilerCallContext, return_value)
|
||||
|
||||
#ifdef HAVE_SGEN_GC
|
||||
DECL_OFFSET(SgenClientThreadInfo, in_critical_region)
|
||||
|
||||
@@ -2165,6 +2165,22 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, MonoErro
|
||||
}
|
||||
|
||||
#ifndef DISABLE_REMOTING
|
||||
/**
|
||||
* mono_remote_class_is_interface_proxy:
|
||||
* \param remote_class
|
||||
*
|
||||
* Returns TRUE if the given remote class is a proxying an interface (as
|
||||
* opposed to a class deriving from MarshalByRefObject).
|
||||
*/
|
||||
gboolean
|
||||
mono_remote_class_is_interface_proxy (MonoRemoteClass *remote_class)
|
||||
{
|
||||
/* This if condition is taking advantage of how mono_remote_class ()
|
||||
* works: if that code changes, this needs to change too. */
|
||||
return (remote_class->interface_count >= 1 &&
|
||||
remote_class->proxy_class == mono_defaults.marshalbyrefobject_class);
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_class_proxy_vtable:
|
||||
* \param domain the application domain
|
||||
@@ -2259,6 +2275,18 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
|
||||
/* we need to keep the GC descriptor for a transparent proxy or we confuse the precise GC */
|
||||
pvt->gc_descr = mono_defaults.transparent_proxy_class->gc_descr;
|
||||
|
||||
if (mono_remote_class_is_interface_proxy (remote_class)) {
|
||||
/* If it's a transparent proxy for an interface, set the
|
||||
* MonoVTable:type to the interface type, not the placeholder
|
||||
* MarshalByRefObject class. This is used when mini JITs calls
|
||||
* to Object.GetType ()
|
||||
*/
|
||||
MonoType *itf_proxy_type = &remote_class->interfaces[0]->byval_arg;
|
||||
pvt->type = mono_type_get_object_checked (domain, itf_proxy_type, error);
|
||||
if (!is_ok (error))
|
||||
goto failure;
|
||||
}
|
||||
|
||||
/* initialize vtable */
|
||||
mono_class_setup_vtable (klass);
|
||||
for (i = 0; i < klass->vtable_size; ++i) {
|
||||
@@ -2526,6 +2554,12 @@ mono_remote_class (MonoDomain *domain, MonoStringHandle class_name, MonoClass *p
|
||||
key = mp_key;
|
||||
|
||||
if (mono_class_is_interface (proxy_class)) {
|
||||
/* If we need to proxy an interface, we use this stylized
|
||||
* representation (interface_count >= 1, proxy_class is
|
||||
* MarshalByRefObject). The code in
|
||||
* mono_remote_class_is_interface_proxy () depends on being
|
||||
* able to detect that we're doing this, so if this
|
||||
* representation changes, change GetType, too. */
|
||||
rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*));
|
||||
rc->interface_count = 1;
|
||||
rc->interfaces [0] = proxy_class;
|
||||
@@ -7346,6 +7380,25 @@ mono_raise_exception (MonoException *ex)
|
||||
eh_callbacks.mono_raise_exception (ex);
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_raise_exception:
|
||||
* \param ex exception object
|
||||
* Signal the runtime that the exception \p ex has been raised in unmanaged code.
|
||||
*/
|
||||
void
|
||||
mono_reraise_exception (MonoException *ex)
|
||||
{
|
||||
MONO_REQ_GC_UNSAFE_MODE;
|
||||
|
||||
/*
|
||||
* NOTE: Do NOT annotate this function with G_GNUC_NORETURN, since
|
||||
* that will cause gcc to omit the function epilog, causing problems when
|
||||
* the JIT tries to walk the stack, since the return address on the stack
|
||||
* will point into the next function in the executable, not this one.
|
||||
*/
|
||||
eh_callbacks.mono_reraise_exception (ex);
|
||||
}
|
||||
|
||||
void
|
||||
mono_raise_exception_with_context (MonoException *ex, MonoContext *ctx)
|
||||
{
|
||||
|
||||
@@ -243,6 +243,9 @@ mono_monitor_exit (MonoObject *obj);
|
||||
MONO_API void
|
||||
mono_raise_exception (MonoException *ex);
|
||||
|
||||
MONO_API void
|
||||
mono_reraise_exception (MonoException *ex);
|
||||
|
||||
MONO_RT_EXTERNAL_ONLY
|
||||
MONO_API void
|
||||
mono_runtime_object_init (MonoObject *this_obj);
|
||||
|
||||
@@ -56,6 +56,7 @@ MONO_PROFILER_EVENT_1(assembly_unloaded, AssemblyLUnloaded, MonoAssembly *, asse
|
||||
|
||||
MONO_PROFILER_EVENT_2(method_enter, MethodEnter, MonoMethod *, method, MonoProfilerCallContext *, context)
|
||||
MONO_PROFILER_EVENT_2(method_leave, MethodLeave, MonoMethod *, method, MonoProfilerCallContext *, context)
|
||||
MONO_PROFILER_EVENT_2(method_tail_call, MethodTailCall, MonoMethod *, method, MonoMethod *, target)
|
||||
MONO_PROFILER_EVENT_2(method_exception_leave, MethodExceptionLeave, MonoMethod *, method, MonoObject *, exception)
|
||||
MONO_PROFILER_EVENT_1(method_free, MethodFree, MonoMethod *, method)
|
||||
MONO_PROFILER_EVENT_1(method_begin_invoke, MethodBeginInvoke, MonoMethod *, method)
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
#ifndef __MONO_PROFILER_PRIVATE_H__
|
||||
#define __MONO_PROFILER_PRIVATE_H__
|
||||
|
||||
#include <mono/metadata/class-internals.h>
|
||||
#define MONO_PROFILER_UNSTABLE_GC_ROOTS
|
||||
#include <mono/metadata/profiler.h>
|
||||
#include <mono/utils/mono-context.h>
|
||||
#include <mono/utils/mono-lazy-init.h>
|
||||
#include <mono/utils/mono-os-mutex.h>
|
||||
#include <mono/utils/mono-os-semaphore.h>
|
||||
|
||||
struct _MonoProfilerDesc {
|
||||
MonoProfilerHandle next;
|
||||
MonoProfiler *prof;
|
||||
volatile gpointer cleanup_callback;
|
||||
volatile gpointer coverage_filter;
|
||||
volatile gpointer call_instrumentation_filter;
|
||||
|
||||
@@ -46,7 +47,7 @@ typedef struct {
|
||||
|
||||
MonoProfilerHandle profilers;
|
||||
|
||||
mono_lazy_init_t coverage_status;
|
||||
gboolean code_coverage;
|
||||
mono_mutex_t coverage_mutex;
|
||||
GHashTable *coverage_hash;
|
||||
|
||||
@@ -106,7 +107,6 @@ mono_profiler_installed (void)
|
||||
}
|
||||
|
||||
MonoProfilerCoverageInfo *mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries);
|
||||
void mono_profiler_coverage_free (MonoMethod *method);
|
||||
|
||||
struct _MonoProfilerCallContext {
|
||||
/*
|
||||
@@ -139,7 +139,7 @@ mono_profiler_allocations_enabled (void)
|
||||
}
|
||||
|
||||
#define _MONO_PROFILER_EVENT(name, ...) \
|
||||
void mono_profiler_raise_ ## name (__VA_ARGS__);
|
||||
ICALL_DECL_EXPORT void mono_profiler_raise_ ## name (__VA_ARGS__);
|
||||
#define MONO_PROFILER_EVENT_0(name, type) \
|
||||
_MONO_PROFILER_EVENT(name, void)
|
||||
#define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \
|
||||
|
||||
+56
-29
@@ -157,23 +157,31 @@ mono_profiler_create (MonoProfiler *prof)
|
||||
return handle;
|
||||
}
|
||||
|
||||
void
|
||||
mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb)
|
||||
{
|
||||
InterlockedWritePointer (&handle->cleanup_callback, (gpointer) cb);
|
||||
}
|
||||
|
||||
void
|
||||
mono_profiler_set_coverage_filter_callback (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb)
|
||||
{
|
||||
InterlockedWritePointer (&handle->coverage_filter, (gpointer) cb);
|
||||
}
|
||||
|
||||
static void
|
||||
initialize_coverage (void)
|
||||
mono_bool
|
||||
mono_profiler_enable_coverage (void)
|
||||
{
|
||||
if (mono_profiler_state.startup_done)
|
||||
return FALSE;
|
||||
|
||||
mono_os_mutex_init (&mono_profiler_state.coverage_mutex);
|
||||
mono_profiler_state.coverage_hash = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
lazy_initialize_coverage (void)
|
||||
{
|
||||
mono_lazy_initialize (&mono_profiler_state.coverage_status, initialize_coverage);
|
||||
if (!mono_debug_enabled ())
|
||||
mono_debug_init (MONO_DEBUG_FORMAT_MONO);
|
||||
|
||||
return mono_profiler_state.code_coverage = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -188,10 +196,11 @@ coverage_unlock (void)
|
||||
mono_os_mutex_unlock (&mono_profiler_state.coverage_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
mono_bool
|
||||
mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb)
|
||||
{
|
||||
lazy_initialize_coverage ();
|
||||
if (!mono_profiler_state.code_coverage)
|
||||
return FALSE;
|
||||
|
||||
coverage_lock ();
|
||||
|
||||
@@ -200,7 +209,7 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
|
||||
coverage_unlock ();
|
||||
|
||||
if (!info)
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
MonoError error;
|
||||
MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
|
||||
@@ -209,7 +218,7 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
|
||||
guint32 size;
|
||||
|
||||
const unsigned char *start = mono_method_header_get_code (header, &size, NULL);
|
||||
const unsigned char *end = start - size;
|
||||
const unsigned char *end = start + size;
|
||||
MonoDebugMethodInfo *minfo = mono_debug_lookup_method (method);
|
||||
|
||||
for (guint32 i = 0; i < info->entries; i++) {
|
||||
@@ -245,12 +254,15 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
|
||||
}
|
||||
|
||||
mono_metadata_free_mh (header);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
MonoProfilerCoverageInfo *
|
||||
mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries)
|
||||
{
|
||||
lazy_initialize_coverage ();
|
||||
if (!mono_profiler_state.code_coverage)
|
||||
return FALSE;
|
||||
|
||||
gboolean cover = FALSE;
|
||||
|
||||
@@ -277,23 +289,6 @@ mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries)
|
||||
return info;
|
||||
}
|
||||
|
||||
void
|
||||
mono_profiler_coverage_free (MonoMethod *method)
|
||||
{
|
||||
lazy_initialize_coverage ();
|
||||
|
||||
coverage_lock ();
|
||||
|
||||
MonoProfilerCoverageInfo *info = g_hash_table_lookup (mono_profiler_state.coverage_hash, method);
|
||||
|
||||
if (info) {
|
||||
g_hash_table_remove (mono_profiler_state.coverage_hash, method);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
coverage_unlock ();
|
||||
}
|
||||
|
||||
mono_bool
|
||||
mono_profiler_enable_sampling (MonoProfilerHandle handle)
|
||||
{
|
||||
@@ -489,6 +484,38 @@ mono_profiler_cleanup (void)
|
||||
#undef MONO_PROFILER_EVENT_3
|
||||
#undef MONO_PROFILER_EVENT_4
|
||||
#undef _MONO_PROFILER_EVENT
|
||||
|
||||
MonoProfilerHandle head = mono_profiler_state.profilers;
|
||||
|
||||
while (head) {
|
||||
MonoProfilerCleanupCallback cb = head->cleanup_callback;
|
||||
|
||||
if (cb)
|
||||
cb (head->prof);
|
||||
|
||||
MonoProfilerHandle cur = head;
|
||||
head = head->next;
|
||||
|
||||
g_free (cur);
|
||||
}
|
||||
|
||||
if (mono_profiler_state.code_coverage) {
|
||||
mono_os_mutex_destroy (&mono_profiler_state.coverage_mutex);
|
||||
|
||||
GHashTableIter iter;
|
||||
|
||||
g_hash_table_iter_init (&iter, mono_profiler_state.coverage_hash);
|
||||
|
||||
MonoProfilerCoverageInfo *info;
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &info))
|
||||
g_free (info);
|
||||
|
||||
g_hash_table_destroy (mono_profiler_state.coverage_hash);
|
||||
}
|
||||
|
||||
if (mono_profiler_state.sampling_owner)
|
||||
mono_os_sem_destroy (&mono_profiler_state.sampling_semaphore);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+48
-12
@@ -42,7 +42,9 @@ typedef struct _MonoProfilerDesc *MonoProfilerHandle;
|
||||
|
||||
/*
|
||||
* Installs a profiler and returns a handle for it. The handle is used with the
|
||||
* other functions in the profiler API (e.g. for setting up callbacks).
|
||||
* other functions in the profiler API (e.g. for setting up callbacks). The
|
||||
* given structure pointer will be passed to all callbacks from the profiler
|
||||
* API. It can be NULL.
|
||||
*
|
||||
* This function may only be called from your profiler's init function.
|
||||
*
|
||||
@@ -61,6 +63,31 @@ typedef struct _MonoProfilerDesc *MonoProfilerHandle;
|
||||
*/
|
||||
MONO_API MonoProfilerHandle mono_profiler_create (MonoProfiler *prof);
|
||||
|
||||
typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof);
|
||||
|
||||
/*
|
||||
* Sets a profiler cleanup function. This function will be invoked at shutdown
|
||||
* when the profiler API is cleaning up its internal structures. It's mainly
|
||||
* intended for a profiler to free the structure pointer that was passed to
|
||||
* mono_profiler_create, if necessary.
|
||||
*
|
||||
* This function is async safe.
|
||||
*/
|
||||
MONO_API void mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb);
|
||||
|
||||
/*
|
||||
* Enables support for code coverage instrumentation. At the moment, this means
|
||||
* enabling the debug info subsystem. If you do not call this function, you
|
||||
* will not be able to use mono_profiler_get_coverage_data. Returns TRUE if
|
||||
* code coverage support was enabled, or FALSE if the function was called too
|
||||
* late for this to be possible.
|
||||
*
|
||||
* This function may only be called from your profiler's init function.
|
||||
*
|
||||
* This function is not async safe.
|
||||
*/
|
||||
MONO_API mono_bool mono_profiler_enable_coverage (void);
|
||||
|
||||
typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method);
|
||||
|
||||
/*
|
||||
@@ -91,11 +118,16 @@ typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProf
|
||||
|
||||
/*
|
||||
* Retrieves all coverage data for the specified method and invokes the given
|
||||
* callback for each entry.
|
||||
* callback for each entry. Source location information will only be filled out
|
||||
* if the given method has debug info available. Returns TRUE if the given
|
||||
* method was instrumented for code coverage; otherwise, FALSE.
|
||||
*
|
||||
* Please note that the structure passed to the callback is only valid for the
|
||||
* duration of the callback.
|
||||
*
|
||||
* This function is not async safe.
|
||||
*/
|
||||
MONO_API void mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
|
||||
MONO_API mono_bool mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
|
||||
|
||||
typedef enum {
|
||||
/*
|
||||
@@ -167,15 +199,19 @@ MONO_API mono_bool mono_profiler_enable_allocations (void);
|
||||
|
||||
typedef enum {
|
||||
/* Do not instrument calls. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 1 << 0,
|
||||
/* Instrument method prologues. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE = 1 << 1,
|
||||
/* Also capture a call context for prologues. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE_CONTEXT = 1 << 2,
|
||||
/* Instrument method epilogues. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE = 1 << 3,
|
||||
/* Also capture a call context for epilogues. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE_CONTEXT = 1 << 4,
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0,
|
||||
/* Instrument method entries. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1,
|
||||
/* Also capture a call context for method entries. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2,
|
||||
/* Instrument method exits. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3,
|
||||
/* Also capture a call context for method exits. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4,
|
||||
/* Instrument method exits as a result of a tail call. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5,
|
||||
/* Instrument exceptional method exits. */
|
||||
MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6,
|
||||
} MonoProfilerCallInstrumentationFlags;
|
||||
|
||||
typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method);
|
||||
|
||||
@@ -398,6 +398,7 @@ get_array_fill_vtable (void)
|
||||
klass.rank = 1;
|
||||
klass.instance_size = MONO_SIZEOF_MONO_ARRAY;
|
||||
klass.sizes.element_size = 1;
|
||||
klass.size_inited = 1;
|
||||
klass.name = "array_filler_type";
|
||||
|
||||
vtable->klass = &klass;
|
||||
|
||||
+48
-13
@@ -740,7 +740,7 @@ is_field_on_inst (MonoClassField *field)
|
||||
|
||||
#ifndef DISABLE_REFLECTION_EMIT
|
||||
static guint32
|
||||
mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, MonoClassField *field)
|
||||
mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoClassField *field)
|
||||
{
|
||||
MonoType *type;
|
||||
guint32 token;
|
||||
@@ -748,7 +748,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
|
||||
g_assert (field);
|
||||
g_assert (field->parent);
|
||||
|
||||
token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, MONO_HANDLE_RAW (f)));
|
||||
token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, field));
|
||||
if (token)
|
||||
return token;
|
||||
|
||||
@@ -761,7 +761,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
|
||||
token = mono_image_get_memberref_token (assembly, &field->parent->byval_arg,
|
||||
mono_field_get_name (field),
|
||||
mono_dynimage_encode_fieldref_signature (assembly, field->parent->image, type));
|
||||
mono_g_hash_table_insert (assembly->handleref_managed, MONO_HANDLE_RAW (f), GUINT_TO_POINTER(token));
|
||||
g_hash_table_insert (assembly->handleref, field, GUINT_TO_POINTER(token));
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -1115,17 +1115,20 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
gboolean create_open_instance, gboolean register_token,
|
||||
MonoError *error)
|
||||
{
|
||||
HANDLE_FUNCTION_ENTER ();
|
||||
guint32 token = 0;
|
||||
|
||||
error_init (error);
|
||||
|
||||
MonoClass *klass = mono_handle_class (obj);
|
||||
MonoObjectHandle register_obj = MONO_HANDLE_NEW (MonoObject, NULL);
|
||||
MONO_HANDLE_ASSIGN (register_obj, obj);
|
||||
|
||||
/* Check for user defined reflection objects */
|
||||
/* TypeDelegator is the only corlib type which doesn't look like a MonoReflectionType */
|
||||
if (klass->image != mono_defaults.corlib || (strcmp (klass->name, "TypeDelegator") == 0)) {
|
||||
mono_error_set_not_supported (error, "User defined subclasses of System.Type are not yet supported");
|
||||
return 0;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
/* This function is called from ModuleBuilder:getToken multiple times for the same objects */
|
||||
@@ -1133,7 +1136,8 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
|
||||
if (strcmp (klass->name, "RuntimeType") == 0) {
|
||||
MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
|
||||
return_val_if_nok (error, 0);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MonoClass *mc = mono_class_from_mono_type (type);
|
||||
token = mono_metadata_token_from_dor (
|
||||
mono_dynimage_encode_typedef_or_ref_full (assembly, type, !mono_class_is_gtd (mc) || create_open_instance));
|
||||
@@ -1170,7 +1174,21 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
}
|
||||
} else {
|
||||
token = mono_image_get_methodref_token (assembly, method, create_open_instance);
|
||||
guint32 methodref_token = mono_image_get_methodref_token (assembly, method, create_open_instance);
|
||||
/* We need to register a 'canonical' object. The same
|
||||
* MonoMethod could have been reflected via different
|
||||
* classes so the MonoReflectionMethod:reftype could be
|
||||
* different, and the object lookup in
|
||||
* dynamic_image_register_token would assert assert. So
|
||||
* we pick the MonoReflectionMethod object that has the
|
||||
* reflected type as NULL (ie, take the declaring type
|
||||
* of the method) */
|
||||
MonoReflectionMethodHandle canonical_obj =
|
||||
mono_method_get_object_handle (MONO_HANDLE_DOMAIN (obj), method, NULL, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
|
||||
token = methodref_token;
|
||||
}
|
||||
/*g_print ("got token 0x%08x for %s\n", token, m->method->name);*/
|
||||
} else if (strcmp (klass->name, "MonoField") == 0) {
|
||||
@@ -1182,25 +1200,42 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
token = MONO_TOKEN_FIELD_DEF | field_table_idx;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else {
|
||||
token = mono_image_get_fieldref_token (assembly, obj, field);
|
||||
guint32 fieldref_token = mono_image_get_fieldref_token (assembly, field);
|
||||
/* Same as methodref: get a canonical object to
|
||||
* register with the token. */
|
||||
MonoReflectionFieldHandle canonical_obj =
|
||||
mono_field_get_object_handle (MONO_HANDLE_DOMAIN (obj), field->parent, field, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
|
||||
token = fieldref_token;
|
||||
}
|
||||
/*g_print ("got token 0x%08x for %s\n", token, f->field->name);*/
|
||||
} else if (strcmp (klass->name, "MonoArrayMethod") == 0) {
|
||||
MonoReflectionArrayMethodHandle m = MONO_HANDLE_CAST (MonoReflectionArrayMethod, obj);
|
||||
token = mono_image_get_array_token (assembly, m, error);
|
||||
return_val_if_nok (error, 0);
|
||||
/* always returns a fresh token */
|
||||
guint32 array_token = mono_image_get_array_token (assembly, m, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
token = array_token;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else if (strcmp (klass->name, "SignatureHelper") == 0) {
|
||||
MonoReflectionSigHelperHandle s = MONO_HANDLE_CAST (MonoReflectionSigHelper, obj);
|
||||
token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
|
||||
return_val_if_nok (error, 0);
|
||||
/* always returns a fresh token */
|
||||
guint32 sig_token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
token = sig_token;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else {
|
||||
g_error ("requested token for %s\n", klass->name);
|
||||
}
|
||||
|
||||
if (register_token)
|
||||
mono_dynamic_image_register_token (assembly, token, obj, how_collide);
|
||||
mono_dynamic_image_register_token (assembly, token, register_obj, how_collide);
|
||||
|
||||
return token;
|
||||
leave:
|
||||
HANDLE_FUNCTION_RETURN_VAL (token);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ worker_park (void)
|
||||
gboolean timeout = FALSE;
|
||||
gboolean interrupted = FALSE;
|
||||
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker parking",
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker parking",
|
||||
GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
|
||||
|
||||
mono_coop_mutex_lock (&worker.parked_threads_lock);
|
||||
@@ -431,7 +431,7 @@ done:
|
||||
|
||||
mono_coop_mutex_unlock (&worker.parked_threads_lock);
|
||||
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
|
||||
GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), timeout ? "yes" : "no", interrupted ? "yes" : "no");
|
||||
|
||||
return timeout;
|
||||
@@ -464,7 +464,7 @@ worker_thread (gpointer unused)
|
||||
MonoInternalThread *thread;
|
||||
ThreadPoolWorkerCounter counter;
|
||||
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker starting",
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker starting",
|
||||
GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
|
||||
|
||||
if (!mono_refcount_tryinc (&worker))
|
||||
@@ -502,7 +502,7 @@ worker_thread (gpointer unused)
|
||||
counter._.working --;
|
||||
});
|
||||
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing",
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker finishing",
|
||||
GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())));
|
||||
|
||||
mono_refcount_dec (&worker);
|
||||
|
||||
@@ -462,8 +462,8 @@ typedef union {
|
||||
#define SPECIAL_STATIC_OFFSET_TYPE_THREAD 0
|
||||
#define SPECIAL_STATIC_OFFSET_TYPE_CONTEXT 1
|
||||
|
||||
#define MAKE_SPECIAL_STATIC_OFFSET(index, offset, type) \
|
||||
((SpecialStaticOffset) { .fields = { (index), (offset), (type) } }.raw)
|
||||
#define MAKE_SPECIAL_STATIC_OFFSET(idx, off, ty) \
|
||||
((SpecialStaticOffset) { .fields = { .index = (idx), .offset = (off), .type = (ty) } }.raw)
|
||||
#define ACCESS_SPECIAL_STATIC_OFFSET(x,f) \
|
||||
(((SpecialStaticOffset *) &(x))->fields.f)
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@ mono_w32error_unix_to_win32 (guint32 error)
|
||||
case EINTR: return ERROR_IO_PENDING; /* best match I could find */
|
||||
case EPIPE: return ERROR_WRITE_FAULT;
|
||||
case ELOOP: return ERROR_CANT_RESOLVE_FILENAME;
|
||||
#ifdef ENODEV
|
||||
case ENODEV: return ERROR_DEV_NOT_EXIST;
|
||||
#endif
|
||||
|
||||
default:
|
||||
g_error ("%s: unknown error (%d) \"%s\"", __FILE__, error, g_strerror (error));
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define ERROR_LOCK_VIOLATION 33
|
||||
#define ERROR_HANDLE_DISK_FULL 39
|
||||
#define ERROR_NOT_SUPPORTED 50
|
||||
#define ERROR_DEV_NOT_EXIST 55
|
||||
#define ERROR_FILE_EXISTS 80
|
||||
#define ERROR_CANNOT_MAKE 82
|
||||
#define ERROR_INVALID_PARAMETER 87
|
||||
|
||||
@@ -1347,8 +1347,13 @@ mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waital
|
||||
signalled = (waitall && count == nhandles) || (!waitall && count > 0);
|
||||
|
||||
if (signalled) {
|
||||
for (i = 0; i < nhandles; i++)
|
||||
own_if_signalled (handles [i], &abandoned [i]);
|
||||
for (i = 0; i < nhandles; i++) {
|
||||
if (own_if_signalled (handles [i], &abandoned [i]) && !waitall) {
|
||||
/* if we are calling WaitHandle.WaitAny, .NET only owns the first one; it matters for Mutex which
|
||||
* throw AbandonedMutexException in case we owned it but didn't release it */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mono_w32handle_unlock_handles (handles, nhandles);
|
||||
|
||||
@@ -2580,8 +2580,8 @@ ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64
|
||||
&start_ticks, &user_ticks, &kernel_ticks);
|
||||
|
||||
ticks_to_processtime (start_ticks, creation_processtime);
|
||||
ticks_to_processtime (user_ticks, kernel_processtime);
|
||||
ticks_to_processtime (kernel_ticks, user_processtime);
|
||||
ticks_to_processtime (kernel_ticks, kernel_processtime);
|
||||
ticks_to_processtime (user_ticks, user_processtime);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "w32handle.h"
|
||||
#include "utils/mono-logger-internals.h"
|
||||
#include "utils/mono-poll.h"
|
||||
#include "utils/mono-compiler.h"
|
||||
|
||||
typedef struct {
|
||||
int domain;
|
||||
|
||||
@@ -99,8 +99,8 @@ long_min_un: dest:i src1:i src2:i len:16 clob:1
|
||||
long_max: dest:i src1:i src2:i len:16 clob:1
|
||||
long_max_un: dest:i src1:i src2:i len:16 clob:1
|
||||
|
||||
throw: src1:i len:18
|
||||
rethrow: src1:i len:18
|
||||
throw: src1:i len:24
|
||||
rethrow: src1:i len:24
|
||||
start_handler: len:16
|
||||
endfinally: len:9
|
||||
endfilter: src1:a len:9
|
||||
|
||||
@@ -2896,4 +2896,71 @@ END:
|
||||
IL_0018: ldloc.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method private hidebysig static void fail_inline() cil managed
|
||||
{
|
||||
// Code size 9 (0x9)
|
||||
.maxstack 8
|
||||
IL_0000: ldc.i4.s 16
|
||||
IL_0002: conv.u
|
||||
IL_0003: ldc.i4.1
|
||||
IL_0004: mul.ovf.un
|
||||
IL_0005: localloc
|
||||
IL_0007: pop
|
||||
IL_0008: ret
|
||||
}
|
||||
|
||||
.method private hidebysig static int32
|
||||
always_inline(int32 op) cil managed aggressiveinlining
|
||||
{
|
||||
// Code size 24 (0x18)
|
||||
.maxstack 8
|
||||
IL_0000: ldarg.0
|
||||
IL_0001: brfalse.s IL_0009
|
||||
|
||||
IL_0003: ldarg.0
|
||||
IL_0004: ldc.i4.2
|
||||
IL_0005: beq.s IL_000b
|
||||
|
||||
IL_0007: br.s IL_000d
|
||||
|
||||
IL_0009: ldc.i4.0
|
||||
IL_000a: ret
|
||||
|
||||
IL_000b: ldc.i4.3
|
||||
IL_000c: ret
|
||||
|
||||
IL_000d: call void Tests::fail_inline()
|
||||
IL_0012: newobj instance void [mscorlib]System.Exception::.ctor()
|
||||
IL_0017: throw
|
||||
}
|
||||
|
||||
.method public hidebysig static int32 test_3_regress_59608() cil managed
|
||||
{
|
||||
.maxstack 8
|
||||
IL_0000: ldc.i4.2
|
||||
IL_0001: call int32 Tests::always_inline(int32)
|
||||
IL_000c: ret
|
||||
}
|
||||
|
||||
.method public static bool llvm_regress_59436 () {
|
||||
// Code size 41 (0x29)
|
||||
.maxstack 3
|
||||
.locals init (float64 V_0,
|
||||
float64 V_1,
|
||||
valuetype [mscorlib]System.Decimal V_2)
|
||||
IL_0000: ldc.r8 1
|
||||
IL_0009: stloc.0
|
||||
IL_000a: ldc.r8 2
|
||||
IL_0013: stloc.1
|
||||
IL_0014: ldloc.0
|
||||
IL_0015: newobj instance void [mscorlib]System.Decimal::.ctor(float64)
|
||||
IL_001a: ldloca.s V_2
|
||||
IL_001c: ldloc.1
|
||||
IL_001d: call instance void [mscorlib]System.Decimal::.ctor(float64)
|
||||
IL_0022: ldloc.2
|
||||
IL_0023: call bool [mscorlib]System.Decimal::op_LessThanOrEqual(valuetype [mscorlib]System.Decimal,
|
||||
valuetype [mscorlib]System.Decimal)
|
||||
IL_0028: ret
|
||||
}
|
||||
}
|
||||
+28
-25
@@ -2436,6 +2436,10 @@ ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsign
|
||||
}
|
||||
MINT_IN_CASE(MINT_JMP) {
|
||||
InterpMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
|
||||
|
||||
if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL)
|
||||
MONO_PROFILER_RAISE (method_tail_call, (frame->imethod->method, new_method->method));
|
||||
|
||||
if (!new_method->transformed) {
|
||||
frame->ip = ip;
|
||||
frame->ex = mono_interp_transform_method (new_method, context);
|
||||
@@ -4769,7 +4773,7 @@ array_constructed:
|
||||
if (MONO_PROFILER_ENABLED (method_enter)) {
|
||||
MonoProfilerCallContext *prof_ctx = NULL;
|
||||
|
||||
if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE_CONTEXT) {
|
||||
if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT) {
|
||||
prof_ctx = g_new0 (MonoProfilerCallContext, 1);
|
||||
prof_ctx->interp_frame = frame;
|
||||
prof_ctx->method = frame->imethod->method;
|
||||
@@ -5140,35 +5144,34 @@ die_on_ex:
|
||||
}
|
||||
exit_frame:
|
||||
|
||||
if (!frame->ex) {
|
||||
if (MONO_PROFILER_ENABLED (method_leave) && frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE) {
|
||||
MonoProfilerCallContext *prof_ctx = NULL;
|
||||
if (!frame->ex && MONO_PROFILER_ENABLED (method_leave) &&
|
||||
frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE) {
|
||||
MonoProfilerCallContext *prof_ctx = NULL;
|
||||
|
||||
if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE_CONTEXT) {
|
||||
prof_ctx = g_new0 (MonoProfilerCallContext, 1);
|
||||
prof_ctx->interp_frame = frame;
|
||||
prof_ctx->method = frame->imethod->method;
|
||||
if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT) {
|
||||
prof_ctx = g_new0 (MonoProfilerCallContext, 1);
|
||||
prof_ctx->interp_frame = frame;
|
||||
prof_ctx->method = frame->imethod->method;
|
||||
|
||||
MonoType *rtype = mono_method_signature (frame->imethod->method)->ret;
|
||||
MonoType *rtype = mono_method_signature (frame->imethod->method)->ret;
|
||||
|
||||
switch (rtype->type) {
|
||||
case MONO_TYPE_VOID:
|
||||
break;
|
||||
case MONO_TYPE_VALUETYPE:
|
||||
prof_ctx->return_value = frame->retval->data.p;
|
||||
break;
|
||||
default:
|
||||
prof_ctx->return_value = frame->retval;
|
||||
break;
|
||||
}
|
||||
switch (rtype->type) {
|
||||
case MONO_TYPE_VOID:
|
||||
break;
|
||||
case MONO_TYPE_VALUETYPE:
|
||||
prof_ctx->return_value = frame->retval->data.p;
|
||||
break;
|
||||
default:
|
||||
prof_ctx->return_value = frame->retval;
|
||||
break;
|
||||
}
|
||||
|
||||
MONO_PROFILER_RAISE (method_leave, (frame->imethod->method, prof_ctx));
|
||||
|
||||
g_free (prof_ctx);
|
||||
}
|
||||
} else
|
||||
MONO_PROFILER_RAISE (method_exception_leave, (frame->imethod->method, (MonoObject *) frame->ex));
|
||||
|
||||
MONO_PROFILER_RAISE (method_leave, (frame->imethod->method, prof_ctx));
|
||||
|
||||
g_free (prof_ctx);
|
||||
} else if (frame->ex && frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE)
|
||||
MONO_PROFILER_RAISE (method_exception_leave, (frame->imethod->method, &frame->ex->object));
|
||||
|
||||
DEBUG_LEAVE ();
|
||||
}
|
||||
|
||||
@@ -1514,7 +1514,7 @@ generate (MonoMethod *method, InterpMethod *rtm, unsigned char *is_bb_start, Mon
|
||||
}
|
||||
}
|
||||
|
||||
if (rtm->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE)
|
||||
if (rtm->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ENTER)
|
||||
ADD_CODE (td, MINT_PROF_ENTER);
|
||||
|
||||
if (sym_seq_points) {
|
||||
@@ -3753,6 +3753,7 @@ generate (MonoMethod *method, InterpMethod *rtm, unsigned char *is_bb_start, Mon
|
||||
case CEE_TAIL_:
|
||||
++td->ip;
|
||||
/* FIX: should do something? */;
|
||||
// TODO: This should raise a method_tail_call profiler event.
|
||||
break;
|
||||
case CEE_INITOBJ:
|
||||
CHECK_STACK(td, 1);
|
||||
|
||||
+19
-13
@@ -2217,7 +2217,7 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_
|
||||
|
||||
inline static MonoCallInst *
|
||||
mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
|
||||
MonoInst **args, int calli, int virtual_, int tail, int rgctx, int unbox_trampoline)
|
||||
MonoInst **args, int calli, int virtual_, int tail, int rgctx, int unbox_trampoline, MonoMethod *target)
|
||||
{
|
||||
MonoType *sig_ret;
|
||||
MonoCallInst *call;
|
||||
@@ -2229,7 +2229,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
|
||||
tail = FALSE;
|
||||
|
||||
if (tail) {
|
||||
mini_profiler_emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE, NULL, NULL);
|
||||
mini_profiler_emit_tail_call (cfg, target);
|
||||
|
||||
MONO_INST_NEW_CALL (cfg, call, OP_TAILCALL);
|
||||
} else
|
||||
@@ -2362,7 +2362,7 @@ mini_emit_calli (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **args, Mo
|
||||
MONO_ADD_INS (cfg->cbb, ins);
|
||||
}
|
||||
|
||||
call = mono_emit_call_args (cfg, sig, args, TRUE, FALSE, FALSE, rgctx_arg ? TRUE : FALSE, FALSE);
|
||||
call = mono_emit_call_args (cfg, sig, args, TRUE, FALSE, FALSE, rgctx_arg ? TRUE : FALSE, FALSE, NULL);
|
||||
|
||||
call->inst.sreg1 = addr->dreg;
|
||||
|
||||
@@ -2456,7 +2456,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
|
||||
|
||||
need_unbox_trampoline = method->klass == mono_defaults.object_class || mono_class_is_interface (method->klass);
|
||||
|
||||
call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline);
|
||||
call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline, method);
|
||||
|
||||
#ifndef DISABLE_REMOTING
|
||||
if (might_be_remote)
|
||||
@@ -2586,7 +2586,7 @@ mono_emit_native_call (MonoCompile *cfg, gconstpointer func, MonoMethodSignature
|
||||
|
||||
g_assert (sig);
|
||||
|
||||
call = mono_emit_call_args (cfg, sig, args, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
call = mono_emit_call_args (cfg, sig, args, FALSE, FALSE, FALSE, FALSE, FALSE, NULL);
|
||||
call->fptr = func;
|
||||
|
||||
MONO_ADD_INS (cfg->cbb, (MonoInst*)call);
|
||||
@@ -6141,9 +6141,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
|
||||
prev_args = cfg->args;
|
||||
prev_arg_types = cfg->arg_types;
|
||||
prev_inlined_method = cfg->inlined_method;
|
||||
cfg->inlined_method = cmethod;
|
||||
cfg->ret_var_set = FALSE;
|
||||
cfg->inline_depth ++;
|
||||
prev_ret_var_set = cfg->ret_var_set;
|
||||
prev_real_offset = cfg->real_offset;
|
||||
prev_cbb_hash = cfg->cbb_hash;
|
||||
prev_cil_offset_to_bb = cfg->cil_offset_to_bb;
|
||||
@@ -6153,9 +6151,12 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
|
||||
prev_cbb = cfg->cbb;
|
||||
prev_current_method = cfg->current_method;
|
||||
prev_generic_context = cfg->generic_context;
|
||||
prev_ret_var_set = cfg->ret_var_set;
|
||||
prev_disable_inline = cfg->disable_inline;
|
||||
|
||||
cfg->inlined_method = cmethod;
|
||||
cfg->ret_var_set = FALSE;
|
||||
cfg->inline_depth ++;
|
||||
|
||||
if (ip && *ip == CEE_CALLVIRT && !(cmethod->flags & METHOD_ATTRIBUTE_STATIC))
|
||||
virtual_ = TRUE;
|
||||
|
||||
@@ -8030,7 +8031,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
if (cfg->gshared && mono_method_check_context_used (cmethod))
|
||||
GENERIC_SHARING_FAILURE (CEE_JMP);
|
||||
|
||||
mini_profiler_emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE, NULL, NULL);
|
||||
mini_profiler_emit_tail_call (cfg, cmethod);
|
||||
|
||||
fsig = mono_method_signature (cmethod);
|
||||
n = fsig->param_count + fsig->hasthis;
|
||||
@@ -8760,6 +8761,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
}
|
||||
for (i = 0; i < n; ++i)
|
||||
EMIT_NEW_ARGSTORE (cfg, ins, i, sp [i]);
|
||||
|
||||
mini_profiler_emit_tail_call (cfg, cmethod);
|
||||
|
||||
MONO_INST_NEW (cfg, ins, OP_BR);
|
||||
MONO_ADD_INS (cfg->cbb, ins);
|
||||
tblock = start_bblock->out_bb [0];
|
||||
@@ -8972,7 +8976,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
/* Handle tail calls similarly to normal calls */
|
||||
tail_call = TRUE;
|
||||
} else {
|
||||
mini_profiler_emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE, NULL, NULL);
|
||||
mini_profiler_emit_tail_call (cfg, cmethod);
|
||||
|
||||
MONO_INST_NEW_CALL (cfg, call, OP_JMP);
|
||||
call->tail_call = TRUE;
|
||||
@@ -9083,7 +9087,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
break;
|
||||
}
|
||||
case CEE_RET:
|
||||
mini_profiler_emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE, sp - 1, sig->ret);
|
||||
mini_profiler_emit_leave (cfg, sig->ret->type != MONO_TYPE_VOID ? sp [-1] : NULL);
|
||||
|
||||
if (cfg->method != method) {
|
||||
/* return from inlined method */
|
||||
@@ -11694,6 +11698,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
if (sp != stack_start)
|
||||
UNVERIFIED;
|
||||
|
||||
mini_profiler_emit_leave (cfg, sp [0]);
|
||||
|
||||
MONO_INST_NEW (cfg, ins, OP_BR);
|
||||
ins->inst_target_bb = end_bblock;
|
||||
MONO_ADD_INS (cfg->cbb, ins);
|
||||
@@ -12635,7 +12641,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
}
|
||||
|
||||
cfg->cbb = init_localsbb;
|
||||
mini_profiler_emit_instrumentation_call (cfg, mono_profiler_raise_method_enter, TRUE, NULL, NULL);
|
||||
mini_profiler_emit_enter (cfg);
|
||||
|
||||
if (seq_points) {
|
||||
MonoBasicBlock *bb;
|
||||
|
||||
@@ -2869,6 +2869,11 @@ emit_call_body (MonoCompile *cfg, guint8 *code, MonoJumpInfoType patch_type, gco
|
||||
amd64_call_code (code, 0);
|
||||
}
|
||||
else {
|
||||
if (!no_patch && ((guint32)(code + 2 - cfg->native_code) % 8) != 0) {
|
||||
guint32 pad_size = 8 - ((guint32)(code + 2 - cfg->native_code) % 8);
|
||||
amd64_padding (code, pad_size);
|
||||
g_assert ((guint64)(code + 2 - cfg->native_code) % 8 == 0);
|
||||
}
|
||||
mono_add_patch_info (cfg, code - cfg->native_code, patch_type, data);
|
||||
amd64_set_reg_template (code, GP_SCRATCH_REG);
|
||||
amd64_call_reg (code, GP_SCRATCH_REG);
|
||||
|
||||
@@ -251,10 +251,13 @@ mono_exceptions_init (void)
|
||||
|
||||
cbs.mono_walk_stack_with_state = mono_walk_stack_with_state;
|
||||
|
||||
if (mono_llvm_only)
|
||||
if (mono_llvm_only) {
|
||||
cbs.mono_raise_exception = mono_llvm_raise_exception;
|
||||
else
|
||||
cbs.mono_reraise_exception = mono_llvm_reraise_exception;
|
||||
} else {
|
||||
cbs.mono_raise_exception = (void (*)(MonoException *))mono_get_throw_exception ();
|
||||
cbs.mono_reraise_exception = (void (*)(MonoException *))mono_get_rethrow_exception ();
|
||||
}
|
||||
cbs.mono_raise_exception_with_ctx = mono_raise_exception_with_ctx;
|
||||
cbs.mono_exception_walk_trace = mono_exception_walk_trace;
|
||||
cbs.mono_install_handler_block_guard = mono_install_handler_block_guard;
|
||||
@@ -2230,9 +2233,12 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
|
||||
}
|
||||
}
|
||||
|
||||
jit_tls->orig_ex_ctx_set = TRUE;
|
||||
MONO_PROFILER_RAISE (method_exception_leave, (method, ex_obj));
|
||||
jit_tls->orig_ex_ctx_set = FALSE;
|
||||
if (MONO_PROFILER_ENABLED (method_exception_leave) &&
|
||||
mono_profiler_get_call_instrumentation_flags (method) & MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE) {
|
||||
jit_tls->orig_ex_ctx_set = TRUE;
|
||||
MONO_PROFILER_RAISE (method_exception_leave, (method, ex_obj));
|
||||
jit_tls->orig_ex_ctx_set = FALSE;
|
||||
}
|
||||
|
||||
*ctx = new_ctx;
|
||||
}
|
||||
@@ -3236,6 +3242,12 @@ mono_llvm_raise_exception (MonoException *e)
|
||||
mono_llvm_throw_exception ((MonoObject*)e);
|
||||
}
|
||||
|
||||
void
|
||||
mono_llvm_reraise_exception (MonoException *e)
|
||||
{
|
||||
mono_llvm_rethrow_exception ((MonoObject*)e);
|
||||
}
|
||||
|
||||
void
|
||||
mono_llvm_throw_corlib_exception (guint32 ex_token_index)
|
||||
{
|
||||
|
||||
+22
-19
@@ -467,6 +467,9 @@ create_llvm_type_for_type (MonoLLVMModule *module, MonoClass *klass)
|
||||
static LLVMTypeRef
|
||||
type_to_llvm_type (EmitContext *ctx, MonoType *t)
|
||||
{
|
||||
if (t->byref)
|
||||
return ThisType ();
|
||||
|
||||
t = mini_get_underlying_type (t);
|
||||
|
||||
switch (t->type) {
|
||||
@@ -1226,10 +1229,10 @@ sig_to_llvm_sig_no_cinfo (EmitContext *ctx, MonoMethodSignature *sig)
|
||||
int i, pindex;
|
||||
MonoType *rtype;
|
||||
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
ret_type = type_to_llvm_type (ctx, rtype);
|
||||
ret_type = type_to_llvm_type (ctx, sig->ret);
|
||||
if (!ctx_ok (ctx))
|
||||
return NULL;
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
|
||||
param_types = g_new0 (LLVMTypeRef, (sig->param_count * 8) + 3);
|
||||
pindex = 0;
|
||||
@@ -1269,10 +1272,10 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
|
||||
if (!cinfo)
|
||||
return sig_to_llvm_sig_no_cinfo (ctx, sig);
|
||||
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
ret_type = type_to_llvm_type (ctx, rtype);
|
||||
ret_type = type_to_llvm_type (ctx, sig->ret);
|
||||
if (!ctx_ok (ctx))
|
||||
return NULL;
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
|
||||
switch (cinfo->ret.storage) {
|
||||
case LLVMArgVtypeInReg:
|
||||
@@ -4117,26 +4120,26 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
|
||||
}
|
||||
|
||||
/* Start a new bblock which CALL_HANDLER can branch to */
|
||||
target_bb = bblocks [bb->block_num].call_handler_target_bb;
|
||||
if (target_bb) {
|
||||
ctx->builder = builder = create_builder (ctx);
|
||||
LLVMPositionBuilderAtEnd (ctx->builder, target_bb);
|
||||
ctx->builder = builder = create_builder (ctx);
|
||||
LLVMPositionBuilderAtEnd (ctx->builder, target_bb);
|
||||
|
||||
ctx->bblocks [bb->block_num].end_bblock = target_bb;
|
||||
ctx->bblocks [bb->block_num].end_bblock = target_bb;
|
||||
|
||||
/* Store the exception into the IL level exvar */
|
||||
if (bb->in_scount == 1) {
|
||||
g_assert (bb->in_scount == 1);
|
||||
exvar = bb->in_stack [0];
|
||||
/* Store the exception into the IL level exvar */
|
||||
if (bb->in_scount == 1) {
|
||||
g_assert (bb->in_scount == 1);
|
||||
exvar = bb->in_stack [0];
|
||||
|
||||
// FIXME: This is shared with filter clauses ?
|
||||
g_assert (!values [exvar->dreg]);
|
||||
// FIXME: This is shared with filter clauses ?
|
||||
g_assert (!values [exvar->dreg]);
|
||||
|
||||
g_assert (ctx->ex_var);
|
||||
values [exvar->dreg] = LLVMBuildLoad (builder, ctx->ex_var, "");
|
||||
emit_volatile_store (ctx, exvar->dreg);
|
||||
}
|
||||
g_assert (ctx->ex_var);
|
||||
values [exvar->dreg] = LLVMBuildLoad (builder, ctx->ex_var, "");
|
||||
emit_volatile_store (ctx, exvar->dreg);
|
||||
}
|
||||
|
||||
/* Make normal branches to the start of the clause branch to the new bblock */
|
||||
bblocks [bb->block_num].bblock = target_bb;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+74
-37
@@ -15,20 +15,79 @@
|
||||
|
||||
#ifndef DISABLE_JIT
|
||||
|
||||
void
|
||||
mini_profiler_emit_instrumentation_call (MonoCompile *cfg, void *func, gboolean entry, MonoInst **ret, MonoType *rtype)
|
||||
static MonoInst *
|
||||
emit_fill_call_ctx (MonoCompile *cfg, MonoInst *method, MonoInst *ret)
|
||||
{
|
||||
gboolean instrument, capture;
|
||||
cfg->flags |= MONO_CFG_HAS_ALLOCA;
|
||||
|
||||
if (entry) {
|
||||
instrument = cfg->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE;
|
||||
capture = cfg->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE_CONTEXT;
|
||||
} else {
|
||||
instrument = cfg->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
|
||||
capture = cfg->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE_CONTEXT;
|
||||
MonoInst *alloc, *size, *fill_ctx;
|
||||
|
||||
EMIT_NEW_ICONST (cfg, size, sizeof (MonoProfilerCallContext));
|
||||
MONO_INST_NEW (cfg, alloc, OP_LOCALLOC);
|
||||
alloc->dreg = alloc_preg (cfg);
|
||||
alloc->sreg1 = size->dreg;
|
||||
alloc->flags |= MONO_INST_INIT;
|
||||
MONO_ADD_INS (cfg->cbb, alloc);
|
||||
MONO_INST_NEW (cfg, fill_ctx, OP_FILL_PROF_CALL_CTX);
|
||||
fill_ctx->sreg1 = alloc->dreg;
|
||||
MONO_ADD_INS (cfg->cbb, fill_ctx);
|
||||
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, alloc->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, method), method->dreg);
|
||||
|
||||
if (ret) {
|
||||
MonoInst *var = mono_compile_create_var (cfg, mono_method_signature (cfg->method)->ret, OP_LOCAL);
|
||||
|
||||
MonoInst *store, *addr;
|
||||
|
||||
EMIT_NEW_TEMPSTORE (cfg, store, var->inst_c0, ret);
|
||||
EMIT_NEW_VARLOADA (cfg, addr, var, NULL);
|
||||
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, alloc->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, return_value), addr->dreg);
|
||||
}
|
||||
|
||||
if (!instrument)
|
||||
return alloc;
|
||||
}
|
||||
|
||||
void
|
||||
mini_profiler_emit_enter (MonoCompile *cfg)
|
||||
{
|
||||
if (!MONO_CFG_PROFILE (cfg, ENTER) || cfg->current_method != cfg->method)
|
||||
return;
|
||||
|
||||
MonoInst *iargs [2];
|
||||
|
||||
EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
|
||||
|
||||
if (MONO_CFG_PROFILE (cfg, ENTER_CONTEXT) && !cfg->llvm_only)
|
||||
iargs [1] = emit_fill_call_ctx (cfg, iargs [0], NULL);
|
||||
else
|
||||
EMIT_NEW_PCONST (cfg, iargs [1], NULL);
|
||||
|
||||
/* void mono_profiler_raise_method_enter (MonoMethod *method, MonoProfilerCallContext *ctx) */
|
||||
mono_emit_jit_icall (cfg, mono_profiler_raise_method_enter, iargs);
|
||||
}
|
||||
|
||||
void
|
||||
mini_profiler_emit_leave (MonoCompile *cfg, MonoInst *ret)
|
||||
{
|
||||
if (!MONO_CFG_PROFILE (cfg, LEAVE) || cfg->current_method != cfg->method)
|
||||
return;
|
||||
|
||||
MonoInst *iargs [2];
|
||||
|
||||
EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
|
||||
|
||||
if (MONO_CFG_PROFILE (cfg, LEAVE_CONTEXT) && !cfg->llvm_only)
|
||||
iargs [1] = emit_fill_call_ctx (cfg, iargs [0], ret);
|
||||
else
|
||||
EMIT_NEW_PCONST (cfg, iargs [1], NULL);
|
||||
|
||||
/* void mono_profiler_raise_method_leave (MonoMethod *method, MonoProfilerCallContext *ctx) */
|
||||
mono_emit_jit_icall (cfg, mono_profiler_raise_method_leave, iargs);
|
||||
}
|
||||
|
||||
void
|
||||
mini_profiler_emit_tail_call (MonoCompile *cfg, MonoMethod *target)
|
||||
{
|
||||
if (!MONO_CFG_PROFILE (cfg, TAIL_CALL) || cfg->current_method != cfg->method)
|
||||
return;
|
||||
|
||||
g_assert (cfg->current_method == cfg->method);
|
||||
@@ -37,35 +96,13 @@ mini_profiler_emit_instrumentation_call (MonoCompile *cfg, void *func, gboolean
|
||||
|
||||
EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
|
||||
|
||||
if (capture && !cfg->llvm_only) {
|
||||
cfg->flags |= MONO_CFG_HAS_ALLOCA;
|
||||
|
||||
MonoInst *size, *fill_ctx;
|
||||
|
||||
EMIT_NEW_ICONST (cfg, size, sizeof (MonoProfilerCallContext));
|
||||
MONO_INST_NEW (cfg, iargs [1], OP_LOCALLOC);
|
||||
iargs [1]->dreg = alloc_preg (cfg);
|
||||
iargs [1]->sreg1 = size->dreg;
|
||||
iargs [1]->flags |= MONO_INST_INIT;
|
||||
MONO_ADD_INS (cfg->cbb, iargs [1]);
|
||||
MONO_INST_NEW (cfg, fill_ctx, OP_FILL_PROF_CALL_CTX);
|
||||
fill_ctx->sreg1 = iargs [1]->dreg;
|
||||
MONO_ADD_INS (cfg->cbb, fill_ctx);
|
||||
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, iargs [1]->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, method), iargs [0]->dreg);
|
||||
|
||||
if (rtype && rtype->type != MONO_TYPE_VOID) {
|
||||
MonoInst *var = mono_compile_create_var (cfg, rtype, OP_LOCAL);
|
||||
|
||||
MonoInst *store, *addr;
|
||||
|
||||
EMIT_NEW_TEMPSTORE (cfg, store, var->inst_c0, *ret);
|
||||
EMIT_NEW_VARLOADA (cfg, addr, var, NULL);
|
||||
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, iargs [1]->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, return_value), addr->dreg);
|
||||
}
|
||||
} else
|
||||
if (target)
|
||||
EMIT_NEW_METHODCONST (cfg, iargs [1], target);
|
||||
else
|
||||
EMIT_NEW_PCONST (cfg, iargs [1], NULL);
|
||||
|
||||
mono_emit_jit_icall (cfg, func, iargs);
|
||||
/* void mono_profiler_raise_method_tail_call (MonoMethod *method, MonoMethod *target) */
|
||||
mono_emit_jit_icall (cfg, mono_profiler_raise_method_tail_call, iargs);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4059,6 +4059,7 @@ register_icalls (void)
|
||||
*/
|
||||
register_icall (mono_profiler_raise_method_enter, "mono_profiler_raise_method_enter", "void ptr ptr", TRUE);
|
||||
register_icall (mono_profiler_raise_method_leave, "mono_profiler_raise_method_leave", "void ptr ptr", TRUE);
|
||||
register_icall (mono_profiler_raise_method_tail_call, "mono_profiler_raise_method_tail_call", "void ptr ptr", TRUE);
|
||||
|
||||
register_icall (mono_trace_enter_method, "mono_trace_enter_method", NULL, TRUE);
|
||||
register_icall (mono_trace_leave_method, "mono_trace_leave_method", NULL, TRUE);
|
||||
|
||||
@@ -567,6 +567,10 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTable *
|
||||
vtable_slot = mini_resolve_imt_method (vt, vtable_slot, imt_method, &impl_method, &addr, &need_rgctx_tramp, &variant_iface, error);
|
||||
return_val_if_nok (error, NULL);
|
||||
|
||||
/* We must handle magic interfaces on rank 1 arrays of ref types as if they were variant */
|
||||
if (!variant_iface && vt->klass->rank == 1 && !vt->klass->element_class->valuetype && imt_method->klass->is_array_special_interface)
|
||||
variant_iface = imt_method;
|
||||
|
||||
/* This is the vcall slot which gets called through the IMT trampoline */
|
||||
vtable_slot_to_patch = vtable_slot;
|
||||
|
||||
|
||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user