Automatic optimization bug bisector.
if ns == "":
return name
else:
- return "%s.%s".format (ns, name)
+ return "{}.{}".format (ns, name)
class ArrayPrinter:
"Print a C# array"
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
- return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
+ return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len (self.class_name) - 2]), int (length))
class ObjectPrinter:
"Print a C# object"
return (field.name, self.obj [field.name])
except:
# Superclass
- return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name))))
+ return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
- gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name))
+ gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
print (sys.exc_info ()[0])
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
- gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name))
+ gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
except:
# Maybe there is no debug info for that type
- return "%s.%s".format (class_ns, class_name)
+ return "{}.{}".format (class_ns, class_name)
#return obj.cast (gdb_type)
- return "%s.%s".format (class_ns, class_name)
+ return "{}.{}".format (class_ns, class_name)
return class_name
except:
print (sys.exc_info ()[0])
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
- return "\"%s:%s ()\"".format (class_name, val ["name"].string ())
+ return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
- #return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
+ #return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
- return "\"%s\"".format (class_name)
+ return "\"{}\"".format (class_name)
# This returns more info but requires calling into the inferior
- #return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
+ #return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def lookup_pretty_printer(val):
t = str (val.type)
new_size = os.stat ("xdb.s").st_size
if new_size > self.s_size:
sofile = "xdb.so"
- gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o".format (sofile))
+ gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o {} xdb.o".format (sofile))
# FIXME: This prints messages which couldn't be turned off
- gdb.execute ("add-symbol-file %s 0".format (sofile))
+ gdb.execute ("add-symbol-file {} 0".format (sofile))
self.s_size = new_size
class RunHook (gdb.Command):
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
exec_file = os.readlink (exec_file)
exec_dir = os.path.dirname (exec_file)
-gdb.execute ("source %s/%s-gdbinit".format (exec_dir, os.path.basename (exec_file)))
+gdb.execute ("source {}/{}-gdbinit".format (exec_dir, os.path.basename (exec_file)))
if ns == "":
return name
else:
- return "%s.%s".format (ns, name)
+ return "{}.{}".format (ns, name)
class ArrayPrinter:
"Print a C# array"
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
- return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
+ return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
class ObjectPrinter:
"Print a C# object"
return (field.name, self.obj [field.name])
except:
# Superclass
- return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name))))
+ return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
try:
- gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name))
+ gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
return {}.__iter__ ()
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
- gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name))
+ gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name))
except:
# Maybe there is no debug info for that type
- return "%s.%s".format (class_ns, class_name)
+ return "{}.{}".format (class_ns, class_name)
#return obj.cast (gdb_type)
- return "%s.%s".format (class_ns, class_name)
+ return "{}.{}".format (class_ns, class_name)
return class_name
except:
print (sys.exc_info ()[0])
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
- return "\"%s:%s ()\"".format (class_name, val ["name"].string ())
+ return "\"{}:{} ()\"".format (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
- #return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
+ #return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
if klass ["generic_class"].cast (gdb.lookup_type ("guint64")) != 0:
- class_name = "%s<%s>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"]))
+ class_name = "{}<{}>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"]))
if add_quotes:
- return "\"%s\"".format (class_name)
+ return "\"{}\"".format (class_name)
else:
return class_name
# This returns more info but requires calling into the inferior
- #return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
+ #return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def to_string(self):
try:
method_inst_str = ""
if int(method_inst.cast (gdb.lookup_type ("guint64"))) != 0:
method_inst_str = str(method_inst)
- return "%s, [%s], [%s]>".format (container_str, class_inst_str, method_inst_str)
+ return "{}, [{}], [{}]>".format (container_str, class_inst_str, method_inst_str)
def to_string(self):
try:
info = str(t ["data"]["generic_class"])
if info != "":
- return "{%s, %s}".format (kind, info)
+ return "{{}, {}}".format (kind, info)
else:
- return "{%s}".format (kind)
+ return "{{}}".format (kind)
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
if i > 0:
inst_str = inst_str + ", "
inst_str = inst_str + type_printer.to_string ()
- return "MRGCTX[%s, [%s]]".format (klass_printer.to_string(), inst_str)
+ return "MRGCTX[{}, [{}]]".format (klass_printer.to_string(), inst_str)
class MonoVTablePrinter:
"Print a MonoVTable structure"
klass = vtable ["klass"]
klass_printer = MonoClassPrinter (klass)
- return "vtable(%s)".format (klass_printer.to_string ())
+ return "vtable({})".format (klass_printer.to_string ())
def lookup_pretty_printer(val):
t = str (val.type)
-Subproject commit 8382c4605d622d56354e7340bf872caaf36b972a
+Subproject commit e12162bb0f1dfad191c58f913de7d5faf013b84b
.SH SYNOPSIS
.B al [option] [source-files]
.SH DESCRIPTION
-AL is the Mono assembly linkder.
+AL is the Mono assembly linker.
.PP
This linker is used to put together assemblies from a collection of
modules (.netmodule files), assembly manifest files and resources.
This instructs Mono to precompile code that has historically not been
precompiled with AOT.
.TP
+.I data-outfile=FILE.dll.aotdata
+.Sp
+This instructs the AOT code generator to output certain data
+constructs into a separate file. This can reduce the executable
+images some five to twenty percent. Developers need to then ship the
+resulting aotdata as a resource and register a hook to load the data
+on demand by using the
+.I mono_install_load_aot_data_hook
+method.
+.TP
.I direct-pinvoke
.Sp
When this option is specified, P/Invoke methods are invoked directly
llc compiler.
.TP
.I nimt-trampolines=[number]
-When compiling in full aot mode, the IMT trampolines must be precreated
+When compiling in full aot mthis data at startup
+usingode, the IMT trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
Defaults to 128.
.TP
NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
+NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
include ../../build/library.make
+$(the_lib): ../Mono.Security/Makefile
+
{
class DotNetSslStreamImpl : MSI.IMonoSslStream
{
+ DotNetTlsProvider provider;
SslStream impl;
internal SslStream Impl {
}
public DotNetSslStreamImpl (
- Stream innerStream, bool leaveInnerStreamOpen,
+ Stream innerStream, bool leaveInnerStreamOpen, DotNetTlsProvider provider,
RemoteCertificateValidationCallback userCertificateValidationCallback,
LocalCertificateSelectionCallback userCertificateSelectionCallback)
{
+ this.provider = provider;
impl = new SslStream (
innerStream, leaveInnerStreamOpen,
userCertificateValidationCallback,
get { return Impl.SslProtocol; }
}
+ MSI.MonoTlsProvider MSI.IMonoSslStream.Provider {
+ get { return provider; }
+ }
+
+ MSI.MonoTlsConnectionInfo MSI.IMonoSslStream.GetConnectionInfo ()
+ {
+ return null;
+ }
+
void CheckDisposed ()
{
if (impl == null)
get { return true; }
}
+ public override bool SupportsConnectionInfo {
+ get { return false; }
+ }
+
public override bool SupportsMonoExtensions {
get { return false; }
}
selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
}
- return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, validation_callback, selection_callback);
+ return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, this, validation_callback, selection_callback);
}
public override IMonoTlsContext CreateTlsContext (
include ../../build/library.make
+$(the_lib): ../Mono.Security/Makefile
include ../../build/library.make
+$(the_lib): ../Mono.Security/Makefile
+
get { return false; }
}
+ public override bool SupportsConnectionInfo {
+ get { return false; }
+ }
+
public override bool SupportsTlsContext {
get { return false; }
}
Stream innerStream, bool leaveInnerStreamOpen,
MonoTlsSettings settings = null)
{
- var impl = new MNS.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
- return new MNS.MonoSslStreamImpl (impl);
+ var impl = new MNS.Private.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
+ return new MNS.Private.MonoSslStreamImpl (impl);
}
public override IMonoTlsContext CreateTlsContext (
LIBRARY = Mono.Security.dll
LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
LIB_REFS = System
-LIB_MCS_FLAGS = -unsafe -nowarn:1030
+LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
include ../../build/library.make
#
# Update this comment to trigger a build in System
+# +1
#
namespace Mono.Security.Interface
{
- #if (!MONOTOUCH && !MONODROID) || INSIDE_SYSTEM
public class ValidationResult
{
bool trusted;
this.policy_errors = policy_errors;
}
- internal ValidationResult (bool trusted, bool user_defined, int error_code)
+ internal ValidationResult (bool trusted, bool user_denied, int error_code)
{
this.trusted = trusted;
this.user_denied = user_denied;
this.error_code = error_code;
- this.policy_errors = policy_errors;
}
public bool Trusted {
return GetDefaultValidator (null, settings);
}
}
-#endif
}
SSA.SslProtocols SslProtocol {
get;
}
+
+ MonoTlsProvider Provider {
+ get;
+ }
+
+
+ MonoTlsConnectionInfo GetConnectionInfo ();
}
}
get;
}
+ /*
+ * Does this provider support IMonoSslStream.GetConnectionInfo() ?
+ */
+ public abstract bool SupportsConnectionInfo {
+ get;
+ }
+
/*
* Whether or not this TLS Provider supports Mono-specific extensions
* (via @MonoTlsSettings).
// THE SOFTWARE.
using System;
using System.Net;
-using Mono.Net.Security;
+using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
+using Mono.Net.Security;
namespace Mono.Security.Interface
{
*
* Keep in sync with System/Mono.Net.Security/MonoTlsProviderFactory.cs.
*/
- public static class MonoTlsProviderFactory
+ public static partial class MonoTlsProviderFactory
{
/*
* Returns the currently installed @MonoTlsProvider, falling back to the default one.
{
return (HttpListener)NoReflectionHelper.CreateHttpListener (certificate, provider, settings);
}
+
+ public static IMonoSslStream GetMonoSslStream (SslStream stream)
+ {
+ return (IMonoSslStream)NoReflectionHelper.GetMonoSslStream (stream);
+ }
}
}
{
}
- volatile static MonoTlsSettings defaultSettings;
+ static MonoTlsSettings defaultSettings;
public static MonoTlsSettings DefaultSettings {
get {
public Type3Message (Type2Message type2) : base (3)
{
_type2 = type2;
- _level = DefaultAuthLevel;
+ _level = NtlmSettings.DefaultAuthLevel;
_challenge = (byte[]) type2.Nonce.Clone ();
_domain = type2.TargetName;
throw new InvalidOperationException (
"Refusing to use legacy-mode LM/NTLM authentication " +
"unless explicitly enabled using DefaultAuthLevel.");
-
+
+ #pragma warning disable 618
using (var legacy = new ChallengeResponse (_password, _challenge)) {
lm = legacy.LM;
ntlm = legacy.NT;
}
+ #pragma warning restore 618
} else {
ChallengeResponse2.Compute (_type2, _level, _username, _password, _domain, out lm, out ntlm);
}
private X509Certificate FindParentCertificate (X509Certificate cert)
{
+ #pragma warning disable 618
// This certificate is the root certificate
if (cert.GetName () == cert.GetIssuerName ())
return null;
return certificate;
}
return null;
+ #pragma warning restore 618
}
#endregion
try {
SendAlert(alert);
} catch (Exception alertEx) {
- ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), ex);
+ ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), alertEx);
}
}
throw new TlsException(AlertDescription.UnexpectedMessage, String.Format(CultureInfo.CurrentUICulture,
"Unknown server handshake message received ({0})",
type.ToString()));
- break;
}
throw new TlsException (AlertDescription.HandshakeFailiure, String.Format ("Protocol error, unexpected protocol transition from {0} to {1}", last, type));
}
--- /dev/null
+./Assembly/AssemblyInfo.cs
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+./Mono.Math/BigInteger.cs
+./Mono.Math.Prime/ConfidenceFactor.cs
+./Mono.Math.Prime/PrimalityTests.cs
+./Mono.Math.Prime.Generator/NextPrimeFinder.cs
+./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
+./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
+./Mono.Security/ASN1.cs
+./Mono.Security/ASN1Convert.cs
+./Mono.Security/BitConverterLE.cs
+./Mono.Security/PKCS7.cs
+./Mono.Security/StrongName.cs
+./Mono.Security.Authenticode/AuthenticodeBase.cs
+./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
+./Mono.Security.Authenticode/AuthenticodeFormatter.cs
+./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
+./Mono.Security.Authenticode/PrivateKey.cs
+./Mono.Security.Cryptography/CryptoConvert.cs
+./Mono.Security.Cryptography/CryptoTools.cs
+./Mono.Security.Cryptography/DHKeyGeneration.cs
+./Mono.Security.Cryptography/DHParameters.cs
+./Mono.Security.Cryptography/DiffieHellman.cs
+./Mono.Security.Cryptography/DiffieHellmanManaged.cs
+./Mono.Security.Cryptography/KeyPairPersistence.cs
+./Mono.Security.Cryptography/MD2.cs
+./Mono.Security.Cryptography/MD4.cs
+./Mono.Security.Cryptography/PKCS1.cs
+./Mono.Security.Cryptography/PKCS8.cs
+./Mono.Security.Cryptography/RC4.cs
+./Mono.Security.Cryptography/RSAManaged.cs
+./Mono.Security.Cryptography/SHA224.cs
+./Mono.Security.Cryptography/SymmetricTransform.cs
+./Mono.Security.X509/PKCS12.cs
+./Mono.Security.X509/X501Name.cs
+./Mono.Security.X509/X509Builder.cs
+./Mono.Security.X509/X509Certificate.cs
+./Mono.Security.X509/X509CertificateCollection.cs
+./Mono.Security.X509/X509CertificateBuilder.cs
+./Mono.Security.X509/X509Chain.cs
+./Mono.Security.X509/X509ChainStatusFlags.cs
+./Mono.Security.X509/X509CRL.cs
+./Mono.Security.X509/X509Extension.cs
+./Mono.Security.X509/X509Extensions.cs
+./Mono.Security.X509/X509Store.cs
+./Mono.Security.X509/X509StoreManager.cs
+./Mono.Security.X509/X509Stores.cs
+./Mono.Security.X509/X520Attributes.cs
+./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
+./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
+./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
+./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
+./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
+./Mono.Security.X509.Extensions/GeneralNames.cs
+./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
+./Mono.Security.X509.Extensions/KeyUsageExtension.cs
+./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
+./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
+./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
+./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
+./Mono.Security.Cryptography/TlsHMAC.cs
+./Mono.Security.Cryptography/MD5SHA1.cs
+./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
+./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
+./Mono.Security.Protocol.Ntlm/MessageBase.cs
+./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
+./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
+./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
+./Mono.Security.Protocol.Ntlm/Type1Message.cs
+./Mono.Security.Protocol.Ntlm/Type2Message.cs
+./Mono.Security.Protocol.Ntlm/Type3Message.cs
+./Mono.Security.Protocol.Tls/Alert.cs
+./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
+./Mono.Security.Protocol.Tls/CipherSuite.cs
+./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
+./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
+./Mono.Security.Protocol.Tls/ClientContext.cs
+./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+./Mono.Security.Protocol.Tls/ClientSessionCache.cs
+./Mono.Security.Protocol.Tls/ContentType.cs
+./Mono.Security.Protocol.Tls/Context.cs
+./Mono.Security.Protocol.Tls/DebugHelper.cs
+./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
+./Mono.Security.Protocol.Tls/HandshakeState.cs
+./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
+./Mono.Security.Protocol.Tls/HttpsClientStream.cs
+./Mono.Security.Protocol.Tls/RecordProtocol.cs
+./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
+./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
+./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
+./Mono.Security.Protocol.Tls/SecurityParameters.cs
+./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
+./Mono.Security.Protocol.Tls/ServerContext.cs
+./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+./Mono.Security.Protocol.Tls/SslClientStream.cs
+./Mono.Security.Protocol.Tls/SslCipherSuite.cs
+./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
+./Mono.Security.Protocol.Tls/SslServerStream.cs
+./Mono.Security.Protocol.Tls/SslStreamBase.cs
+./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
+./Mono.Security.Protocol.Tls/TlsClientSettings.cs
+./Mono.Security.Protocol.Tls/TlsException.cs
+./Mono.Security.Protocol.Tls/TlsServerSettings.cs
+./Mono.Security.Protocol.Tls/TlsStream.cs
+./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
+./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
+./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
+./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
+./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
+./Mono.Xml/MiniParser.cs
+./Mono.Xml/SecurityParser.cs
--- /dev/null
+#include mobile_Mono.Security.dll.sources
+./Mono.Security.Cryptography/ARC4Managed.cs
+./Mono.Security.Cryptography/MD2Managed.cs
+./Mono.Security.Cryptography/MD4Managed.cs
+./Mono.Security.Cryptography/SHA224Managed.cs
-./Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-./Mono.Math/BigInteger.cs
-./Mono.Math.Prime/ConfidenceFactor.cs
-./Mono.Math.Prime/PrimalityTests.cs
-./Mono.Math.Prime.Generator/NextPrimeFinder.cs
-./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
-./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
-./Mono.Security/ASN1.cs
-./Mono.Security/ASN1Convert.cs
-./Mono.Security/BitConverterLE.cs
-./Mono.Security/PKCS7.cs
-./Mono.Security/StrongName.cs
-./Mono.Security.Authenticode/AuthenticodeBase.cs
-./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
-./Mono.Security.Authenticode/AuthenticodeFormatter.cs
-./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
-./Mono.Security.Authenticode/PrivateKey.cs
+#include mobile_Mono.Security.dll.sources
./Mono.Security.Cryptography/ARC4Managed.cs
-./Mono.Security.Cryptography/CryptoConvert.cs
-./Mono.Security.Cryptography/CryptoTools.cs
-./Mono.Security.Cryptography/DHKeyGeneration.cs
-./Mono.Security.Cryptography/DHParameters.cs
-./Mono.Security.Cryptography/DiffieHellman.cs
-./Mono.Security.Cryptography/DiffieHellmanManaged.cs
-./Mono.Security.Cryptography/KeyPairPersistence.cs
-./Mono.Security.Cryptography/MD2.cs
./Mono.Security.Cryptography/MD2Managed.cs
-./Mono.Security.Cryptography/MD4.cs
./Mono.Security.Cryptography/MD4Managed.cs
-./Mono.Security.Cryptography/PKCS1.cs
-./Mono.Security.Cryptography/PKCS8.cs
-./Mono.Security.Cryptography/RC4.cs
-./Mono.Security.Cryptography/RSAManaged.cs
-./Mono.Security.Cryptography/SHA224.cs
./Mono.Security.Cryptography/SHA224Managed.cs
-./Mono.Security.Cryptography/SymmetricTransform.cs
-./Mono.Security.X509/PKCS12.cs
-./Mono.Security.X509/X501Name.cs
-./Mono.Security.X509/X509Builder.cs
-./Mono.Security.X509/X509Certificate.cs
-./Mono.Security.X509/X509CertificateCollection.cs
-./Mono.Security.X509/X509CertificateBuilder.cs
-./Mono.Security.X509/X509Chain.cs
-./Mono.Security.X509/X509ChainStatusFlags.cs
-./Mono.Security.X509/X509CRL.cs
-./Mono.Security.X509/X509Extension.cs
-./Mono.Security.X509/X509Extensions.cs
-./Mono.Security.X509/X509Store.cs
-./Mono.Security.X509/X509StoreManager.cs
-./Mono.Security.X509/X509Stores.cs
-./Mono.Security.X509/X520Attributes.cs
-./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
-./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
-./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
-./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-./Mono.Security.X509.Extensions/GeneralNames.cs
-./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
-./Mono.Security.X509.Extensions/KeyUsageExtension.cs
-./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
-./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
-./Mono.Security.Cryptography/TlsHMAC.cs
-./Mono.Security.Cryptography/MD5SHA1.cs
-./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-./Mono.Security.Protocol.Ntlm/MessageBase.cs
-./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-./Mono.Security.Protocol.Ntlm/Type1Message.cs
-./Mono.Security.Protocol.Ntlm/Type2Message.cs
-./Mono.Security.Protocol.Ntlm/Type3Message.cs
-./Mono.Security.Protocol.Tls/Alert.cs
-./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-./Mono.Security.Protocol.Tls/CipherSuite.cs
-./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-./Mono.Security.Protocol.Tls/ClientContext.cs
-./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-./Mono.Security.Protocol.Tls/ClientSessionCache.cs
-./Mono.Security.Protocol.Tls/ContentType.cs
-./Mono.Security.Protocol.Tls/Context.cs
-./Mono.Security.Protocol.Tls/DebugHelper.cs
-./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HandshakeState.cs
-./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HttpsClientStream.cs
-./Mono.Security.Protocol.Tls/RecordProtocol.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-./Mono.Security.Protocol.Tls/SecurityParameters.cs
-./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-./Mono.Security.Protocol.Tls/ServerContext.cs
-./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-./Mono.Security.Protocol.Tls/SslClientStream.cs
-./Mono.Security.Protocol.Tls/SslCipherSuite.cs
-./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-./Mono.Security.Protocol.Tls/SslServerStream.cs
-./Mono.Security.Protocol.Tls/SslStreamBase.cs
-./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-./Mono.Security.Protocol.Tls/TlsClientSettings.cs
-./Mono.Security.Protocol.Tls/TlsException.cs
-./Mono.Security.Protocol.Tls/TlsServerSettings.cs
-./Mono.Security.Protocol.Tls/TlsStream.cs
-./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-./Mono.Xml/MiniParser.cs
-./Mono.Xml/SecurityParser.cs
-
-./Mono.Security.Interface/CertificateValidationHelper.cs
-./Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-./Mono.Math/BigInteger.cs
-./Mono.Math.Prime/ConfidenceFactor.cs
-./Mono.Math.Prime/PrimalityTests.cs
-./Mono.Math.Prime.Generator/NextPrimeFinder.cs
-./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
-./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
-./Mono.Security/ASN1.cs
-./Mono.Security/ASN1Convert.cs
-./Mono.Security/BitConverterLE.cs
-./Mono.Security/PKCS7.cs
-./Mono.Security/StrongName.cs
-./Mono.Security.Authenticode/AuthenticodeBase.cs
-./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
-./Mono.Security.Authenticode/AuthenticodeFormatter.cs
-./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
-./Mono.Security.Authenticode/PrivateKey.cs
-./Mono.Security.Cryptography/CryptoConvert.cs
-./Mono.Security.Cryptography/CryptoTools.cs
-./Mono.Security.Cryptography/DHKeyGeneration.cs
-./Mono.Security.Cryptography/DHParameters.cs
-./Mono.Security.Cryptography/DiffieHellman.cs
-./Mono.Security.Cryptography/DiffieHellmanManaged.cs
-./Mono.Security.Cryptography/KeyPairPersistence.cs
-./Mono.Security.Cryptography/MD2.cs
-./Mono.Security.Cryptography/MD4.cs
-./Mono.Security.Cryptography/PKCS1.cs
-./Mono.Security.Cryptography/PKCS8.cs
-./Mono.Security.Cryptography/RC4.cs
-./Mono.Security.Cryptography/RSAManaged.cs
-./Mono.Security.Cryptography/SHA224.cs
-./Mono.Security.Cryptography/SymmetricTransform.cs
-./Mono.Security.X509/PKCS12.cs
-./Mono.Security.X509/X501Name.cs
-./Mono.Security.X509/X509Builder.cs
-./Mono.Security.X509/X509Certificate.cs
-./Mono.Security.X509/X509CertificateCollection.cs
-./Mono.Security.X509/X509CertificateBuilder.cs
-./Mono.Security.X509/X509Chain.cs
-./Mono.Security.X509/X509ChainStatusFlags.cs
-./Mono.Security.X509/X509CRL.cs
-./Mono.Security.X509/X509Extension.cs
-./Mono.Security.X509/X509Extensions.cs
-./Mono.Security.X509/X509Store.cs
-./Mono.Security.X509/X509StoreManager.cs
-./Mono.Security.X509/X509Stores.cs
-./Mono.Security.X509/X520Attributes.cs
-./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
-./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
-./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
-./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-./Mono.Security.X509.Extensions/GeneralNames.cs
-./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
-./Mono.Security.X509.Extensions/KeyUsageExtension.cs
-./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
-./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
-./Mono.Security.Cryptography/TlsHMAC.cs
-./Mono.Security.Cryptography/MD5SHA1.cs
-./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-./Mono.Security.Protocol.Ntlm/MessageBase.cs
-./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-./Mono.Security.Protocol.Ntlm/Type1Message.cs
-./Mono.Security.Protocol.Ntlm/Type2Message.cs
-./Mono.Security.Protocol.Ntlm/Type3Message.cs
-./Mono.Security.Protocol.Tls/Alert.cs
-./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-./Mono.Security.Protocol.Tls/CipherSuite.cs
-./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-./Mono.Security.Protocol.Tls/ClientContext.cs
-./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-./Mono.Security.Protocol.Tls/ClientSessionCache.cs
-./Mono.Security.Protocol.Tls/ContentType.cs
-./Mono.Security.Protocol.Tls/Context.cs
-./Mono.Security.Protocol.Tls/DebugHelper.cs
-./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HandshakeState.cs
-./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HttpsClientStream.cs
-./Mono.Security.Protocol.Tls/RecordProtocol.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-./Mono.Security.Protocol.Tls/SecurityParameters.cs
-./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-./Mono.Security.Protocol.Tls/ServerContext.cs
-./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-./Mono.Security.Protocol.Tls/SslClientStream.cs
-./Mono.Security.Protocol.Tls/SslCipherSuite.cs
-./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-./Mono.Security.Protocol.Tls/SslServerStream.cs
-./Mono.Security.Protocol.Tls/SslStreamBase.cs
-./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-./Mono.Security.Protocol.Tls/TlsClientSettings.cs
-./Mono.Security.Protocol.Tls/TlsException.cs
-./Mono.Security.Protocol.Tls/TlsServerSettings.cs
-./Mono.Security.Protocol.Tls/TlsStream.cs
-./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-./Mono.Xml/MiniParser.cs
-./Mono.Xml/SecurityParser.cs
-
-./Mono.Security.Interface/CertificateValidationHelper.cs
+#include mobile_Mono.Security.dll.sources
#include monotouch_Mono.Security.dll.sources
-./Mono.Security.Interface/Alert.cs
-./Mono.Security.Interface/CipherAlgorithmType.cs
-./Mono.Security.Interface/CipherSuiteCode.cs
-./Mono.Security.Interface/ExchangeAlgorithmType.cs
-./Mono.Security.Interface/HashAlgorithmType.cs
-./Mono.Security.Interface/IBufferOffsetSize.cs
-./Mono.Security.Interface/IMonoTlsEventSink.cs
-./Mono.Security.Interface/IMonoTlsContext.cs
-./Mono.Security.Interface/IMonoSslStream.cs
-./Mono.Security.Interface/MonoTlsConnectionInfo.cs
-./Mono.Security.Interface/MonoTlsProvider.cs
-./Mono.Security.Interface/MonoTlsProviderFactory.cs
-./Mono.Security.Interface/MonoTlsSettings.cs
-./Mono.Security.Interface/TlsException.cs
-./Mono.Security.Interface/TlsProtocolCode.cs
-./Mono.Security.Interface/TlsProtocols.cs
SUBDIRS =
include ../../build/rules.make
+ifndef NO_MULTIPLE_APPDOMAINS
+REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+endif
+
LIBRARY = System.ServiceModel.Internals.dll
LIB_REFS = System System.Core System.Xml
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration
endif
-LIB_MCS_FLAGS = /unsafe
+LIB_MCS_FLAGS = /unsafe $(REFERENCE_SOURCES_FLAGS)
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
}
public override string Scheme {
- get { return Security.Mode != WebHttpSecurityMode.None ? Uri.UriSchemeHttps : Uri.UriSchemeHttp; }
+ get { return Security.Mode == WebHttpSecurityMode.Transport ? Uri.UriSchemeHttps : Uri.UriSchemeHttp; }
}
public WebHttpSecurity Security {
Assert.AreEqual (typeof (WebMessageEncodingBindingElement), bc [0].GetType (), "#2");
Assert.AreEqual (typeof (HttpTransportBindingElement), bc [1].GetType (), "#3");
}
+
+ [Test]
+ public void DefaultSchemeBasedOnSecurityMode ()
+ {
+ WebHttpBinding b = new WebHttpBinding(WebHttpSecurityMode.TransportCredentialOnly);
+ Assert.AreEqual("http", b.Scheme, "#1");
+
+ b = new WebHttpBinding(WebHttpSecurityMode.Transport);
+ Assert.AreEqual("https", b.Scheme, "#2");
+ }
}
}
Entries = new List<HttpChannelListenerEntry> ();
}
- public List<HttpChannelListenerEntry> Entries { get; private set; }
+ protected List<HttpChannelListenerEntry> Entries { get; private set; }
+ object entries_lock = new object ();
public abstract void RegisterListener (ChannelDispatcher channel, HttpTransportBindingElement element, TimeSpan timeout);
public abstract void UnregisterListener (ChannelDispatcher channel, TimeSpan timeout);
protected void RegisterListenerCommon (ChannelDispatcher channel, TimeSpan timeout)
{
- Entries.Add (new HttpChannelListenerEntry (channel, new AutoResetEvent (false)));
+ lock (entries_lock) {
+ Entries.Add (new HttpChannelListenerEntry (channel, new AutoResetEvent (false)));
- Entries.Sort (HttpChannelListenerEntry.CompareEntries);
+ Entries.Sort (HttpChannelListenerEntry.CompareEntries);
+ }
}
protected void UnregisterListenerCommon (ChannelDispatcher channel, TimeSpan timeout)
{
- var entry = Entries.First (e => e.ChannelDispatcher == channel);
- Entries.Remove (entry);
+ lock (entries_lock) {
+ var entry = Entries.First (e => e.ChannelDispatcher == channel);
+ Entries.Remove (entry);
- entry.WaitHandle.Set (); // make sure to finish pending requests.
+ entry.WaitHandle.Set (); // make sure to finish pending requests.
+ }
}
public void ProcessNewContext (HttpContextInfo ctxi)
HttpChannelListenerEntry SelectChannel (HttpContextInfo ctx)
{
- foreach (var e in Entries)
- if (e.FilterHttpContext (ctx))
- return e;
+ lock (entries_lock) {
+ foreach (var e in Entries)
+ if (e.FilterHttpContext (ctx))
+ return e;
+ }
return null;
}
DateTime start = DateTime.Now;
context = null;
- var ce = Entries.FirstOrDefault (e => e.ChannelDispatcher == channel);
+ HttpChannelListenerEntry ce = null;
+ lock (entries_lock) {
+ ce = Entries.FirstOrDefault (e => e.ChannelDispatcher == channel);
+ }
if (ce == null)
return false;
lock (ce.RetrieverLock) {
[Category ("NunitWeb")]
public void WizardStepBase_Theme ()
{
- WebTest.CopyResource (GetType (), "WizardTest.skin", "App_Themes/Theme1/WizardTest.skin");
+ WebTest.CopyResource (GetType (), "WizardTest.skin", "App_Themes/WizardStepBase/WizardTest.skin");
WebTest t = new WebTest ();
PageDelegates pd = new PageDelegates ();
pd.PreInit = set_properties;
public static void set_properties (Page p)
{
- p.Theme = "Theme1";
+ p.Theme = "WizardStepBase";
}
public static void theme (Page p)
RESOURCE_STRINGS = ../../../external/referencesource/System/System.txt
#
-# MOBILE_PROFILE needs SECURITY_DEP, except for XAMMAC
+# MOBILE_PROFILE needs SECURITY_DEP
#
ifdef MOBILE_PROFILE
-ifeq ($(PROFILE),xammac)
-EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
-LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
-else
LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
-endif
else
EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security.Protocol.Ntlm;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security.Protocol.Ntlm;
+#else
+using Mono.Security.Protocol.Ntlm;
#endif
using System;
readonly MonoTlsStream tlsStream;
readonly HttpWebRequest request;
- static bool is_macosx;
- static bool is_mobile;
-#if !MOBILE
- static X509RevocationMode revocation_mode;
-#endif
-
- static ChainValidationHelper ()
- {
-#if MONOTOUCH
- is_macosx = true;
- is_mobile = true;
-#elif MONODROID
- is_macosx = false;
- is_mobile = true;
-#else
- is_macosx = System.IO.File.Exists (OSX509Certificates.SecurityLibrary);
- is_mobile = false;
-#endif
-
-#if !MOBILE
- revocation_mode = X509RevocationMode.NoCheck;
- try {
- string str = Environment.GetEnvironmentVariable ("MONO_X509_REVOCATION_MODE");
- if (String.IsNullOrEmpty (str))
- return;
- revocation_mode = (X509RevocationMode)Enum.Parse (typeof(X509RevocationMode), str, true);
- } catch {
- }
-#endif
- }
-
internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
if (settings == null)
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if SECURITY_DEP && MONO_X509_ALIAS
+#if SECURITY_DEP
+#if MONO_X509_ALIAS
extern alias PrebuiltSystem;
+#endif
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+#if MONO_X509_ALIAS
using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
#endif
+#if MONO_SECURITY_ALIAS
+using MSI = MonoSecurity::Mono.Security.Interface;
+#else
+using MSI = Mono.Security.Interface;
+#endif
+#endif
using System;
using System.IO;
IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState);
void EndWrite (IAsyncResult asyncResult);
+
+#if SECURITY_DEP
+ MSI.MonoTlsProvider Provider {
+ get;
+ }
+
+ MSI.MonoTlsConnectionInfo GetConnectionInfo ();
+#endif
}
}
-
using System.Threading.Tasks;
-namespace Mono.Net.Security
+namespace Mono.Net.Security.Private
{
+ /*
+ * Strictly private - do not use outside the Mono.Net.Security directory.
+ */
[MonoTODO ("Non-X509Certificate2 certificate is not supported")]
internal class LegacySslStream : AuthenticatedStream, IMonoSslStream
{
#region Fields
SslStreamBase ssl_stream;
- MonoTlsProvider provider;
- MonoTlsSettings settings;
ICertificateValidator certificateValidator;
+ MonoTlsProvider provider;
#endregion // Fields
: base (innerStream, leaveInnerStreamOpen)
{
this.provider = provider;
- this.settings = settings;
- this.certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
+ certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
}
#endregion // Constructors
get { throw new NotSupportedException (); }
}
+ MonoTlsProvider IMonoSslStream.Provider {
+ get { return provider; }
+ }
+
+ MonoTlsConnectionInfo IMonoSslStream.GetConnectionInfo ()
+ {
+ return null;
+ }
+
#endregion
}
}
get { return true; }
}
+ public override bool SupportsConnectionInfo {
+ get { return false; }
+ }
+
public override bool SupportsMonoExtensions {
get { return false; }
}
using System.Security.Principal;
using System.Security.Cryptography;
-namespace Mono.Net.Security
+namespace Mono.Net.Security.Private
{
+ /*
+ * Strictly private - do not use outside the Mono.Net.Security directory.
+ */
class MonoSslStreamImpl : MSI.IMonoSslStream
{
IMonoSslStream impl;
get { return (XSslProtocols)Impl.SslProtocol; }
}
+ public MSI.MonoTlsProvider Provider {
+ get { return Impl.Provider; }
+ }
+
+ public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
+ {
+ return Impl.GetConnectionInfo ();
+ }
+
void CheckDisposed ()
{
if (impl == null)
get { return (SslProtocols)Impl.SslProtocol; }
}
+ public MSI.MonoTlsProvider Provider {
+ get { return Impl.Provider; }
+ }
+
+ public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
+ {
+ return Impl.GetConnectionInfo ();
+ }
+
void CheckDisposed ()
{
if (impl == null)
* Keep in sync with Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs.
*
*/
- static class MonoTlsProviderFactory
+ static partial class MonoTlsProviderFactory
{
#region Internal API
}
}
+#if MONO_FEATURE_NEW_SYSTEM_SOURCE || (!MONOTOUCH && !XAMMAC)
static IMonoTlsProvider CreateDefaultProvider ()
{
#if SECURITY_DEP
return null;
#endif
}
+#endif
static object locker = new object ();
static IMonoTlsProvider defaultProvider;
using System;
using System.Net;
+using System.Net.Security;
namespace Mono.Net.Security
{
throw new NotSupportedException ();
#endif
}
+
+ internal static object GetMonoSslStream (SslStream stream)
+ {
+ #if SECURITY_DEP
+ return stream.Impl;
+ #else
+ throw new NotSupportedException ();
+ #endif
+ }
+
}
}
internal static class SystemCertificateValidator
{
static bool is_macosx;
- static bool is_mobile;
#if !MOBILE
static X509RevocationMode revocation_mode;
#endif
{
#if MONOTOUCH
is_macosx = true;
- is_mobile = true;
#elif MONODROID
is_macosx = false;
- is_mobile = true;
#else
is_macosx = System.IO.File.Exists (OSX509Certificates.SecurityLibrary);
- is_mobile = false;
#endif
#if !MOBILE
async_error.AsyncWaitHandle.WaitOne ();
#endif // MONO_FEATURE_PROCESS_START
- OnExited ();
+ if (EnableRaisingEvents)
+ OnExited ();
return true;
}
{
#if MONODROID
return new AndroidIPGlobalProperties ();
-#elif MONOTOUCH || XAMMAC
+#elif MONOTOUCH || XAMMAC || MOBILE_STATIC
return new UnixIPGlobalProperties ();
#else
switch (Environment.OSVersion.Platform) {
return new LinuxNetworkInterfaceAPI ();
}
-#if !MONODROID
+#if !MOBILE
if (Environment.OSVersion.Version >= windowsVer51)
return new Win32NetworkInterfaceAPI ();
#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if SECURITY_DEP && !MONO_FEATURE_NEW_TLS
+#if !MONO_FEATURE_NEW_TLS
+#if SECURITY_DEP
#if MONO_X509_ALIAS
extern alias PrebuiltSystem;
AuthenticatedStream MNS.IMonoSslStream.AuthenticatedStream {
get { return this; }
}
+
+ MonoTlsProvider MNS.IMonoSslStream.Provider {
+ get { return provider; }
+ }
+
+ MonoTlsConnectionInfo MNS.IMonoSslStream.GetConnectionInfo ()
+ {
+ return Impl.GetConnectionInfo ();
+ }
}
}
+#else // !SECURITY_DEP
+namespace System.Net.Security
+{
+ public class SslStream
+ {
+ }
+}
+#endif
#endif
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security.Authenticode;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security.Authenticode;
+#else
+using Mono.Security.Authenticode;
#endif
using System.IO;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using Mono.Security.Cryptography;
-using MSX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
using MonoSecurity::Mono.Security.Cryptography;
using MSX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security;
+using Mono.Security.Cryptography;
+using MSX = Mono.Security.X509;
#endif
namespace System.Security.Cryptography.X509Certificates {
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using MX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
using MX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security;
+using MX = Mono.Security.X509;
#endif
using System.Collections;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
+#else
+using Mono.Security;
#endif
using System.Text;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using Mono.Security.Cryptography;
-using MX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
-
using MonoSecurity::Mono.Security;
using MonoSecurity::Mono.Security.Cryptography;
using MX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security;
+using Mono.Security.Cryptography;
+using MX = Mono.Security.X509;
#endif
#endif
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using MX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MX = MonoSecurity::Mono.Security.X509;
+#else
+using MX = Mono.Security.X509;
#endif
using System.Collections;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
+#else
+using Mono.Security;
#endif
using System.Text;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using MX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
using MX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security;
+using MX = Mono.Security.X509;
#endif
using System.Collections;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
+#else
+using Mono.Security;
#endif
using System.Text;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using MX = Mono.Security.X509;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MX = MonoSecurity::Mono.Security.X509;
+#else
+using MX = Mono.Security.X509;
#endif
using System.Security.Permissions;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using Mono.Security.Cryptography;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
using MonoSecurity::Mono.Security.Cryptography;
+#else
+using Mono.Security;
+using Mono.Security.Cryptography;
#endif
using System.Text;
#if SECURITY_DEP
-#if MONOTOUCH || MONODROID
-using Mono.Security;
-using Mono.Security.Cryptography;
-#else
+#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MonoSecurity::Mono.Security;
using MonoSecurity::Mono.Security.Cryptography;
+#else
+using Mono.Security;
+using Mono.Security.Cryptography;
#endif
using System.Security.Cryptography.X509Certificates;
p.BeginOutputReadLine ();
p.WaitForExit ();
- exited.Wait (10000);
+ Assert.IsTrue (exited.Wait (10000));
Assert.AreEqual (1, exitedCalledCounter);
Thread.Sleep (50);
Assert.AreEqual (1, exitedCalledCounter);
}
+ [Test]
+ [NUnit.Framework.Category ("MobileNotWorking")]
+ public void TestDisableEventsBeforeExitedEvent ()
+ {
+ Process p = new Process ();
+
+ p.StartInfo = GetCrossPlatformStartInfo ();
+ p.StartInfo.UseShellExecute = false;
+ p.StartInfo.RedirectStandardOutput = true;
+ p.StartInfo.RedirectStandardError = true;
+
+ p.EnableRaisingEvents = false;
+
+ var exitedCalledCounter = 0;
+ p.Exited += (object sender, EventArgs e) => {
+ exitedCalledCounter++;
+ };
+
+ p.Start ();
+ p.BeginErrorReadLine ();
+ p.BeginOutputReadLine ();
+ p.WaitForExit ();
+
+ Assert.AreEqual (0, exitedCalledCounter);
+ }
+
ProcessStartInfo GetCrossPlatformStartInfo ()
{
if (RunningOnUnix) {
//
using System;
+using System.Diagnostics;
using System.Linq;
using System.Collections;
using System.Threading;
ProtocolType.Tcp);
conn.Connect (ep);
- Socket client = server.Accept();
+ Socket client = null;
+ var sw = Stopwatch.StartNew ();
+ while (sw.ElapsedMilliseconds < 100)
+ {
+ try {
+ client = server.Accept();
+ break;
+ }
+ catch (SocketException ex) {
+ if (ex.SocketErrorCode == SocketError.WouldBlock)
+ continue;
+ throw;
+ }
+ }
+ Assert.IsNotNull (client, "Couldn't accept a client connection within 100ms.");
bool client_block = client.Blocking;
client.Close();
../../../external/referencesource/System/misc/WeakHashtable.cs
../../../external/referencesource/System/compmod/system/diagnostics/TextWriterTraceListener.cs
+
+../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
+../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
+../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
+../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
+../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
+
+../Mono.Security/Mono.Security.Interface/Alert.cs
+../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
+../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
+../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
+../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
+../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
+../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
+../Mono.Security/Mono.Security.Interface/TlsException.cs
+../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
+../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
#include mobile_System.dll.sources
MonoTouch/MonoPInvokeCallbackAttribute.cs
-../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-
-../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
-../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
-../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
#include mobile_System.dll.sources
System/AndroidPlatform.cs
-../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-
-../Mono.Security/Mono.Security.Interface/Alert.cs
-../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
-../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
-../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
-../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
-../Mono.Security/Mono.Security.Interface/TlsException.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
#include mobile_System.dll.sources
MonoTouch/MonoPInvokeCallbackAttribute.cs
-../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-
-../Mono.Security/Mono.Security.Interface/Alert.cs
-../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
-../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
-../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
-../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
-../Mono.Security/Mono.Security.Interface/TlsException.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
endif
+ifndef NO_MULTIPLE_APPDOMAINS
+REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+TEST_MCS_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
+endif
+
WARNING_ABOUT_DISABLED_WARNING=1635
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
namespace System.Runtime.Hosting {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
[MonoTODO ("missing manifest support")]
public class ApplicationActivator {
return ad.CreateInstance ("assemblyName", "typeName", null);
}
}
+#else
+ [Obsolete ("ApplicationActivator is not supported on this platform.", true)]
+ public class ApplicationActivator {
+
+ public ApplicationActivator ()
+ {
+ throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+ }
+
+ public virtual ObjectHandle CreateInstance (ActivationContext activationContext)
+ {
+ throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+ }
+
+ public virtual ObjectHandle CreateInstance (ActivationContext activationContext, string[] activationCustomData)
+ {
+ throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+ }
+
+ protected static ObjectHandle CreateInstanceHelper (AppDomainSetup adSetup)
+ {
+ throw new PlatformNotSupportedException ("ApplicationActivator is not supported on this platform.");
+ }
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
public abstract void EnsureState ();
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public bool IsStateAvailable ()
{
AppDomainManager adm = AppDomain.CurrentDomain.DomainManager;
return false;
return adm.CheckSecuritySettings (this);
}
+#else
+ [Obsolete ("SecurityState.IsStateAvailable is not supported on this platform.", true)]
+ public bool IsStateAvailable ()
+ {
+ throw new PlatformNotSupportedException ("SecurityState.IsStateAvailable is not supported on this platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
return _process_guid;
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName)
{
return CreateDomain (friendlyName, null, null);
return ad;
}
+#else
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
#if !NET_2_1
[Serializable]
}
#endif
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,string appBasePath,
string appRelativeSearchPath, bool shadowCopyFiles)
{
return CreateDomain (friendlyName, securityInfo, CreateDomainSetup (appBasePath, appRelativeSearchPath, shadowCopyFiles));
}
+#else
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,string appBasePath,
+ string appRelativeSearchPath, bool shadowCopyFiles)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
#if !NET_2_1
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info,
PermissionSet grantSet, params StrongName [] fullTrustAssemblies)
{
info.ApplicationTrust = new ApplicationTrust (grantSet, fullTrustAssemblies ?? EmptyArray<StrongName>.Value);
return CreateDomain (friendlyName, securityInfo, info);
}
+#else
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info,
+ PermissionSet grantSet, params StrongName [] fullTrustAssemblies)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
#endif
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
static AppDomainSetup CreateDomainSetup (string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles)
{
AppDomainSetup info = new AppDomainSetup ();
return info;
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern bool InternalIsFinalizingForUnload (int domain_id);
return Thread.GetDomainID ();
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
[ReliabilityContractAttribute (Consistency.MayCorruptAppDomain, Cer.MayFail)]
public static void Unload (AppDomain domain)
InternalUnload (domain.getDomainID());
}
+#else
+ [Obsolete ("AppDomain.Unload is not supported on the current platform.", true)]
+ public static void Unload (AppDomain domain)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.Unload is not supported on the current platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
[MethodImplAttribute (MethodImplOptions.InternalCall)]
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
return null;
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
private void DoDomainUnload ()
{
if (DomainUnload != null)
DomainUnload(this, null);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern void DoUnhandledException (Exception e);
[method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
public event ResolveEventHandler AssemblyResolve;
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
+#else
+ [Obsolete ("AppDomain.DomainUnload is not supported on the current platform.", true)]
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
public event EventHandler DomainUnload;
[method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
#endif
#pragma warning restore 649
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
// default is null
public AppDomainManager DomainManager {
get { return (AppDomainManager)_domain_manager; }
}
+#else
+ [Obsolete ("AppDomain.DomainManager is not supported on this platform.", true)]
+ public AppDomainManager DomainManager {
+ get { throw new PlatformNotSupportedException ("AppDomain.DomainManager is not supported on this platform."); }
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
#if !MOBILE
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
// static methods
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath,
string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs)
{
return CreateDomain (friendlyName, securityInfo, info);
}
+#else
+ [Obsolete ("AppDomain.CreateDomain is not supported on the current platform.", true)]
+ public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath,
+ string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs)
+ {
+ throw new PlatformNotSupportedException ("AppDomain.CreateDomain is not supported on the current platform.");
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
public int ExecuteAssemblyByName (string assemblyName)
{
//
namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[System.Runtime.InteropServices.ComVisible (true)]
[Serializable]
+#else
+ [Obsolete ("AppDomainInitializer is not supported on the current platform.", true)]
+#endif
public delegate void AppDomainInitializer (string[] args);
}
namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
[SecurityPermission (SecurityAction.InheritanceDemand, Infrastructure = true)]
return AppDomain.CreateDomain (friendlyName, securityInfo, appDomainInfo);
}
}
+#else
+ [Obsolete ("AppDomainManager is not supported on the current platform.", true)]
+ public class AppDomainManager : MarshalByRefObject {
+ public AppDomainManager ()
+ {
+ throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+ }
+
+ public virtual ApplicationActivator ApplicationActivator {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual Assembly EntryAssembly {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual HostExecutionContextManager HostExecutionContextManager {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual HostSecurityManager HostSecurityManager {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public AppDomainManagerInitializationOptions InitializationFlags {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ set { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
+ {
+ throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+ }
+
+ public virtual void InitializeNewDomain (AppDomainSetup appDomainInfo)
+ {
+ throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+ }
+
+ public virtual bool CheckSecuritySettings (SecurityState state)
+ {
+ throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+ }
+
+ protected static AppDomain CreateDomainHelper (string friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
+ {
+ throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform.");
+ }
+ }
+
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
namespace System {
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[ComVisible (true)]
public class AppDomainManager {
return (state != null);
}
}
+#else
+ [Obsolete ("AppDomainManager is not supported on the current platform.", true)]
+ public class AppDomainManager {
+
+ public AppDomainManager ()
+ {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual void InitializeNewDomain (AppDomainSetup appDomainInfo)
+ {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+
+ public virtual bool CheckSecuritySettings (SecurityState state)
+ {
+ get { throw new PlatformNotSupportedException ("AppDomainManager is not supported on the current platform."); }
+ }
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
#endif
set { _activationArguments = value; }
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[MonoLimitation ("it needs to be invoked within the created domain")]
public AppDomainInitializer AppDomainInitializer {
get {
}
set { domain_initializer = value; }
}
+#else
+ [Obsolete ("AppDomainSetup.AppDomainInitializer is not supported on this platform.", true)]
+ public AppDomainInitializer AppDomainInitializer {
+ get { throw new PlatformNotSupportedException ("AppDomainSetup.AppDomainInitializer is not supported on this platform."); }
+ set { throw new PlatformNotSupportedException ("AppDomainSetup.AppDomainInitializer is not supported on this platform."); }
+ }
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
+
[MonoLimitation ("it needs to be used to invoke the initializer within the created domain")]
public string [] AppDomainInitializerArguments {
object [] arr = (object []) bf.Deserialize (ms);
_activationArguments = (ActivationArguments) arr [0];
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
domain_initializer = (AppDomainInitializer) arr [1];
+#endif
application_trust = (ApplicationTrust) arr [2];
serialized_non_primitives = null;
RuntimeHelpers.RunClassConstructor (typeof (Thrower).TypeHandle);
}
+ class GClass<T> {
+ protected T Field;
+ }
+
+ [Test]
+ public void RunClassConstructor_Generic ()
+ {
+ RuntimeHelpers.RunClassConstructor (typeof (GClass<>).TypeHandle);
+ }
+
class Fielder {
public byte [] array = new byte [1];
}
);
}
- [Test]
- [ExpectedException (typeof (CryptographicException))]
- public void CreateEncryptor_KeyNull ()
- {
- ICryptoTransform encryptor = aes.CreateEncryptor (null, aes.IV);
- byte[] data = new byte[encryptor.InputBlockSize];
- byte[] encdata = encryptor.TransformFinalBlock (data, 0, data.Length);
-
- ICryptoTransform decryptor = aes.CreateDecryptor (aes.Key, aes.IV);
- byte[] decdata = decryptor.TransformFinalBlock (encdata, 0, encdata.Length);
- // null key != SymmetricAlgorithm.Key
- }
-
[Test]
public void CreateEncryptor_IvNull ()
{
// SymmetricAlgorithm Key and IV not changed by CreateEncryptor
}
- [Test]
- [ExpectedException (typeof (CryptographicException))]
- public void CreateDecryptor_KeyNull ()
- {
- ICryptoTransform encryptor = aes.CreateEncryptor (aes.Key, aes.IV);
- byte[] data = new byte[encryptor.InputBlockSize];
- byte[] encdata = encryptor.TransformFinalBlock (data, 0, data.Length);
-
- ICryptoTransform decryptor = aes.CreateDecryptor (null, aes.IV);
- byte[] decdata = decryptor.TransformFinalBlock (encdata, 0, encdata.Length);
- // null key != SymmetricAlgorithm.Key
- }
-
[Test]
public void CreateDecryptor_IvNull ()
{
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
public void Defaults ()
{
ContreteSecurityState ss = new ContreteSecurityState ();
Assert.IsFalse (ss.IsStateAvailable (), "IsStateAvailable");
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
public void CurrentThread_Domains ()
{
Assert.IsTrue (o.Run ());
AppDomain.Unload (ad);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
void CheckIsRunning (string s, Thread t)
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
+
using NUnit.Framework;
using System;
}
}
}
+
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
using System;
using System.Security;
}
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
#if MOBILE
[Category ("NotWorking")]
Assert.IsNotNull (data);
Assert.IsTrue ((bool) data);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
static void AppDomainInitialized1 (string [] args)
{
{
}
+#if MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
#if MOBILE
[Category ("NotWorking")]
s.AppDomainInitializer = InstanceInitializer;
AppDomain.CreateDomain ("MyDomain", null, s);
}
+#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
}
}
if (a.DeclaringType.MemberDefinition != b.DeclaringType.MemberDefinition)
return mc_b;
- if (mc_a.Location.File != mc_a.Location.File)
+ if (mc_a.Location.File != mc_b.Location.File)
return mc_b;
return mc_b.Location.Row > mc_a.Location.Row ? mc_b : mc_a;
# tests the simplest --dropns case, a single class where the root namespace was dropped.
-rm -Rf Test/en.actual
$(MAKE) Test/DocTest-DropNS-classic.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll --api-style=classic
$(MAKE) update-monodocer-dropns-unified
diff --exclude=.svn -rup Test/en.expected-dropns-classic-v1 Test/en.actual
$(MAKE) Test/DocTest-DropNS-unified-multitest.dll
# mdoc update for both classic and unified
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) -multiassembly
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) --api-style=classic -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
# now run it again to verify idempotency
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) -multiassembly
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) --api-style=classic -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
diff --exclude=.svn -rup Test/en.expected-dropns-multi Test/en.actual
$(MAKE) Test/DocTest-DropNS-unified-multitest.dll
# mdoc update to show a pre-existing set of documents
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll --api-style=classic
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework
# mdoc update for both classic and unified
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) -multiassembly
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) --api-style=classic -multiassembly
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly
diff --exclude=.svn -rup Test/en.expected-dropns-multi-withexisting Test/en.actual
rm -Rf Test/DocTest-DropNS-classic-deletetest.dll
rm -Rf Test/DocTest-DropNS-unified-deletetest.dll
$(MAKE) Test/DocTest-DropNS-classic-deletetest.dll
- $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-deletetest.dll
+ $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-deletetest.dll --api-style=classic
$(MAKE) Test/DocTest-DropNS-unified-deletetest.dll
- $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified-deletetest.dll --dropns Test/DocTest-DropNS-unified-deletetest.dll=MyFramework
+ $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified-deletetest.dll --api-style=unified --dropns Test/DocTest-DropNS-unified-deletetest.dll=MyFramework
$(MAKE) Test/DocTest-DropNS-classic-deletetest-V2.dll
- $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-deletetest.dll
+ $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-deletetest.dll --api-style=classic
$(MAKE) Test/DocTest-DropNS-unified-deletetest-V2.dll
- $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified-deletetest.dll --dropns Test/DocTest-DropNS-unified-deletetest.dll=MyFramework
+ $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified-deletetest.dll --api-style=unified --dropns Test/DocTest-DropNS-unified-deletetest.dll=MyFramework
diff --exclude=.dvn -rup Test/en.expected-dropns-delete Test/en.actual
check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
-rm -Rf Test/en.actual
$(MAKE) Test/DocTest-DropNS-classic.dll
$(MAKE) Test/DocTest-DropNS-classic-secondary.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll --api-style=classic
$(MAKE) update-monodocer-dropns-unified-withsecondary
diff --exclude=.svn -rup Test/en.expected-dropns-classic-withsecondary Test/en.actual
update-monodocer-dropns-unified: $(PROGRAM)
$(MAKE) Test/DocTest-DropNS-unified.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+ $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework
update-monodocer-dropns-unified-withsecondary: $(PROGRAM)
$(MAKE) Test/DocTest-DropNS-unified.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll Test/DocTest-DropNS-classic-secondary.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll Test/DocTest-DropNS-classic-secondary.dll --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework
update-monodocer-dropns-classic-secondary: $(PROGRAM)
$(MAKE) Test/DocTest-DropNS-classic-secondary.dll
- $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll --api-style=classic
check-monodocer-internal-interface: $(PROGRAM)
# Tests to make sure internal interfaces that are explicitly implemented are not documented
List<AssemblyDefinition> assemblies;
readonly DefaultAssemblyResolver assemblyResolver = new DefaultAssemblyResolver();
+ string apistyle = string.Empty;
+ bool isClassicRun;
bool multiassembly;
bool delete;
bool show_exceptions;
{ "multiassembly",
"Allow types to be in multiple assemblies.",
v => multiassembly = true },
+ { "api-style=",
+ "Denotes the apistyle. Currently, only `classic` and `unified` are supported. `classic` set of assemblies should be run first, immediately followed by 'unified' assemblies with the `dropns` parameter.",
+ v => apistyle = v.ToLowerInvariant ()},
};
var assemblies = Parse (p, args, "update",
"[OPTIONS]+ ASSEMBLIES",
return;
if (assemblies.Count == 0)
Error ("No assemblies specified.");
-
+
+ // validation for the api-style parameter
+ if (apistyle == "classic")
+ isClassicRun = true;
+ else if (apistyle == "unified") {
+ if (!droppedAssemblies.Any ())
+ Error ("api-style 'unified' must also supply the 'dropns' parameter with at least one assembly and dropped namespace.");
+ } else if (!string.IsNullOrWhiteSpace (apistyle))
+ Error ("api-style '{0}' is not currently supported", apistyle);
+
+
foreach (var dir in assemblies
.Where (a => a.Contains (Path.DirectorySeparatorChar))
.Select (a => Path.GetDirectoryName (a)))
saveDoc ();
var unifiedAssemblyNode = doc.SelectSingleNode ("/Type/AssemblyInfo[@apistyle='unified']");
- var classicAssemblyNode = doc.SelectSingleNode ("/Type/AssemblyInfo[@apistyle='classic']");
+ var classicAssemblyNode = doc.SelectSingleNode ("/Type/AssemblyInfo[not(@apistyle) or @apistyle='classic']");
var unifiedMembers = doc.SelectNodes ("//Member[@apistyle='unified']|//Member/AssemblyInfo[@apistyle='unified']");
var classicMembers = doc.SelectNodes ("//Member[@apistyle='classic']|//Member/AssemblyInfo[@apistyle='classic']");
bool isUnifiedRun = HasDroppedAnyNamespace ();
XmlElement mm = MakeMember(basefile, new DocsNodeInfo (null, m));
if (mm == null) continue;
- if (MDocUpdater.SwitchingToMagicTypes) {
+ if (MDocUpdater.SwitchingToMagicTypes || MDocUpdater.HasDroppedNamespace (m)) {
// this is a unified style API that obviously doesn't exist in the classic API. Let's mark
// it with apistyle="unified", so that it's not displayed for classic style APIs
- mm.SetAttribute ("apistyle", "unified");
+ mm.AddApiStyle (ApiStyle.Unified);
}
members.AppendChild( mm );
bool unifiedRun = HasDroppedNamespace (type);
- var classicAssemblyInfo = member.SelectSingleNode ("AssemblyInfo[@apistyle='classic']");
+ var classicAssemblyInfo = member.SelectSingleNode ("AssemblyInfo[not(@apistyle) or @apistyle='classic']");
bool nodeIsClassic = classicAssemblyInfo != null || member.HasApiStyle (ApiStyle.Classic);
var unifiedAssemblyInfo = member.SelectSingleNode ("AssemblyInfo[@apistyle='unified']");
bool nodeIsUnified = unifiedAssemblyInfo != null || member.HasApiStyle (ApiStyle.Unified);
} else if (unifiedRun && nodeIsClassic) {
// this is a unified run, and the member doesn't exist, but is marked as being in the classic assembly.
member.RemoveApiStyle (ApiStyle.Unified);
+ member.AddApiStyle (ApiStyle.Classic);
Warning ("Not removing '{0}' since it's still in the classic assembly.", signature);
} else if (unifiedRun && !nodeIsClassic) {
// unified run, and the node is not classic, which means it doesn't exist anywhere.
actuallyDelete ();
} else {
- if (!nodeIsClassic && !nodeIsUnified) { // regular codepath (ie. not classic/unified)
+ if (!isClassicRun || (isClassicRun && !nodeIsClassic && !nodeIsUnified)) { // regular codepath (ie. not classic/unified)
actuallyDelete ();
} else { // this is a classic run
Warning ("Removing classic from '{0}' ... will be removed in the unified run if not present there.", signature);
/// <summary>Adds an AssemblyInfo with AssemblyName node to an XmlElement.</summary>
/// <returns>The assembly that was either added, or was already present</returns>
- static XmlElement AddAssemblyNameToNode (XmlElement root, TypeDefinition type)
+ XmlElement AddAssemblyNameToNode (XmlElement root, TypeDefinition type)
{
return AddAssemblyNameToNode (root, type.Module);
}
/// <summary>Adds an AssemblyInfo with AssemblyName node to an XmlElement.</summary>
/// <returns>The assembly that was either added, or was already present</returns>
- static XmlElement AddAssemblyNameToNode (XmlElement root, ModuleDefinition module)
+ XmlElement AddAssemblyNameToNode (XmlElement root, ModuleDefinition module)
{
Func<XmlElement, bool> assemblyFilter = x => {
var existingName = x.SelectSingleNode ("AssemblyName");
- return existingName != null && existingName.InnerText == module.Assembly.Name.Name;
+
+ bool apiStyleMatches = true;
+ string currentApiStyle = x.GetAttribute ("apistyle");
+ if ((HasDroppedNamespace (module) && !string.IsNullOrWhiteSpace (currentApiStyle) && currentApiStyle != "unified") ||
+ (isClassicRun && (string.IsNullOrWhiteSpace (currentApiStyle) || currentApiStyle != "classic"))) {
+ apiStyleMatches = false;
+ }
+ return apiStyleMatches && (existingName == null || (existingName != null && existingName.InnerText == module.Assembly.Name.Name));
};
return AddAssemblyXmlNode (
assemblyFilter, x => WriteElementText (x, "AssemblyName", module.Assembly.Name.Name),
() => {
XmlElement ass = WriteElement (root, "AssemblyInfo", forceNewElement: true);
+
if (MDocUpdater.HasDroppedNamespace (module))
- ass.SetAttribute ("apistyle", "unified");
+ ass.AddApiStyle (ApiStyle.Unified);
+ if (isClassicRun)
+ ass.AddApiStyle (ApiStyle.Classic);
return ass;
}, module);
}
XmlElement thisAssemblyNode = relevant.FirstOrDefault (valueMatches);
if (thisAssemblyNode == null) {
thisAssemblyNode = makeNewNode ();
- setValue (thisAssemblyNode);
}
+ setValue (thisAssemblyNode);
if (isUnified) {
thisAssemblyNode.AddApiStyle (ApiStyle.Unified);
n.ParentNode.RemoveChild(n);
}
- private static bool UpdateAssemblyVersions (XmlElement root, MemberReference member, bool add)
+ private bool UpdateAssemblyVersions (XmlElement root, MemberReference member, bool add)
{
TypeDefinition type = member as TypeDefinition;
if (type == null)
return assembly.Name.Version.ToString();
}
- private static bool UpdateAssemblyVersions(XmlElement root, AssemblyDefinition assembly, string[] assemblyVersions, bool add)
+ private bool UpdateAssemblyVersions(XmlElement root, AssemblyDefinition assembly, string[] assemblyVersions, bool add)
{
+ if (multiassembly)
+ return false;
+
XmlElement av = (XmlElement) root.SelectSingleNode ("AssemblyVersions");
if (av != null) {
// AssemblyVersions is not part of the spec
e = root.OwnerDocument.CreateElement("AssemblyInfo");
if (MDocUpdater.HasDroppedNamespace (assembly)) {
- e.SetAttribute ("apistyle", "unified");
+ e.AddApiStyle (ApiStyle.Unified);
}
root.AppendChild(e);
var thatNode = (XmlElement) root.SelectSingleNode (thatNodeFilter);
if (MDocUpdater.HasDroppedNamespace (assembly) && thatNode != null) {
// there's a classic node, we should add apistyles
- e.SetAttribute ("apistyle", "unified");
- thatNode.SetAttribute ("apistyle", "classic");
+ e.AddApiStyle (ApiStyle.Unified);
+ thatNode.AddApiStyle (ApiStyle.Classic);
}
return UpdateAssemblyVersionForAssemblyInfo (e, root, assemblyVersions, add);
if (string.IsNullOrWhiteSpace (existingValue) || existingValue != styleString) {
element.SetAttribute ("apistyle", styleString);
}
+
+ // Propagate the API style up to the membernode if necessary
+ if (element.LocalName == "AssemblyInfo" && element.ParentNode != null && element.ParentNode.LocalName == "Member") {
+ var member = element.ParentNode;
+ var unifiedAssemblyNode = member.SelectSingleNode ("AssemblyInfo[@apistyle='unified']");
+ var classicAssemblyNode = member.SelectSingleNode ("AssemblyInfo[not(@apistyle) or @apistyle='classic']");
+
+ var parentAttribute = element.ParentNode.Attributes ["apistyle"];
+ Action removeStyle = () => element.ParentNode.Attributes.Remove (parentAttribute);
+ Action propagateStyle = () => {
+ if (parentAttribute == null) {
+ // if it doesn't have the attribute, then add it
+ parentAttribute = element.OwnerDocument.CreateAttribute ("apistyle");
+ parentAttribute.Value = styleString;
+ element.ParentNode.Attributes.Append (parentAttribute);
+ }
+ };
+
+ if ((style == ApiStyle.Classic && unifiedAssemblyNode != null) || (style == ApiStyle.Unified && classicAssemblyNode != null))
+ removeStyle ();
+ else
+ propagateStyle ();
+ }
+ }
+ public static void AddApiStyle (this XmlNode node, ApiStyle style)
+ {
+ string styleString = style.ToString ().ToLowerInvariant ();
+ var existingAttribute = node.Attributes ["apistyle"];
+ if (existingAttribute == null) {
+ existingAttribute = node.OwnerDocument.CreateAttribute ("apistyle");
+ node.Attributes.Append (existingAttribute);
+ }
+ existingAttribute.Value = styleString;
}
public static void RemoveApiStyle (this XmlElement element, ApiStyle style)
{
public float Hello(int value) {
return 0.0f;
}
+ public double OnlyInClassic {get;set;}
+
#if DELETETEST
public string InBoth {get;set;}
public string InBothClassic {get;set;}
#endif
}
+ #if DELETETEST
+ public class TypeOnlyInClassic {}
+ #endif
+
#if DELETETEST && !V2
public class WillDelete {
public string Name {get;set;}
public float Hello(int value) {
return 0.0f;
}
+ public char OnlyInUnified {get;set;}
+
#if DELETETEST
public string InBoth {get;set;}
public string InBothUnified {get;set;}
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="OnlyInClassic" apistyle="classic">
+ <MemberSignature Language="C#" Value="public double OnlyInClassic { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance float64 OnlyInClassic" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Double</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInUnified" apistyle="unified">
+ <MemberSignature Language="C#" Value="public char OnlyInUnified { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance char OnlyInUnified" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Char</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="OnlyInClassic" apistyle="classic">
+ <MemberSignature Language="C#" Value="public double OnlyInClassic { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance float64 OnlyInClassic" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Double</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInUnified" apistyle="unified">
+ <MemberSignature Language="C#" Value="public char OnlyInUnified { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance char OnlyInUnified" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Char</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>
<Type Name="MyOtherClass" FullName="MyFramework.MyOtherNamespace.MyOtherClass">
<TypeSignature Language="C#" Value="public class MyOtherClass" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyOtherClass extends System.Object" />
- <AssemblyInfo>
+ <AssemblyInfo apistyle="classic">
<AssemblyName>DocTest-DropNS-classic-secondary</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="AddedInV2Classic">
+ <Member MemberName="AddedInV2Classic" apistyle="classic">
<MemberSignature Language="C#" Value="public string AddedInV2Classic { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string AddedInV2Classic" />
<MemberType>Property</MemberType>
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="AddedInV2Unified">
+ <Member MemberName="AddedInV2Unified" apistyle="unified">
<MemberSignature Language="C#" Value="public string AddedInV2Unified { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string AddedInV2Unified" />
<MemberType>Property</MemberType>
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="InBothClassic">
+ <Member MemberName="InBothClassic" apistyle="classic">
<MemberSignature Language="C#" Value="public string InBothClassic { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string InBothClassic" />
<MemberType>Property</MemberType>
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="InBothUnified">
+ <Member MemberName="InBothUnified" apistyle="unified">
<MemberSignature Language="C#" Value="public string InBothUnified { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string InBothUnified" />
<MemberType>Property</MemberType>
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="OnlyInClassic" apistyle="classic">
+ <MemberSignature Language="C#" Value="public double OnlyInClassic { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance float64 OnlyInClassic" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Double</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInUnified" apistyle="unified">
+ <MemberSignature Language="C#" Value="public char OnlyInUnified { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance char OnlyInUnified" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Char</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>
--- /dev/null
+<Type Name="TypeOnlyInClassic" FullName="MyFramework.MyNamespace.TypeOnlyInClassic">
+ <TypeSignature Language="C#" Value="public class TypeOnlyInClassic" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TypeOnlyInClassic extends System.Object" />
+ <AssemblyInfo apistyle="classic">
+ <AssemblyName>DocTest-DropNS-classic-deletetest</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public TypeOnlyInClassic ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
<MemberType>Constructor</MemberType>
<AssemblyInfo apistyle="classic">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <AssemblyInfo apistyle="classic">
- <AssemblyName>DocTest-DropNS-classic</AssemblyName>
- <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="classic">
<AssemblyName>DocTest-DropNS-classic-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
- <AssemblyInfo apistyle="unified">
- <AssemblyName>DocTest-DropNS-unified</AssemblyName>
- <AssemblyVersion>0.0.0.0</AssemblyVersion>
- </AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyName>DocTest-DropNS-unified-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<MemberType>Method</MemberType>
<AssemblyInfo apistyle="classic">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <AssemblyInfo apistyle="classic">
- <AssemblyName>DocTest-DropNS-classic</AssemblyName>
- <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="classic">
<AssemblyName>DocTest-DropNS-classic-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
- <AssemblyInfo apistyle="unified">
- <AssemblyName>DocTest-DropNS-unified</AssemblyName>
- <AssemblyVersion>0.0.0.0</AssemblyVersion>
- </AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyName>DocTest-DropNS-unified-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<MemberType>Property</MemberType>
<AssemblyInfo apistyle="classic">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="classic">
- <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ <AssemblyName>DocTest-DropNS-classic-multitest</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyName>DocTest-DropNS-unified-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInClassic" apistyle="classic">
+ <MemberSignature Language="C#" Value="public double OnlyInClassic { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance float64 OnlyInClassic" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ </AssemblyInfo>
<AssemblyInfo apistyle="classic">
<AssemblyName>DocTest-DropNS-classic-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Double</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInUnified" apistyle="unified">
+ <MemberSignature Language="C#" Value="public char OnlyInUnified { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance char OnlyInUnified" />
+ <MemberType>Property</MemberType>
<AssemblyInfo apistyle="unified">
- <AssemblyName>DocTest-DropNS-unified</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
</AssemblyInfo>
<AssemblyInfo apistyle="unified">
<AssemblyName>DocTest-DropNS-unified-multitest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
- <ReturnType>System.String</ReturnType>
+ <ReturnType>System.Char</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="OnlyInClassic" apistyle="classic">
+ <MemberSignature Language="C#" Value="public double OnlyInClassic { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance float64 OnlyInClassic" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyName>DocTest-DropNS-classic-multitest</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Double</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="OnlyInUnified" apistyle="unified">
+ <MemberSignature Language="C#" Value="public char OnlyInUnified { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance char OnlyInUnified" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyName>DocTest-DropNS-unified-multitest</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Char</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
</Members>
</Type>
<opcode name="mono_ldptr_int_req_flag" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x14" flow="next" />
<opcode name="mono_ldptr_card_table" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x15" flow="next" />
<opcode name="mono_ldptr_nursery_start" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x16" flow="next" />
+<opcode name="mono_ldptr_nursery_bits" input="Pop0" output="PushI" args="InlineNone" o1="0xF0" o2="0x17" flow="next" />
+<opcode name="mono_calli_extra_arg" input="VarPop" output="VarPush" args="InlineSig" o1="0xF0" o2="0x18" flow="call" />
</opdesc>
OPDEF(CEE_MONO_LDPTR_CARD_TABLE, "mono_ldptr_card_table", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x15, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_START, "mono_ldptr_nursery_start", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x16, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_BITS, "mono_ldptr_nursery_bits", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x17, NEXT)
+OPDEF(CEE_MONO_CALLI_EXTRA_ARG, "mono_calli_extra_arg", VarPop, VarPush, InlineSig, X, 2, 0xF0, 0x18, CALL)
#ifndef OPALIAS
#define _MONO_CIL_OPALIAS_DEFINED_
#define OPALIAS(a,s,r)
MonoPPDBFile*
mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
{
- MonoImage *ppdb_image;
+ MonoImage *ppdb_image = NULL;
const char *filename;
char *s, *ppdb_filename;
MonoImageOpenStatus status;
MonoPPDBFile *ppdb;
if (raw_contents) {
- ppdb_image = mono_image_open_from_data_internal ((char*)raw_contents, size, TRUE, &status, FALSE, TRUE, NULL);
+ if (size > 4 && strncmp ((char*)raw_contents, "BSJB", 4) == 0)
+ ppdb_image = mono_image_open_from_data_internal ((char*)raw_contents, size, TRUE, &status, FALSE, TRUE, NULL);
} else {
/* ppdb files drop the .exe/.dll extension */
filename = mono_image_get_filename (image);
scope_idx = start_scope_idx;
mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE);
locals_idx = cols [MONO_LOCALSCOPE_VARIABLELIST];
- while (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) {
+
+ // https://github.com/dotnet/roslyn/blob/2ae8d5fed96ab3f1164031f9b4ac827f53289159/docs/specs/PortablePdb-Metadata.md#LocalScopeTable
+ //
+ // The variableList attribute in the pdb metadata table is a contiguous array that starts at a
+ // given offset (locals_idx) above and
+ //
+ // """
+ // continues to the smaller of:
+ //
+ // the last row of the LocalVariable table
+ // the next run of LocalVariables, found by inspecting the VariableList of the next row in this LocalScope table.
+ // """
+ // this endpoint becomes locals_end_idx below
+
+ // March to the last scope that is in this method
+ while (scope_idx <= tables [MONO_TABLE_LOCALSCOPE].rows) {
mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE);
if (cols [MONO_LOCALSCOPE_METHOD] != method_idx)
break;
scope_idx ++;
}
+ // The number of scopes is the difference in the indices
+ // for the first and last scopes
nscopes = scope_idx - start_scope_idx;
- if (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) {
- locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows;
+
+ // Ends with "the last row of the LocalVariable table"
+ // this happens if the above loop marched one past the end
+ // of the rows
+ if (scope_idx > tables [MONO_TABLE_LOCALSCOPE].rows) {
+ locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows + 1;
} else {
+ // Ends with "the next run of LocalVariables,
+ // found by inspecting the VariableList of the next row in this LocalScope table."
locals_end_idx = cols [MONO_LOCALSCOPE_VARIABLELIST];
}
locals_idx = cols [MONO_LOCALSCOPE_VARIABLELIST];
if (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) {
- locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows;
+ locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows + 1;
} else {
locals_end_idx = mono_metadata_decode_row_col (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1 + 1, MONO_LOCALSCOPE_VARIABLELIST);
}
g_log ("mono-gc-finalizers", G_LOG_LEVEL_MESSAGE, "<%s at %p> Compiling finalizer.", o->vtable->klass->name, o);
if (!domain->finalize_runtime_invoke) {
- MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE, FALSE);
+ MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE);
domain->finalize_runtime_invoke = mono_compile_method (invoke);
}
klass = mono_class_from_mono_type (handle);
MONO_CHECK_ARG (handle, klass,);
+ if (klass->generic_container)
+ return;
+
vtable = mono_class_vtable_full (mono_domain_get (), klass, TRUE);
/* This will call the type constructor */
g_free (pair);
}
-static MonoMethodSignature*
-sig_to_rgctx_sig (MonoMethodSignature *sig)
-{
- // FIXME: memory allocation
- MonoMethodSignature *res;
- int i;
-
- res = (MonoMethodSignature *)g_malloc (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count + 1) * sizeof (MonoType*));
- memcpy (res, sig, MONO_SIZEOF_METHOD_SIGNATURE);
- res->param_count = sig->param_count + 1;
- for (i = 0; i < sig->param_count; ++i)
- res->params [i] = sig->params [i];
- res->params [sig->param_count] = &mono_defaults.int_class->byval_arg;
- return res;
-}
-
MonoMethod *
mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method)
{
SignaturePointerPair key;
SignaturePointerPair *new_key;
int local_i, local_len, local_delegates, local_d, local_target, local_res;
- int pos0, pos1, pos2, pos3, pos4;
+ int pos0, pos1, pos2;
char *name;
MonoClass *target_class = NULL;
gboolean closed_over_null = FALSE;
// FIXME:
mono_mb_emit_exception_full (mb, "System", "NotImplementedException", "");
} else {
- MonoMethodSignature *rgctx_sig;
-
- // FIXME: Support this for the other cases as well
- mono_mb_emit_ldarg (mb, 0);
- mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, rgctx));
- mono_mb_emit_byte (mb, CEE_LDIND_I);
- pos3 = mono_mb_emit_branch (mb, CEE_BRFALSE);
-
- /* Rgctx case */
- rgctx_sig = sig_to_rgctx_sig (sig);
-
mono_mb_emit_ldloc (mb, local_target);
for (i = 0; i < sig->param_count; ++i)
mono_mb_emit_ldarg (mb, i + 1);
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr));
mono_mb_emit_byte (mb, CEE_LDIND_I);
- mono_mb_emit_op (mb, CEE_CALLI, rgctx_sig);
- pos4 = mono_mb_emit_branch (mb, CEE_BR);
-
- /* Non-rgctx case */
- mono_mb_patch_branch (mb, pos3);
- mono_mb_emit_ldloc (mb, local_target);
- for (i = 0; i < sig->param_count; ++i)
- mono_mb_emit_ldarg (mb, i + 1);
- mono_mb_emit_ldarg (mb, 0);
- mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr));
- mono_mb_emit_byte (mb, CEE_LDIND_I );
- mono_mb_emit_op (mb, CEE_CALLI, sig);
-
- mono_mb_patch_branch (mb, pos4);
-
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_op (mb, CEE_MONO_CALLI_EXTRA_ARG, sig);
mono_mb_emit_byte (mb, CEE_RET);
}
mono_mb_emit_op (mb, CEE_CALL, target_method);
}
} else {
- MonoMethodSignature *rgctx_sig;
-
- mono_mb_emit_ldarg (mb, 0);
- mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, rgctx));
- mono_mb_emit_byte (mb, CEE_LDIND_I);
- pos3 = mono_mb_emit_branch (mb, CEE_BRFALSE);
-
- /* Rgctx case */
- rgctx_sig = sig_to_rgctx_sig (invoke_sig);
-
if (static_method_with_first_arg_bound) {
mono_mb_emit_ldloc (mb, local_target);
if (!MONO_TYPE_IS_REFERENCE (invoke_sig->params[0]))
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr));
mono_mb_emit_byte (mb, CEE_LDIND_I);
- mono_mb_emit_op (mb, CEE_CALLI, rgctx_sig);
- pos4 = mono_mb_emit_branch (mb, CEE_BR);
-
- /* Non-rgctx case */
- mono_mb_patch_branch (mb, pos3);
- if (static_method_with_first_arg_bound) {
- mono_mb_emit_ldloc (mb, local_target);
- if (!MONO_TYPE_IS_REFERENCE (invoke_sig->params[0]))
- mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (invoke_sig->params[0]));
- }
- for (i = 0; i < sig->param_count; ++i)
- mono_mb_emit_ldarg (mb, i + 1);
- mono_mb_emit_ldarg (mb, 0);
- mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr));
- mono_mb_emit_byte (mb, CEE_LDIND_I);
- mono_mb_emit_op (mb, CEE_CALLI, invoke_sig);
-
- mono_mb_patch_branch (mb, pos4);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_op (mb, CEE_MONO_CALLI_EXTRA_ARG, invoke_sig);
}
mono_mb_emit_byte (mb, CEE_RET);
mb->skip_visibility = 1;
#endif /* DISABLE_JIT */
+ info = mono_wrapper_info_create (mb, subtype);
+
if (ctx) {
MonoMethod *def;
- def = mono_mb_create_and_cache (cache, cache_key, mb, sig, sig->param_count + 16);
+ def = mono_mb_create_and_cache_full (cache, cache_key, mb, sig, sig->param_count + 16, info, NULL);
res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx);
} else if (callvirt) {
new_key = g_new0 (SignaturePointerPair, 1);
*new_key = key;
- info = mono_wrapper_info_create (mb, subtype);
-
res = mono_mb_create_and_cache_full (cache, new_key, mb, sig, sig->param_count + 16, info, &found);
if (found)
g_free (new_key);
} else {
- info = mono_wrapper_info_create (mb, subtype);
-
res = mono_mb_create_and_cache_full (cache, cache_key, mb, sig, sig->param_count + 16, info, NULL);
}
mono_mb_free (mb);
* it means that the compiled code for METHOD does not have to be looked up
* before calling the runtime invoke wrapper. In this case, the wrapper ignores
* its METHOD argument.
- * If PASS_RGCTX is TRUE, the signature of the called method is changed to include a 'gpointer rgctx' as the
- * last argument (after 'this').
*/
MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean pass_rgctx)
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
{
MonoMethodSignature *sig, *csig, *callsig;
MonoMethodBuilder *mb;
sig = mono_method_signature (method);
- if (pass_rgctx) {
- sig = sig_to_rgctx_sig (sig);
- callsig = sig_to_rgctx_sig (callsig);
- }
-
target_klass = get_wrapper_target_class (method->klass->image);
/* Try to share wrappers for non-corlib methods with simple signatures */
csig->call_convention = MONO_CALL_C;
#endif
- name = mono_signature_to_name (callsig, pass_rgctx ? (virtual_ ? "runtime_invoke_virtual_rgctx" : "runtime_invoke_rgctx") : (virtual_ ? "runtime_invoke_virtual" : "runtime_invoke"));
+ name = mono_signature_to_name (callsig, virtual_ ? "runtime_invoke_virtual" : "runtime_invoke");
mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE);
g_free (name);
info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL);
info->d.runtime_invoke.sig = callsig;
- info->d.runtime_invoke.pass_rgctx = pass_rgctx;
/* Somebody may have created it before us */
if (!res) {
MonoMethod *method;
/* For WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL */
MonoMethodSignature *sig;
- gboolean pass_rgctx;
} RuntimeInvokeWrapperInfo;
typedef struct {
mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method);
MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual, gboolean pass_rgctx);
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual);
MonoMethod*
mono_marshal_get_runtime_invoke_dynamic (void);
gpointer (*create_ftnptr) (MonoDomain *domain, gpointer addr);
gpointer (*get_addr_from_ftnptr) (gpointer descr);
char* (*get_runtime_build_info) (void);
- gpointer (*get_vtable_trampoline) (int slot_index);
- gpointer (*get_imt_trampoline) (int imt_slot_index);
+ gpointer (*get_vtable_trampoline) (MonoVTable *vtable, int slot_index);
+ gpointer (*get_imt_trampoline) (MonoVTable *vtable, int imt_slot_index);
+ gboolean (*imt_entry_inited) (MonoVTable *vtable, int imt_slot_index);
void (*set_cast_details) (MonoClass *from, MonoClass *to);
void (*debug_log) (int level, MonoString *category, MonoString *message);
gboolean (*debug_log_is_enabled) (void);
void
mono_install_imt_thunk_builder (MonoImtThunkBuilder func);
+void
+mono_set_always_build_imt_thunks (gboolean value);
+
void
mono_vtable_build_imt_slot (MonoVTable* vtable, int imt_slot);
static MonoJumpTrampoline arch_create_jump_trampoline = default_jump_trampoline;
static MonoDelegateTrampoline arch_create_delegate_trampoline = default_delegate_trampoline;
static MonoImtThunkBuilder imt_thunk_builder;
+static gboolean always_build_imt_thunks;
+
#if (MONO_IMT_SIZE > 32)
#error "MONO_IMT_SIZE cannot be larger than 32"
#endif
imt_thunk_builder = func;
}
+void
+mono_set_always_build_imt_thunks (gboolean value)
+{
+ always_build_imt_thunks = value;
+}
+
static MonoCompileFunc default_mono_compile_method = NULL;
/**
MONO_REQ_GC_NEUTRAL_MODE;
if (imt_builder_entry != NULL) {
- if (imt_builder_entry->children == 0 && !fail_tramp) {
+ if (imt_builder_entry->children == 0 && !fail_tramp && !always_build_imt_thunks) {
/* No collision, return the vtable slot contents */
return vtable->vtable [imt_builder_entry->value.vtable_slot];
} else {
* The IMT thunk might be called with an instance of one of the
* generic virtual methods, so has to fallback to the IMT trampoline.
*/
- imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], callbacks.get_imt_trampoline (i));
+ imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], callbacks.get_imt_trampoline (vt, i));
} else {
imt [i] = initialize_imt_slot (vt, domain, imt_builder [i], NULL);
}
mono_loader_lock (); /*FIXME build_imt_slots requires the loader lock.*/
mono_domain_lock (vtable->domain);
/* we change the slot only if it wasn't changed from the generic imt trampoline already */
- if (imt [imt_slot] == callbacks.get_imt_trampoline (imt_slot))
+ if (!callbacks.imt_entry_inited (vtable, imt_slot))
build_imt_slots (vtable->klass, vtable, vtable->domain, imt, NULL, imt_slot);
mono_domain_unlock (vtable->domain);
mono_loader_unlock ();
int imt_slot = MONO_IMT_SIZE + displacement;
/* Force the rebuild of the thunk at the next call */
- imt_trampoline = callbacks.get_imt_trampoline (imt_slot);
+ imt_trampoline = callbacks.get_imt_trampoline (vtable, imt_slot);
*vtable_slot = imt_trampoline;
} else {
- vtable_trampoline = callbacks.get_vtable_trampoline ? callbacks.get_vtable_trampoline ((gpointer*)vtable_slot - (gpointer*)vtable->vtable) : NULL;
+ vtable_trampoline = callbacks.get_vtable_trampoline ? callbacks.get_vtable_trampoline (vtable, (gpointer*)vtable_slot - (gpointer*)vtable->vtable) : NULL;
entries = get_generic_virtual_entries (domain, vtable_slot);
if (callbacks.get_vtable_trampoline) {
// This also covers the AOT case
for (i = 0; i < klass->vtable_size; ++i) {
- vt->vtable [i] = callbacks.get_vtable_trampoline (i);
+ vt->vtable [i] = callbacks.get_vtable_trampoline (vt, i);
}
} else {
mono_class_setup_vtable (klass);
if (imt_table_bytes) {
/* Now that the vtable is full, we can actually fill up the IMT */
for (i = 0; i < MONO_IMT_SIZE; ++i)
- interface_offsets [i] = callbacks.get_imt_trampoline (i);
+ interface_offsets [i] = callbacks.get_imt_trampoline (vt, i);
}
/*
MonoMethod *wrapper;
if (!method)
return NULL;
- wrapper = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+ wrapper = mono_marshal_get_runtime_invoke (method, FALSE);
domain->capture_context_runtime_invoke = mono_compile_method (wrapper);
domain->capture_context_method = mono_compile_method (method);
}
if (nursery_canaries_enabled ())
sgen_set_use_managed_allocator (FALSE);
+
+#if defined(HAVE_KW_THREAD)
+ /* This can happen with using libmonosgen.so */
+ if (mono_tls_key_get_offset (TLS_KEY_SGEN_TLAB_NEXT_ADDR) == -1)
+ sgen_set_use_managed_allocator (FALSE);
+#endif
}
void
cp $(llvmonly_regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --aot=llvmonly fullaot-tmp/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
ln -s $$PWD/mono fullaot-tmp/
- for i in $(llvmonly_regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --llvmonly fullaot-tmp/$$i --exclude '!FULLAOT' --exclude '!BITCODE' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
+ for i in $(llvmonly_regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --llvmonly fullaot-tmp/$$i --exclude '!FULLAOT' --exclude '!BITCODE' || exit 1; done
gccheck: gc-test.exe
MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe
gboolean dump_json;
} MonoAotOptions;
+typedef enum {
+ METHOD_CAT_NORMAL,
+ METHOD_CAT_GSHAREDVT,
+ METHOD_CAT_INST,
+ METHOD_CAT_WRAPPER,
+ METHOD_CAT_NUM
+} MethodCategory;
+
typedef struct MonoAotStats {
int ccount, mcount, lmfcount, abscount, gcount, ocount, genericcount;
gint64 code_size, info_size, ex_info_size, unwind_info_size, got_size, class_info_size, got_info_size, plt_size;
int methods_without_got_slots, direct_calls, all_calls, llvm_count;
int got_slots, offsets_size;
+ int method_categories [METHOD_CAT_NUM];
int got_slot_types [MONO_PATCH_INFO_NONE];
int got_slot_info_sizes [MONO_PATCH_INFO_NONE];
int jit_time, gen_time, link_time;
acfg->table_offsets [(int)table] = acfg->datafile_offset;
fwrite (data,1, size, acfg->data_outfile);
acfg->datafile_offset += size;
+ // align the data to 8 bytes. Put zeros in the file (so that every build results in consistent output).
+ int align = 8 - size % 8;
+ acfg->datafile_offset += align;
+ guint8 align_buf [16];
+ memset (&align_buf, 0, sizeof (align_buf));
+ fwrite (align_buf, align, 1, acfg->data_outfile);
} else if (acfg->llvm) {
mono_llvm_emit_aot_data (symbol, data, size);
} else {
case MONO_WRAPPER_RUNTIME_INVOKE: {
g_assert (info);
encode_value (info->subtype, p, &p);
- encode_value (info->d.runtime_invoke.pass_rgctx, p, &p);
if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT || info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL)
encode_method_ref (acfg, info->d.runtime_invoke.method, p, &p);
else if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL)
mb = mono_mb_new (mono_defaults.object_class, "FOO", MONO_WRAPPER_NONE);
m = mono_mb_create_method (mb, sig, 16);
- return mono_marshal_get_runtime_invoke (m, FALSE, FALSE);
+ return mono_marshal_get_runtime_invoke (m, FALSE);
}
static MonoMethod*
get_runtime_invoke (MonoAotCompile *acfg, MonoMethod *method, gboolean virtual_)
{
- return mono_marshal_get_runtime_invoke (method, virtual_, acfg->aot_opts.llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE));
+ return mono_marshal_get_runtime_invoke (method, virtual_);
}
static gboolean
}
#endif
- if (!skip && acfg->aot_opts.llvm_only && (acfg->opts & MONO_OPT_GSHAREDVT) && mini_gsharedvt_runtime_invoke_supported (sig))
+ if (acfg->aot_opts.llvm_only && (acfg->opts & MONO_OPT_GSHAREDVT))
/* Supported by the gsharedvt based runtime-invoke wrapper */
skip = TRUE;
continue;
}
- if (klass->rank && MONO_TYPE_IS_PRIMITIVE (&klass->element_class->byval_arg)) {
+ if (!acfg->aot_opts.llvm_only && klass->rank && MONO_TYPE_IS_PRIMITIVE (&klass->element_class->byval_arg)) {
MonoMethod *m, *wrapper;
/* Add runtime-invoke wrappers too */
return TRUE;
}
+static gboolean
+is_concrete_type (MonoType *t)
+{
+ MonoClass *klass;
+ int i;
+
+ if (t->type == MONO_TYPE_VAR || t->type == MONO_TYPE_MVAR)
+ return FALSE;
+ if (t->type == MONO_TYPE_GENERICINST) {
+ MonoGenericContext *orig_ctx;
+ MonoGenericInst *inst;
+ MonoType *arg;
+
+ if (!MONO_TYPE_ISSTRUCT (t))
+ return TRUE;
+ klass = mono_class_from_mono_type (t);
+ orig_ctx = &klass->generic_class->context;
+
+ inst = orig_ctx->class_inst;
+ if (inst) {
+ for (i = 0; i < inst->type_argc; ++i) {
+ arg = mini_get_underlying_type (inst->type_argv [i]);
+ if (!is_concrete_type (arg))
+ return FALSE;
+ }
+ }
+ inst = orig_ctx->method_inst;
+ if (inst) {
+ for (i = 0; i < inst->type_argc; ++i) {
+ arg = mini_get_underlying_type (inst->type_argv [i]);
+ if (!is_concrete_type (arg))
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+
/* LOCKING: Assumes the loader lock is held */
static void
add_gsharedvt_wrappers (MonoAotCompile *acfg, MonoMethodSignature *sig, gboolean gsharedvt_in, gboolean gsharedvt_out)
//printf ("%s\n", mono_signature_full_name (sig));
copy->ret = mini_get_underlying_type (sig->ret);
- // FIXME: Add more cases
- if (copy->ret->type == MONO_TYPE_VAR || copy->ret->type == MONO_TYPE_MVAR || copy->ret->type == MONO_TYPE_GENERICINST)
+ if (!is_concrete_type (copy->ret))
concrete = FALSE;
for (i = 0; i < sig->param_count; ++i) {
copy->params [i] = mini_get_underlying_type (sig->params [i]);
- if (copy->params [i]->type == MONO_TYPE_VAR || copy->params [i]->type == MONO_TYPE_MVAR || copy->params [i]->type == MONO_TYPE_GENERICINST)
+ if (!is_concrete_type (copy->params [i]))
concrete = FALSE;
}
if (concrete) {
copy->has_type_parameters = 0;
- sig = copy;
if (gsharedvt_in) {
- MonoMethod *wrapper = mini_get_gsharedvt_in_sig_wrapper (sig);
+ wrapper = mini_get_gsharedvt_in_sig_wrapper (copy);
+ add_extra_method (acfg, wrapper);
+ }
+
+ if (gsharedvt_out) {
+ wrapper = mini_get_gsharedvt_out_sig_wrapper (copy);
add_extra_method (acfg, wrapper);
}
/* Lock for the rest of the code */
mono_acfg_lock (acfg);
+ if (cfg->gsharedvt)
+ acfg->stats.method_categories [METHOD_CAT_GSHAREDVT] ++;
+ else if (cfg->gshared)
+ acfg->stats.method_categories [METHOD_CAT_INST] ++;
+ else if (cfg->method->wrapper_type)
+ acfg->stats.method_categories [METHOD_CAT_WRAPPER] ++;
+ else
+ acfg->stats.method_categories [METHOD_CAT_NORMAL] ++;
+
/*
* Check for methods/klasses we can't encode.
*/
"mono_aot_init_gshared_method_this",
"mono_aot_init_gshared_method_rgctx",
"mono_llvm_throw_corlib_exception",
- "mono_resolve_vcall",
+ "mono_init_vtable_slot",
"mono_helper_ldstr_mscorlib"
};
for (i = 0; i < MONO_PATCH_INFO_NONE; ++i)
if (acfg->stats.got_slot_types [i])
aot_printf (acfg, "\t%s: %d (%d)\n", get_patch_name (i), acfg->stats.got_slot_types [i], acfg->stats.got_slot_info_sizes [i]);
+ aot_printf (acfg, "\nMethod stats:\n");
+ aot_printf (acfg, "\tNormal: %d\n", acfg->stats.method_categories [METHOD_CAT_NORMAL]);
+ aot_printf (acfg, "\tInstance: %d\n", acfg->stats.method_categories [METHOD_CAT_INST]);
+ aot_printf (acfg, "\tGSharedvt: %d\n", acfg->stats.method_categories [METHOD_CAT_GSHAREDVT]);
+ aot_printf (acfg, "\tWrapper: %d\n", acfg->stats.method_categories [METHOD_CAT_WRAPPER]);
}
aot_printf (acfg, "JIT time: %d ms, Generation time: %d ms, Assembly+Link time: %d ms.\n", acfg->stats.jit_time / 1000, acfg->stats.gen_time / 1000, acfg->stats.link_time / 1000);
}
case MONO_WRAPPER_RUNTIME_INVOKE: {
int subtype = decode_value (p, &p);
- int pass_rgctx = decode_value (p, &p);
if (!target)
return FALSE;
if (!m)
return FALSE;
- ref->method = mono_marshal_get_runtime_invoke (m, FALSE, pass_rgctx);
+ ref->method = mono_marshal_get_runtime_invoke (m, FALSE);
} else if (subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL) {
/* Virtual direct wrapper */
MonoMethod *m = decode_resolve_method_ref (module, p, &p);
if (!m)
return FALSE;
- ref->method = mono_marshal_get_runtime_invoke (m, TRUE, pass_rgctx);
+ ref->method = mono_marshal_get_runtime_invoke (m, TRUE);
} else {
MonoMethodSignature *sig;
if (info->subtype != subtype)
return FALSE;
- if (info->d.runtime_invoke.pass_rgctx != pass_rgctx)
- return FALSE;
g_assert (info->d.runtime_invoke.sig);
if (mono_metadata_signature_equal (sig, info->d.runtime_invoke.sig))
ref->method = target;
break;
}
- /* Special case: wrappers of shared generic methods */
- if (m && method->wrapper_type && m->wrapper_type == m->wrapper_type &&
+ /*
+ * Special case: wrappers of shared generic methods.
+ * This is needed because of the way mini_get_shared_method () works,
+ * we could end up with multiple copies of the same wrapper.
+ */
+ if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
MonoMethod *w1 = mono_marshal_method_from_wrapper (method);
MonoMethod *w2 = mono_marshal_method_from_wrapper (m);
break;
}
}
+ if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
+ method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
+ WrapperInfo *info1 = mono_marshal_get_wrapper_info (method);
+ WrapperInfo *info2 = mono_marshal_get_wrapper_info (m);
+
+ if (info1 && info2 && info1->subtype == info2->subtype && method->klass == m->klass) {
+ index = value;
+ break;
+ }
+ }
/* Methods decoded needlessly */
if (m) {
public static T GetValue<T>(Nullable<T> value) where T : struct {
return value.Value;
}
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static Nullable<T> Get<T>(T t) where T : struct {
+ return t;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static Nullable<T> GetNull<T>() where T : struct {
+ return null;
+ }
}
[Category ("DYNCALL")]
var res = (int)typeof (NullableMethods).GetMethod ("GetValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
if (res != 42)
return 3;
+
+ NullableMethods.Get (42);
+ var res2 = (int?)typeof (NullableMethods).GetMethod ("Get").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { 42 });
+ if (res2 != 42)
+ return 4;
+ res2 = (int?)typeof (NullableMethods).GetMethod ("GetNull").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { });
+ if (res2.HasValue)
+ return 5;
return 0;
}
return 2;
return 0;
}
+
+ struct FpStruct {
+ public float a, b, c;
+ }
+
+ struct LargeStruct2 {
+ public FpStruct x;
+ public int a, b, c, d, e, f, g, h;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static int pass_hfa_on_stack (FpStruct s1, FpStruct s2, FpStruct s3) {
+ return (int)s3.c;
+ }
+
+ public static int test_10_arm64_hfa_on_stack_llvm () {
+ var arr = new LargeStruct2 [10, 10];
+ for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
+ arr [i, j].x = new FpStruct ();
+
+ var s1 = new FpStruct () { a = 1, b = 1, c = 10 };
+ return pass_hfa_on_stack (s1, s1, s1);
+ }
}
ret
}
+ .method public static int32 test_5_endfinally_llvm_linking () il managed {
+ .maxstack 16
+
+ .try {
+ leave IL_0
+ }
+ finally {
+ ldc.i4.0
+ dup
+ brtrue L1
+ pop
+ br L2
+ L1:
+ pop
+ L2:
+ endfinally
+ }
+ IL_0: ldc.i4.5
+ ret
+ }
+
.method public static int32 test_0_conv_ovf_i8_neg () il managed {
.maxstack 16
* resolve_iface_call:
*
* Return the executable code for the iface method IMT_METHOD called on THIS.
+ * This function is called on a slowpath, so it doesn't need to be fast.
+ * This returns an ftnptr by returning the address part, and the arg in the OUT_ARG
+ * out parameter.
*/
static gpointer
resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg, gboolean caller_gsharedvt)
gpointer addr, compiled_method, aot_addr;
gboolean need_rgctx_tramp = FALSE, need_unbox_tramp = FALSE;
- // FIXME: Optimize this
-
if (!this_obj)
/* The caller will handle it */
return NULL;
target, addr);
}
- *vtable_slot = addr;
-
return addr;
}
-gpointer
-mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg)
-{
- return resolve_iface_call (this_obj, imt_slot, imt_method, out_arg, FALSE);
-}
-
gpointer
mono_resolve_iface_call_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg)
{
}
/*
- * mono_resolve_vcall:
+ * resolve_vcall:
*
- * Return the executable code for calling this_obj->vtable [slot].
+ * Return the executable code for calling vt->vtable [slot].
+ * This function is called on a slowpath, so it doesn't need to be fast.
+ * This returns an ftnptr by returning the address part, and the arg in the OUT_ARG
+ * out parameter.
*/
static gpointer
-resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_arg, gboolean gsharedvt)
+resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_arg, gboolean gsharedvt)
{
- MonoVTable *vt;
MonoMethod *m, *generic_virtual = NULL;
- gpointer *vtable_slot;
gpointer addr, compiled_method;
gboolean need_unbox_tramp = FALSE;
- // FIXME: Optimize this
-
- if (!this_obj)
- /* The caller will handle it */
- return NULL;
-
- vt = this_obj->vtable;
-
- vtable_slot = &(vt->vtable [slot]);
-
/* Same as in common_call_trampoline () */
/* Avoid loading metadata or creating a generic vtable if possible */
addr = mono_aot_get_method_from_vt_slot (mono_domain_get (), vt, slot);
- if (addr && !vt->klass->valuetype) {
- if (mono_domain_owns_vtable_slot (mono_domain_get (), vtable_slot))
- *vtable_slot = addr;
-
+ if (addr && !vt->klass->valuetype)
return mono_create_ftnptr (mono_domain_get (), addr);
- }
m = mono_class_get_vtable_entry (vt->klass, slot);
addr = compiled_method = mono_compile_method (m);
g_assert (addr);
- addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, need_unbox_tramp, out_arg);
-
- // FIXME: Unify this with mono_resolve_iface_call
-
- *vtable_slot = addr;
-
- if (gsharedvt) {
- /*
- * The callee uses the gsharedvt calling convention, have to add an out wrapper.
- */
- g_assert (out_arg);
- g_assert (*out_arg);
+ addr = mini_add_method_wrappers_llvmonly (m, addr, gsharedvt, need_unbox_tramp, out_arg);
- gpointer out_wrapper = mini_get_gsharedvt_wrapper (FALSE, NULL, mono_method_signature (imt_method), NULL, -1, FALSE);
- gpointer *out_wrapper_arg = mini_create_llvmonly_ftndesc (addr, *out_arg);
+ if (!gsharedvt && generic_virtual) {
+ // FIXME: This wastes memory since add_generic_virtual_invocation ignores it in a lot of cases
+ MonoFtnDesc *ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, out_arg);
- addr = out_wrapper;
- *out_arg = out_wrapper_arg;
+ mono_method_add_generic_virtual_invocation (mono_domain_get (),
+ vt, vt->vtable + slot,
+ generic_virtual, ftndesc);
}
return addr;
}
gpointer
-mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
+mono_resolve_vcall_gsharedvt (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_arg)
+{
+ g_assert (this_obj);
+
+ return resolve_vcall (this_obj->vtable, slot, imt_method, out_arg, TRUE);
+}
+
+/*
+ * mono_resolve_generic_virtual_call:
+ *
+ * Resolve a generic virtual call.
+ * This function is called on a slowpath, so it doesn't need to be fast.
+ */
+MonoFtnDesc*
+mono_resolve_generic_virtual_call (MonoVTable *vt, int slot, MonoMethod *generic_virtual)
+{
+ MonoMethod *m;
+ gpointer addr, compiled_method;
+ gboolean need_unbox_tramp = FALSE;
+ MonoError error;
+ MonoGenericContext context = { NULL, NULL };
+ MonoMethod *declaring;
+ gpointer arg = NULL;
+
+ m = mono_class_get_vtable_entry (vt->klass, slot);
+
+ g_assert (is_generic_method_definition (m));
+
+ if (m->is_inflated)
+ declaring = mono_method_get_declaring_generic_method (m);
+ else
+ declaring = m;
+
+ if (m->klass->generic_class)
+ context.class_inst = m->klass->generic_class->context.class_inst;
+ else
+ g_assert (!m->klass->generic_container);
+
+ g_assert (generic_virtual->is_inflated);
+ context.method_inst = ((MonoMethodInflated*)generic_virtual)->context.method_inst;
+
+ m = mono_class_inflate_generic_method_checked (declaring, &context, &error);
+ g_assert (mono_error_ok (&error));
+
+ if (vt->klass->valuetype)
+ need_unbox_tramp = TRUE;
+
+ // FIXME: This can throw exceptions
+ addr = compiled_method = mono_compile_method (m);
+ g_assert (addr);
+
+ addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, need_unbox_tramp, &arg);
+
+ /*
+ * This wastes memory but the memory usage is bounded since
+ * mono_method_add_generic_virtual_invocation () eventually builds an imt thunk for
+ * this vtable slot so we are not called any more for this instantiation.
+ */
+ MonoFtnDesc *ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
+
+ mono_method_add_generic_virtual_invocation (mono_domain_get (),
+ vt, vt->vtable + slot,
+ generic_virtual, ftndesc);
+ return ftndesc;
+}
+
+/*
+ * mono_resolve_generic_virtual_call:
+ *
+ * Resolve a generic virtual call on interfaces.
+ * This function is called on a slowpath, so it doesn't need to be fast.
+ */
+MonoFtnDesc*
+mono_resolve_generic_virtual_iface_call (MonoVTable *vt, int imt_slot, MonoMethod *generic_virtual)
{
- return resolve_vcall (this_obj, slot, imt_method, out_rgctx_arg, FALSE);
+ MonoMethod *m, *variant_iface;
+ gpointer addr, aot_addr, compiled_method;
+ gboolean need_unbox_tramp = FALSE;
+ gboolean need_rgctx_tramp;
+ gpointer arg = NULL;
+ gpointer *imt;
+
+ imt = (gpointer*)vt - MONO_IMT_SIZE;
+
+ mini_resolve_imt_method (vt, imt + imt_slot, generic_virtual, &m, &aot_addr, &need_rgctx_tramp, &variant_iface);
+ g_assert (!variant_iface);
+
+ if (vt->klass->valuetype)
+ need_unbox_tramp = TRUE;
+
+ // FIXME: This can throw exceptions
+ addr = compiled_method = mono_compile_method (m);
+ g_assert (addr);
+
+ addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, need_unbox_tramp, &arg);
+
+ /*
+ * This wastes memory but the memory usage is bounded since
+ * mono_method_add_generic_virtual_invocation () eventually builds an imt thunk for
+ * this vtable slot so we are not called any more for this instantiation.
+ */
+ MonoFtnDesc *ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
+
+ mono_method_add_generic_virtual_invocation (mono_domain_get (),
+ vt, imt + imt_slot,
+ generic_virtual, ftndesc);
+ return ftndesc;
}
+/*
+ * mono_init_vtable_slot:
+ *
+ * Initialize slot SLOT of VTABLE.
+ * Return the contents of the vtable slot.
+ */
gpointer
-mono_resolve_vcall_gsharedvt (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
+mono_init_vtable_slot (MonoVTable *vtable, int slot)
+{
+ gpointer arg = NULL;
+ gpointer addr;
+ gpointer *ftnptr;
+
+ addr = resolve_vcall (vtable, slot, NULL, &arg, FALSE);
+ ftnptr = mono_domain_alloc0 (vtable->domain, 2 * sizeof (gpointer));
+ ftnptr [0] = addr;
+ ftnptr [1] = arg;
+ mono_memory_barrier ();
+
+ vtable->vtable [slot] = ftnptr;
+
+ return ftnptr;
+}
+
+static gboolean
+is_callee_gsharedvt_variable (gpointer addr)
{
- return resolve_vcall (this_obj, slot, imt_method, out_rgctx_arg, TRUE);
+ MonoJitInfo *ji;
+ gboolean callee_gsharedvt;
+
+ ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (addr), NULL);
+ g_assert (ji);
+ callee_gsharedvt = mini_jit_info_is_gsharedvt (ji);
+ if (callee_gsharedvt)
+ callee_gsharedvt = mini_is_gsharedvt_variable_signature (mono_method_signature (jinfo_get_method (ji)));
+ return callee_gsharedvt;
}
/*
del->method = method;
del->method_ptr = mono_compile_method (method);
- del->method_ptr = mini_add_method_wrappers_llvmonly (method, del->method_ptr, FALSE, FALSE, &del->rgctx);
- if (!del->rgctx) {
- if (mono_method_needs_static_rgctx_invoke (method, FALSE))
- del->rgctx = mini_method_get_rgctx (method);
+ if (mono_method_needs_static_rgctx_invoke (method, FALSE))
+ del->rgctx = mini_method_get_rgctx (method);
+
+ /*
+ * Avoid adding gsharedvt in wrappers since they might not exist if
+ * this delegate is called through a gsharedvt delegate invoke wrapper.
+ * Instead, encode that the method is gsharedvt in del->rgctx,
+ * the CEE_MONO_CALLI_EXTRA_ARG implementation in the JIT depends on this.
+ */
+ if (is_callee_gsharedvt_variable (del->method_ptr)) {
+ g_assert ((((mgreg_t)del->rgctx) & 1) == 0);
+ del->rgctx = (gpointer)(((mgreg_t)del->rgctx) | 1);
}
}
del->method = method;
del->method_ptr = mono_compile_method (method);
- del->method_ptr = mini_add_method_wrappers_llvmonly (method, del->method_ptr, FALSE, FALSE, &del->rgctx);
- if (!del->rgctx) {
- if (mono_method_needs_static_rgctx_invoke (method, FALSE))
- del->rgctx = mini_method_get_rgctx (method);
+ if (mono_method_needs_static_rgctx_invoke (method, FALSE))
+ del->rgctx = mini_method_get_rgctx (method);
+
+ if (is_callee_gsharedvt_variable (del->method_ptr)) {
+ g_assert ((((mgreg_t)del->rgctx) & 1) == 0);
+ del->rgctx = (gpointer)(((mgreg_t)del->rgctx) | 1);
}
}
gpointer mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index);
-gpointer mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
-
-gpointer mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_arg);
-
gpointer mono_resolve_iface_call_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
gpointer mono_resolve_vcall_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
+MonoFtnDesc* mono_resolve_generic_virtual_call (MonoVTable *vt, int slot, MonoMethod *imt_method);
+
+MonoFtnDesc* mono_resolve_generic_virtual_iface_call (MonoVTable *vt, int imt_slot, MonoMethod *imt_method);
+
+gpointer mono_init_vtable_slot (MonoVTable *vtable, int slot);
+
void mono_init_delegate (MonoDelegate *del, MonoObject *target, MonoMethod *method);
void mono_init_delegate_virtual (MonoDelegate *del, MonoObject *target, MonoMethod *method);
void
mono_llvm_cpp_throw_exception (void)
{
+#ifdef MONO_LLVM_LOADED
+ g_assert_not_reached ();
+#else
gint32 *ex = NULL;
/* The generated code catches an int32* */
throw ex;
+#endif
}
}
static int inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **sp,
guchar *ip, guint real_offset, gboolean inline_always);
+static MonoInst*
+emit_llvmonly_virtual_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, int context_used, MonoInst **sp);
/* helper methods signatures */
static MonoMethodSignature *helper_sig_domain_get;
static MonoMethodSignature *helper_sig_rgctx_lazy_fetch_trampoline;
+static MonoMethodSignature *helper_sig_llvmonly_imt_thunk;
/*
* Instruction metadata
{
helper_sig_domain_get = mono_create_icall_signature ("ptr");
helper_sig_rgctx_lazy_fetch_trampoline = mono_create_icall_signature ("ptr ptr");
+ helper_sig_llvmonly_imt_thunk = mono_create_icall_signature ("ptr ptr ptr");
}
static MONO_NEVER_INLINE void
if (!sig)
sig = mono_method_signature (method);
- if (cfg->llvm_only && (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
- MonoInst *icall_args [16];
- MonoInst *ins;
-
- // FIXME: Optimize this
-
- guint32 imt_slot = mono_method_get_imt_slot (method);
-
- icall_args [0] = this_ins;
- EMIT_NEW_ICONST (cfg, icall_args [1], imt_slot);
- if (imt_arg) {
- icall_args [2] = imt_arg;
- } else {
- EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_METHODCONST, method);
- icall_args [2] = ins;
- }
- EMIT_NEW_PCONST (cfg, icall_args [3], NULL);
-
- call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call, icall_args);
- }
+ if (cfg->llvm_only && (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+ g_assert_not_reached ();
if (rgctx_arg) {
rgctx_reg = mono_alloc_preg (cfg);
}
#endif
- if (cfg->llvm_only && !call_target && virtual_ && (method->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
- // FIXME: Vcall optimizations below
- MonoInst *icall_args [16];
- MonoInst *ins;
- int rgctx_reg;
-
- if (sig->generic_param_count) {
- /*
- * Generic virtual call, pass the concrete method as the imt argument.
- */
- imt_arg = emit_get_rgctx_method (cfg, context_used,
- method, MONO_RGCTX_INFO_METHOD);
- }
-
- // FIXME: Optimize this
-
- int slot = mono_method_get_vtable_index (method);
-
- icall_args [0] = this_ins;
- EMIT_NEW_ICONST (cfg, icall_args [1], slot);
- if (imt_arg) {
- icall_args [2] = imt_arg;
- } else {
- EMIT_NEW_PCONST (cfg, ins, NULL);
- icall_args [2] = ins;
- }
- rgctx_reg = alloc_preg (cfg);
- MONO_EMIT_NEW_PCONST (cfg, rgctx_reg, NULL);
- EMIT_NEW_VARLOADA_VREG (cfg, icall_args [3], rgctx_reg, &mono_defaults.int_class->byval_arg);
- call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall, icall_args);
- }
+ if (cfg->llvm_only && !call_target && virtual_ && (method->flags & METHOD_ATTRIBUTE_VIRTUAL))
+ return emit_llvmonly_virtual_call (cfg, method, sig, 0, args);
need_unbox_trampoline = method->klass == mono_defaults.object_class || (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE);
return NULL;
}
+static MonoInst*
+emit_llvmonly_virtual_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, int context_used, MonoInst **sp)
+{
+ MonoInst *icall_args [16];
+ MonoInst *call_target, *ins, *vtable_ins;
+ int arg_reg, this_reg, vtable_reg;
+ gboolean is_iface = cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE;
+ gboolean is_gsharedvt = cfg->gsharedvt && mini_is_gsharedvt_variable_signature (fsig);
+ guint32 slot;
+ int offset;
+
+ /*
+ * In llvm-only mode, vtables contain function descriptors instead of
+ * method addresses/trampolines.
+ */
+ MONO_EMIT_NULL_CHECK (cfg, sp [0]->dreg);
+
+ if (is_iface)
+ slot = mono_method_get_imt_slot (cmethod);
+ else
+ slot = mono_method_get_vtable_index (cmethod);
+
+ this_reg = sp [0]->dreg;
+
+ if (!fsig->generic_param_count && !is_iface && !is_gsharedvt) {
+ /*
+ * The simplest case, a normal virtual call.
+ */
+ int slot_reg = alloc_preg (cfg);
+ int addr_reg = alloc_preg (cfg);
+ int arg_reg = alloc_preg (cfg);
+ MonoBasicBlock *non_null_bb;
+
+ vtable_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, vtable_ins, OP_LOAD_MEMBASE, vtable_reg, this_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
+ offset = MONO_STRUCT_OFFSET (MonoVTable, vtable) + (slot * SIZEOF_VOID_P);
+
+ /* Load the vtable slot, which contains a function descriptor. */
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, slot_reg, vtable_reg, offset);
+
+ NEW_BBLOCK (cfg, non_null_bb);
+
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, slot_reg, 0);
+ cfg->cbb->last_ins->flags |= MONO_INST_LIKELY;
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, non_null_bb);
+
+ /* Slow path */
+ // FIXME: Make the wrapper use the preserveall cconv
+ // FIXME: Use one icall per slot for small slot numbers ?
+ icall_args [0] = vtable_ins;
+ EMIT_NEW_ICONST (cfg, icall_args [1], slot);
+ /* Make the icall return the vtable slot value to save some code space */
+ ins = mono_emit_jit_icall (cfg, mono_init_vtable_slot, icall_args);
+ ins->dreg = slot_reg;
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, non_null_bb);
+
+ /* Fastpath */
+ MONO_START_BB (cfg, non_null_bb);
+ /* Load the address + arg from the vtable slot */
+ EMIT_NEW_LOAD_MEMBASE (cfg, call_target, OP_LOAD_MEMBASE, addr_reg, slot_reg, 0);
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, arg_reg, slot_reg, SIZEOF_VOID_P);
+
+ return emit_extra_arg_calli (cfg, fsig, sp, arg_reg, call_target);
+ }
+
+ if (!fsig->generic_param_count && is_iface && !is_gsharedvt) {
+ /*
+ * A simple interface call
+ *
+ * We make a call through an imt slot to obtain the function descriptor we need to call.
+ * The imt slot contains a function descriptor for a runtime function + arg.
+ */
+ int slot_reg = alloc_preg (cfg);
+ int addr_reg = alloc_preg (cfg);
+ int arg_reg = alloc_preg (cfg);
+ MonoInst *thunk_addr_ins, *thunk_arg_ins, *ftndesc_ins;
+
+ vtable_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, vtable_ins, OP_LOAD_MEMBASE, vtable_reg, this_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
+ offset = ((gint32)slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
+
+ /*
+ * The slot is already initialized when the vtable is created so there is no need
+ * to check it here.
+ */
+
+ /* Load the imt slot, which contains a function descriptor. */
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, slot_reg, vtable_reg, offset);
+
+ /* Load the address + arg of the imt thunk from the imt slot */
+ EMIT_NEW_LOAD_MEMBASE (cfg, thunk_addr_ins, OP_LOAD_MEMBASE, addr_reg, slot_reg, 0);
+ EMIT_NEW_LOAD_MEMBASE (cfg, thunk_arg_ins, OP_LOAD_MEMBASE, arg_reg, slot_reg, SIZEOF_VOID_P);
+ /*
+ * IMT thunks in llvm-only mode are C functions which take an info argument
+ * plus the imt method and return the ftndesc to call.
+ */
+ icall_args [0] = thunk_arg_ins;
+ icall_args [1] = emit_get_rgctx_method (cfg, context_used,
+ cmethod, MONO_RGCTX_INFO_METHOD);
+ ftndesc_ins = mono_emit_calli (cfg, helper_sig_llvmonly_imt_thunk, icall_args, thunk_addr_ins, NULL, NULL);
+
+ return emit_llvmonly_calli (cfg, fsig, sp, ftndesc_ins);
+ }
+
+ if (fsig->generic_param_count && !is_gsharedvt) {
+ /*
+ * This is similar to the interface case, the vtable slot points to an imt thunk which is
+ * dynamically extended as more instantiations are discovered.
+ * This handles generic virtual methods both on classes and interfaces.
+ */
+ int slot_reg = alloc_preg (cfg);
+ int addr_reg = alloc_preg (cfg);
+ int arg_reg = alloc_preg (cfg);
+ int ftndesc_reg = alloc_preg (cfg);
+ MonoInst *thunk_addr_ins, *thunk_arg_ins, *ftndesc_ins;
+ MonoBasicBlock *slowpath_bb, *end_bb;
+
+ NEW_BBLOCK (cfg, slowpath_bb);
+ NEW_BBLOCK (cfg, end_bb);
+
+ vtable_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, vtable_ins, OP_LOAD_MEMBASE, vtable_reg, this_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
+ if (is_iface)
+ offset = ((gint32)slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
+ else
+ offset = MONO_STRUCT_OFFSET (MonoVTable, vtable) + (slot * SIZEOF_VOID_P);
+
+ /* Load the slot, which contains a function descriptor. */
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, slot_reg, vtable_reg, offset);
+
+ /* These slots are not initialized, so fall back to the slow path until they are initialized */
+ /* That happens when mono_method_add_generic_virtual_invocation () creates an IMT thunk */
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, slot_reg, 0);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, slowpath_bb);
+
+ /* Fastpath */
+ /* Same as with iface calls */
+ EMIT_NEW_LOAD_MEMBASE (cfg, thunk_addr_ins, OP_LOAD_MEMBASE, addr_reg, slot_reg, 0);
+ EMIT_NEW_LOAD_MEMBASE (cfg, thunk_arg_ins, OP_LOAD_MEMBASE, arg_reg, slot_reg, SIZEOF_VOID_P);
+ icall_args [0] = thunk_arg_ins;
+ icall_args [1] = emit_get_rgctx_method (cfg, context_used,
+ cmethod, MONO_RGCTX_INFO_METHOD);
+ ftndesc_ins = mono_emit_calli (cfg, helper_sig_llvmonly_imt_thunk, icall_args, thunk_addr_ins, NULL, NULL);
+ ftndesc_ins->dreg = ftndesc_reg;
+ /*
+ * Unlike normal iface calls, these imt thunks can return NULL, i.e. when they are passed an instantiation
+ * they don't know about yet. Fall back to the slowpath in that case.
+ */
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, ftndesc_reg, 0);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, slowpath_bb);
+
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ /* Slowpath */
+ MONO_START_BB (cfg, slowpath_bb);
+ icall_args [0] = vtable_ins;
+ EMIT_NEW_ICONST (cfg, icall_args [1], slot);
+ icall_args [2] = emit_get_rgctx_method (cfg, context_used,
+ cmethod, MONO_RGCTX_INFO_METHOD);
+ if (is_iface)
+ ftndesc_ins = mono_emit_jit_icall (cfg, mono_resolve_generic_virtual_iface_call, icall_args);
+ else
+ ftndesc_ins = mono_emit_jit_icall (cfg, mono_resolve_generic_virtual_call, icall_args);
+ ftndesc_ins->dreg = ftndesc_reg;
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ /* Common case */
+ MONO_START_BB (cfg, end_bb);
+ return emit_llvmonly_calli (cfg, fsig, sp, ftndesc_ins);
+ }
+
+ /*
+ * Non-optimized cases
+ */
+ icall_args [0] = sp [0];
+ EMIT_NEW_ICONST (cfg, icall_args [1], slot);
+
+ icall_args [2] = emit_get_rgctx_method (cfg, context_used,
+ cmethod, MONO_RGCTX_INFO_METHOD);
+
+ arg_reg = alloc_preg (cfg);
+ MONO_EMIT_NEW_PCONST (cfg, arg_reg, NULL);
+ EMIT_NEW_VARLOADA_VREG (cfg, icall_args [3], arg_reg, &mono_defaults.int_class->byval_arg);
+
+ g_assert (is_gsharedvt);
+ if (is_iface)
+ call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call_gsharedvt, icall_args);
+ else
+ call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall_gsharedvt, icall_args);
+
+ /*
+ * Pass the extra argument even if the callee doesn't receive it, most
+ * calling conventions allow this.
+ */
+ return emit_extra_arg_calli (cfg, fsig, sp, arg_reg, call_target);
+}
+
static gboolean
is_exception_class (MonoClass *klass)
{
*/
if (cfg->gsharedvt && (mini_is_gsharedvt_signature (fsig) || cmethod->is_inflated || cmethod->klass->generic_class) &&
!(cmethod->klass->rank && cmethod->klass->byval_arg.type != MONO_TYPE_SZARRAY) &&
- (!(cfg->llvm_only && virtual_))) {
+ (!(cfg->llvm_only && virtual_ && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL)))) {
MonoRgctxInfoType info_type;
if (virtual_) {
* Virtual calls in llvm-only mode.
*/
if (cfg->llvm_only && virtual_ && cmethod && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
- MonoInst *icall_args [16];
- MonoInst *call_target;
- int arg_reg;
- gboolean is_iface = cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE;
-
- MONO_EMIT_NULL_CHECK (cfg, sp [0]->dreg);
-
- // FIXME: Optimize this
-
- guint32 slot;
-
- if (is_iface)
- slot = mono_method_get_imt_slot (cmethod);
- else
- slot = mono_method_get_vtable_index (cmethod);
-
- icall_args [0] = sp [0];
- EMIT_NEW_ICONST (cfg, icall_args [1], slot);
-
- if (fsig->generic_param_count) {
- /* virtual generic call */
- g_assert (!imt_arg);
- /* Same as the virtual generic case above */
- imt_arg = emit_get_rgctx_method (cfg, context_used,
- cmethod, MONO_RGCTX_INFO_METHOD);
- icall_args [2] = imt_arg;
- } else if (imt_arg) {
- icall_args [2] = imt_arg;
- } else {
- EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_METHODCONST, cmethod);
- icall_args [2] = ins;
- }
-
- // FIXME: For generic virtual calls, avoid computing the rgctx twice
-
- arg_reg = alloc_preg (cfg);
- MONO_EMIT_NEW_PCONST (cfg, arg_reg, NULL);
- EMIT_NEW_VARLOADA_VREG (cfg, icall_args [3], arg_reg, &mono_defaults.int_class->byval_arg);
-
- if (cfg->gsharedvt && mini_is_gsharedvt_variable_signature (fsig)) {
- /*
- * We handle virtual calls made from gsharedvt methods here instead
- * of the gsharedvt block above.
- */
- if (is_iface)
- call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call_gsharedvt, icall_args);
- else
- call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall_gsharedvt, icall_args);
- } else {
- if (is_iface)
- call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call, icall_args);
- else
- call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall, icall_args);
- }
-
- /*
- * Pass the extra argument even if the callee doesn't receive it, most calling
- * calling conventions allow this.
- */
- ins = emit_extra_arg_calli (cfg, fsig, sp, arg_reg, call_target);
+ ins = emit_llvmonly_virtual_call (cfg, cmethod, fsig, context_used, sp);
goto call_end;
}
/*
* Link the finally bblock with the target, since it will
* conceptually branch there.
- * FIXME: Have to link the bblock containing the endfinally.
*/
+ GET_BBLOCK (cfg, tblock, cfg->cil_start + clause->handler_offset + clause->handler_len - 1);
GET_BBLOCK (cfg, target_bb, target);
link_bblock (cfg, tblock, target_bb);
}
ip += 2;
break;
}
+ case CEE_MONO_CALLI_EXTRA_ARG: {
+ MonoInst *addr;
+ MonoMethodSignature *fsig;
+ MonoInst *arg;
+
+ /*
+ * This is the same as CEE_CALLI, but passes an additional argument
+ * to the called method in llvmonly mode.
+ * This is only used by delegate invoke wrappers to call the
+ * actual delegate method.
+ */
+ g_assert (method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE);
+
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+
+ ins = NULL;
+
+ cmethod = NULL;
+ CHECK_STACK (1);
+ --sp;
+ addr = *sp;
+ fsig = mini_get_signature (method, token, generic_context);
+
+ n = fsig->param_count + fsig->hasthis + 1;
+
+ CHECK_STACK (n);
+
+ sp -= n;
+ arg = sp [n - 1];
+
+ if (cfg->llvm_only) {
+ /*
+ * The lowest bit of 'arg' determines whenever the callee uses the gsharedvt
+ * cconv. This is set by mono_init_delegate ().
+ */
+ if (cfg->gsharedvt && mini_is_gsharedvt_variable_signature (fsig)) {
+ MonoInst *callee = addr;
+ MonoInst *call, *localloc_ins;
+ MonoBasicBlock *is_gsharedvt_bb, *end_bb;
+ int low_bit_reg = alloc_preg (cfg);
+
+ NEW_BBLOCK (cfg, is_gsharedvt_bb);
+ NEW_BBLOCK (cfg, end_bb);
+
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_PAND_IMM, low_bit_reg, arg->dreg, 1);
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, low_bit_reg, 0);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, is_gsharedvt_bb);
+
+ /* Normal case: callee uses a normal cconv, have to add an out wrapper */
+ addr = emit_get_rgctx_sig (cfg, context_used,
+ fsig, MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI);
+ /*
+ * ADDR points to a gsharedvt-out wrapper, have to pass <callee, arg> as an extra arg.
+ */
+ MONO_INST_NEW (cfg, ins, OP_LOCALLOC_IMM);
+ ins->dreg = alloc_preg (cfg);
+ ins->inst_imm = 2 * SIZEOF_VOID_P;
+ MONO_ADD_INS (cfg->cbb, ins);
+ localloc_ins = ins;
+ cfg->flags |= MONO_CFG_HAS_ALLOCA;
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, localloc_ins->dreg, 0, callee->dreg);
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, localloc_ins->dreg, SIZEOF_VOID_P, arg->dreg);
+
+ call = emit_extra_arg_calli (cfg, fsig, sp, localloc_ins->dreg, addr);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ /* Gsharedvt case: callee uses a gsharedvt cconv, no conversion is needed */
+ MONO_START_BB (cfg, is_gsharedvt_bb);
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_PXOR_IMM, arg->dreg, arg->dreg, 1);
+ ins = emit_extra_arg_calli (cfg, fsig, sp, arg->dreg, callee);
+ ins->dreg = call->dreg;
+
+ MONO_START_BB (cfg, end_bb);
+ } else {
+ ins = emit_extra_arg_calli (cfg, fsig, sp, arg->dreg, addr);
+ }
+ } else {
+ /* Same as CEE_CALLI */
+ if (cfg->gsharedvt && mini_is_gsharedvt_signature (fsig)) {
+ /*
+ * We pass the address to the gsharedvt trampoline in the rgctx reg
+ */
+ MonoInst *callee = addr;
+
+ addr = emit_get_rgctx_sig (cfg, context_used,
+ fsig, MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI);
+ ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, callee);
+ } else {
+ ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+ }
+ }
+
+ if (!MONO_TYPE_IS_VOID (fsig->ret))
+ *sp++ = mono_emit_widen_call_res (cfg, ins, fsig);
+
+ CHECK_CFG_EXCEPTION;
+
+ ip += 6;
+ ins_flag = 0;
+ constrained_class = NULL;
+ break;
+ }
default:
g_error ("opcode 0x%02x 0x%02x not handled", MONO_CUSTOM_PREFIX, ip [1]);
break;
add_general (&gr, &stack_size, ainfo);
break;
}
- if (mini_is_gsharedvt_type (ptype)) {
+ if (mini_is_gsharedvt_variable_type (ptype)) {
/* gsharedvt arguments are passed by ref */
add_general (&gr, &stack_size, ainfo);
if (ainfo->storage == ArgInIReg)
case ArgInDoubleSSEReg:
linfo->ret.storage = LLVMArgNormal;
break;
- case ArgValuetypeInReg:
- if (sig->pinvoke) {
- cfg->exception_message = g_strdup ("pinvoke + vtypes");
+ case ArgValuetypeInReg: {
+ ainfo = &cinfo->ret;
+
+ if (sig->pinvoke &&
+ (ainfo->pair_storage [0] == ArgInFloatSSEReg || ainfo->pair_storage [0] == ArgInDoubleSSEReg ||
+ ainfo->pair_storage [1] == ArgInFloatSSEReg || ainfo->pair_storage [1] == ArgInDoubleSSEReg)) {
+ cfg->exception_message = g_strdup ("pinvoke + vtype ret");
cfg->disable_llvm = TRUE;
return linfo;
}
linfo->ret.storage = LLVMArgVtypeInReg;
for (j = 0; j < 2; ++j)
- linfo->ret.pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, cinfo->ret.pair_storage [j]);
+ linfo->ret.pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, ainfo->pair_storage [j]);
break;
+ }
case ArgValuetypeAddrInIReg:
/* Vtype returned using a hidden argument */
linfo->ret.storage = LLVMArgVtypeRetAddr;
linfo->args [i].storage = LLVMArgNormal;
break;
case ArgValuetypeInReg:
- if (sig->pinvoke) {
+ if (sig->pinvoke &&
+ (ainfo->pair_storage [0] == ArgInFloatSSEReg || ainfo->pair_storage [0] == ArgInDoubleSSEReg ||
+ ainfo->pair_storage [1] == ArgInFloatSSEReg || ainfo->pair_storage [1] == ArgInDoubleSSEReg)) {
cfg->exception_message = g_strdup ("pinvoke + vtypes");
cfg->disable_llvm = TRUE;
return linfo;
gsig = mono_method_signature (gmethod);
addr = mini_add_method_wrappers_llvmonly (method, addr, TRUE, FALSE, &arg);
- return mini_create_llvmonly_ftndesc (addr, arg);
+ return mini_create_llvmonly_ftndesc (domain, addr, arg);
}
ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (addr), NULL);
case MONO_TYPE_ARRAY:
case MONO_TYPE_PTR:
return &mono_defaults.int_class->byval_arg;
- return &mono_defaults.int_class->byval_arg;
- case MONO_TYPE_GENERICINST:
+ case MONO_TYPE_GENERICINST: {
+ MonoClass *klass;
+ MonoGenericContext ctx;
+ MonoGenericContext *orig_ctx;
+ MonoGenericInst *inst;
+ MonoType *args [16];
+ int i;
+
if (!MONO_TYPE_ISSTRUCT (t))
return &mono_defaults.int_class->byval_arg;
- break;
+
+ klass = mono_class_from_mono_type (t);
+ orig_ctx = &klass->generic_class->context;
+
+ memset (&ctx, 0, sizeof (MonoGenericContext));
+
+ inst = orig_ctx->class_inst;
+ if (inst) {
+ g_assert (inst->type_argc < 16);
+ for (i = 0; i < inst->type_argc; ++i)
+ args [i] = get_wrapper_shared_type (inst->type_argv [i]);
+ ctx.class_inst = mono_metadata_get_generic_inst (inst->type_argc, args);
+ }
+ inst = orig_ctx->method_inst;
+ if (inst) {
+ g_assert (inst->type_argc < 16);
+ for (i = 0; i < inst->type_argc; ++i)
+ args [i] = get_wrapper_shared_type (inst->type_argv [i]);
+ ctx.method_inst = mono_metadata_get_generic_inst (inst->type_argc, args);
+ }
+ klass = mono_class_inflate_generic_class (klass->generic_class->container_class, &ctx);
+ return &klass->byval_arg;
+ }
#if SIZEOF_VOID_P == 8
case MONO_TYPE_I8:
return &mono_defaults.int_class->byval_arg;
res->ret = get_wrapper_shared_type (sig->ret);
for (i = 0; i < sig->param_count; ++i)
res->params [i] = get_wrapper_shared_type (sig->params [i]);
+ res->generic_param_count = 0;
+ res->is_inflated = 0;
return res;
}
// FIXME: Use shared signatures
mb = mono_mb_new (mono_defaults.object_class, sig->hasthis ? "gsharedvt_in_sig" : "gsharedvt_in_sig_static", MONO_WRAPPER_UNKNOWN);
+#ifndef DISABLE_JIT
if (sig->ret->type != MONO_TYPE_VOID)
retval_var = mono_mb_add_local (mb, sig->ret);
if (sig->ret->type != MONO_TYPE_VOID)
mono_mb_emit_ldloc (mb, retval_var);
mono_mb_emit_byte (mb, CEE_RET);
+#endif
info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG);
info->d.gsharedvt.sig = sig;
// FIXME: Use shared signatures
mb = mono_mb_new (mono_defaults.object_class, "gsharedvt_out_sig", MONO_WRAPPER_UNKNOWN);
+#ifndef DISABLE_JIT
if (sig->ret->type != MONO_TYPE_VOID)
/* Load return address */
mono_mb_emit_ldarg (mb, sig->hasthis ? 1 : 0);
mono_mb_emit_byte (mb, stind_op);
}
mono_mb_emit_byte (mb, CEE_RET);
+#endif
info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG);
info->d.gsharedvt.sig = sig;
addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, FALSE, &arg);
/* Returns an ftndesc */
- return mini_create_llvmonly_ftndesc (addr, arg);
+ return mini_create_llvmonly_ftndesc (domain, addr, arg);
} else {
addr = mono_compile_method ((MonoMethod *)data);
return mini_add_method_trampoline ((MonoMethod *)data, addr, mono_method_needs_static_rgctx_invoke ((MonoMethod *)data, FALSE), FALSE);
/* The virtual case doesn't go through this code */
g_assert (!virtual_);
+ sig = mono_method_signature (jinfo_get_method (callee_ji));
gpointer out_wrapper = mini_get_gsharedvt_wrapper (FALSE, NULL, sig, gsig, -1, FALSE);
- gpointer *out_wrapper_arg = mini_create_llvmonly_ftndesc (callee_ji->code_start, mini_method_get_rgctx (method));
+ MonoFtnDesc *out_wrapper_arg = mini_create_llvmonly_ftndesc (domain, callee_ji->code_start, mini_method_get_rgctx (method));
/* Returns an ftndesc */
- addr = mini_create_llvmonly_ftndesc (out_wrapper, out_wrapper_arg);
+ addr = mini_create_llvmonly_ftndesc (domain, out_wrapper, out_wrapper_arg);
} else {
- addr = mini_create_llvmonly_ftndesc (addr, mini_method_get_rgctx (method));
+ addr = mini_create_llvmonly_ftndesc (domain, addr, mini_method_get_rgctx (method));
}
} else {
addr = mini_get_gsharedvt_wrapper (FALSE, addr, sig, gsig, vcall_offset, FALSE);
* might not exist at all in IL, so the AOT compiler cannot generate the wrappers
* for it.
*/
- addr = mini_create_llvmonly_ftndesc (callee_ji->code_start, mini_method_get_rgctx (method));
+ addr = mini_create_llvmonly_ftndesc (domain, callee_ji->code_start, mini_method_get_rgctx (method));
} else if (mini_is_gsharedvt_variable_signature (gsig)) {
gpointer in_wrapper = mini_get_gsharedvt_wrapper (TRUE, callee_ji->code_start, sig, gsig, -1, FALSE);
- gpointer in_wrapper_arg = mini_create_llvmonly_ftndesc (callee_ji->code_start, mini_method_get_rgctx (method));
+ gpointer in_wrapper_arg = mini_create_llvmonly_ftndesc (domain, callee_ji->code_start, mini_method_get_rgctx (method));
gpointer out_wrapper = mini_get_gsharedvt_wrapper (FALSE, NULL, sig, gsig, -1, FALSE);
- gpointer *out_wrapper_arg = mini_create_llvmonly_ftndesc (in_wrapper, in_wrapper_arg);
+ MonoFtnDesc *out_wrapper_arg = mini_create_llvmonly_ftndesc (domain, in_wrapper, in_wrapper_arg);
- addr = mini_create_llvmonly_ftndesc (out_wrapper, out_wrapper_arg);
+ addr = mini_create_llvmonly_ftndesc (domain, out_wrapper, out_wrapper_arg);
} else {
- addr = mini_create_llvmonly_ftndesc (addr, mini_method_get_rgctx (method));
+ addr = mini_create_llvmonly_ftndesc (domain, addr, mini_method_get_rgctx (method));
}
} else if (call_sig == mono_method_signature (method)) {
} else {
static MonoLLVMEmitAotInfoFunc mono_llvm_emit_aot_file_info_fptr;
static MonoLLVMEmitAotDataFunc mono_llvm_emit_aot_data_fptr;
static MonoLLVMFreeDomainFunc mono_llvm_free_domain_info_fptr;
+static void (*mono_llvm_create_vars_fptr) (MonoCompile *cfg);
void
mono_llvm_init (void)
mono_llvm_emit_aot_data_fptr (symbol, data, data_len);
}
+void
+mono_llvm_create_vars (MonoCompile *cfg)
+{
+ if (mono_llvm_create_vars_fptr)
+ mono_llvm_create_vars_fptr (cfg);
+}
+
int
mono_llvm_load (const char* bpath)
{
if (err) goto symbol_error;
err = mono_dl_symbol (llvm_lib, "mono_llvm_emit_aot_data", (void**)&mono_llvm_emit_aot_data_fptr);
if (err) goto symbol_error;
+ err = mono_dl_symbol (llvm_lib, "mono_llvm_create_vars", (void**)&mono_llvm_create_vars_fptr);
+ if (err) goto symbol_error;
return TRUE;
symbol_error:
g_warning ("llvm symbol load failed: %s\n", err);
case LLVMArgAsFpArgs: {
int j;
+ /* Emit dummy fp arguments if needed so the rest is passed on the stack */
+ for (j = 0; j < ainfo->ndummy_fpargs; ++j)
+ param_types [pindex ++] = LLVMDoubleType ();
for (j = 0; j < ainfo->nslots; ++j)
- param_types [pindex + j] = ainfo->esize == 8 ? LLVMDoubleType () : LLVMFloatType ();
- pindex += ainfo->nslots;
+ param_types [pindex ++] = ainfo->esize == 8 ? LLVMDoubleType () : LLVMFloatType ();
break;
}
case LLVMArgVtypeAsScalar:
LLVMValueRef args [8];
int j;
+ pindex += ainfo->ndummy_fpargs;
+
/* The argument is received as a set of int/fp arguments, store them into the real argument */
memset (args, 0, sizeof (args));
if (ainfo->storage == LLVMArgVtypeInReg) {
gboolean vretaddr;
LLVMTypeRef llvm_sig;
gpointer target;
- gboolean is_virtual, calli;
+ gboolean is_virtual, calli, preserveall;
LLVMBuilderRef builder = *builder_ref;
if (call->signature->call_convention != MONO_CALL_DEFAULT)
is_virtual = (ins->opcode == OP_VOIDCALL_MEMBASE || ins->opcode == OP_CALL_MEMBASE || ins->opcode == OP_VCALL_MEMBASE || ins->opcode == OP_LCALL_MEMBASE || ins->opcode == OP_FCALL_MEMBASE || ins->opcode == OP_RCALL_MEMBASE);
calli = !call->fptr_is_patch && (ins->opcode == OP_VOIDCALL_REG || ins->opcode == OP_CALL_REG || ins->opcode == OP_VCALL_REG || ins->opcode == OP_LCALL_REG || ins->opcode == OP_FCALL_REG || ins->opcode == OP_RCALL_REG);
+ /* Unused */
+ preserveall = FALSE;
/* FIXME: Avoid creating duplicate methods */
case LLVMArgVtypeInReg:
case LLVMArgAsFpArgs: {
guint32 nargs;
+ int j;
+
+ for (j = 0; j < ainfo->ndummy_fpargs; ++j)
+ args [pindex + j] = LLVMConstNull (LLVMDoubleType ());
+ pindex += ainfo->ndummy_fpargs;
g_assert (addresses [reg]);
emit_vtype_to_args (ctx, builder, ainfo->type, addresses [reg], ainfo, args + pindex, &nargs);
g_assert (!(call->rgctx_arg_reg && call->imt_arg_reg));
if (!sig->pinvoke && !cfg->llvm_only)
LLVMSetInstructionCallConv (lcall, LLVMMono1CallConv);
+ if (preserveall)
+ mono_llvm_set_call_preserveall_cc (lcall);
if (cinfo->ret.storage == LLVMArgVtypeByRef)
LLVMAddInstrAttribute (lcall, 1 + cinfo->vret_arg_pindex, LLVMStructRetAttribute);
case OP_LCOMPARE_IMM:
case OP_COMPARE_IMM: {
CompRelation rel;
- LLVMValueRef cmp;
+ LLVMValueRef cmp, args [16];
+ gboolean likely = (ins->flags & MONO_INST_LIKELY) != 0;
if (ins->next->opcode == OP_NOP)
break;
} else
cmp = LLVMBuildICmp (builder, cond_to_llvm_cond [rel], lhs, rhs, "");
+ if (likely) {
+ args [0] = cmp;
+ args [1] = LLVMConstInt (LLVMInt1Type (), 1, FALSE);
+ cmp = LLVMBuildCall (ctx->builder, LLVMGetNamedFunction (ctx->lmodule, "llvm.expect.i1"), args, 2, "");
+ }
+
if (MONO_IS_COND_BRANCH_OP (ins->next)) {
if (ins->next->inst_true_bb == ins->next->inst_false_bb) {
/*
case OP_ISHR_UN_IMM:
case OP_LADD_IMM:
case OP_LSUB_IMM:
+ case OP_LMUL_IMM:
case OP_LREM_IMM:
case OP_LAND_IMM:
case OP_LOR_IMM:
break;
case OP_IMUL_IMM:
case OP_MUL_IMM:
+ case OP_LMUL_IMM:
values [ins->dreg] = LLVMBuildMul (builder, lhs, imm, dname);
break;
case OP_IDIV_IMM:
MonoExceptionClause *clause1 = &cfg->header->clauses [i];
MonoExceptionClause *clause2 = &cfg->header->clauses [j];
- if (i != j && clause1->try_offset >= clause2->try_offset && clause1->handler_offset <= clause2->handler_offset &&
- (clause1->flags == MONO_EXCEPTION_CLAUSE_FINALLY || clause2->flags == MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ // FIXME: Nested try clauses fail in some cases too, i.e. #37273
+ if (i != j && clause1->try_offset >= clause2->try_offset && clause1->handler_offset <= clause2->handler_offset) {
+ //(clause1->flags == MONO_EXCEPTION_CLAUSE_FINALLY || clause2->flags == MONO_EXCEPTION_CLAUSE_FINALLY)) {
cfg->exception_message = g_strdup ("nested clauses");
cfg->disable_llvm = TRUE;
break;
for (i = 0; i < sig->param_count; ++i) {
LLVMArgInfo *ainfo = &linfo->args [i + sig->hasthis];
char *name;
+ int pindex = ainfo->pindex + ainfo->ndummy_fpargs;
+ int j;
- values [cfg->args [i + sig->hasthis]->dreg] = LLVMGetParam (method, ainfo->pindex);
+ for (j = 0; j < ainfo->ndummy_fpargs; ++j) {
+ name = g_strdup_printf ("dummy_%d_%d", i, j);
+ LLVMSetValueName (LLVMGetParam (method, ainfo->pindex + j), name);
+ g_free (name);
+ }
+
+ values [cfg->args [i + sig->hasthis]->dreg] = LLVMGetParam (method, pindex);
if (ainfo->storage == LLVMArgScalarByRef) {
if (names [i] && names [i][0] != '\0')
name = g_strdup_printf ("p_arg_%s", names [i]);
LLVMSetValueName (values [cfg->args [i + sig->hasthis]->dreg], name);
g_free (name);
if (ainfo->storage == LLVMArgVtypeByVal)
- LLVMAddAttribute (LLVMGetParam (method, ainfo->pindex), LLVMByValAttribute);
+ LLVMAddAttribute (LLVMGetParam (method, pindex), LLVMByValAttribute);
if (ainfo->storage == LLVMArgVtypeByRef) {
/* For OP_LDADDR */
sig = mono_method_signature (cfg->method);
if (cfg->gsharedvt && cfg->llvm_only) {
if (mini_is_gsharedvt_variable_signature (sig) && sig->ret->type != MONO_TYPE_VOID) {
- cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
+ cfg->vret_addr = mono_compile_create_var (cfg, &mono_get_int32_class ()->byval_arg, OP_ARG);
if (G_UNLIKELY (cfg->verbose_level > 1)) {
printf ("vret_addr = ");
mono_print_ins (cfg->vret_addr);
}
AddFunc2 (module, "llvm.expect.i8", LLVMInt8Type (), LLVMInt8Type (), LLVMInt8Type ());
+ AddFunc2 (module, "llvm.expect.i1", LLVMInt1Type (), LLVMInt1Type (), LLVMInt1Type ());
/* EH intrinsics */
{
fields [tindex ++] = AddJitGlobal (module, eltype, "method_addresses");
else
fields [tindex ++] = LLVMConstNull (eltype);
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "blob");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_name_table");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "method_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "ex_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_table");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "got_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "llvm_got_info_offsets");
- fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "image_table");
+ if (info->flags & MONO_AOT_FILE_FLAG_SEPARATE_DATA) {
+ for (i = 0; i < MONO_AOT_TABLE_NUM; ++i)
+ fields [tindex ++] = LLVMConstNull (eltype);
+ } else {
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "blob");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_name_table");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "method_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "ex_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_table");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "got_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "llvm_got_info_offsets");
+ fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "image_table");
+ }
/* Not needed (mem_end) */
fields [tindex ++] = LLVMConstNull (eltype);
fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "assembly_guid");
MonoObject *mono_llvm_load_exception (void);
void mono_llvm_reset_exception (void);
void mono_llvm_raise_exception (MonoException *e);
-void mono_llvm_create_vars (MonoCompile *cfg);
+void mono_llvm_create_vars (MonoCompile *cfg) MONO_LLVM_INTERNAL;
gboolean mini_llvm_init (void);
#endif
+static void
+no_gsharedvt_in_wrapper (void)
+{
+ g_assert_not_reached ();
+}
+
static gpointer
mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException **ex)
{
/* Must be domain neutral since there is only one copy */
opt |= MONO_OPT_SHARED;
- }
-
- if (method->dynamic)
- opt &= ~MONO_OPT_SHARED;
-
- /* These methods can become invalid when a domain is unloaded */
- if (method->klass->image != mono_get_corlib () || method->is_inflated)
+ } else {
+ /* MONO_OPT_SHARED is no longer supported, we only use it for icall wrappers */
opt &= ~MONO_OPT_SHARED;
+ }
if (opt & MONO_OPT_SHARED)
target_domain = mono_get_root_domain ();
code = mono_jit_compile_method_inner (method, target_domain, opt, ex);
if (!code && mono_llvm_only) {
+ if (method->wrapper_type == MONO_WRAPPER_UNKNOWN) {
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+ if (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG) {
+ /*
+ * These wrappers are only created for signatures which are in the program, but
+ * sometimes we load methods too eagerly and have to create them even if they
+ * will never be called.
+ */
+ return no_gsharedvt_in_wrapper;
+ }
+ }
+
printf ("AOT method not found in llvmonly mode: %s\n", mono_method_full_name (method, 1));
g_assert_not_reached ();
}
MonoVTable *vtable;
MonoDynCallInfo *dyn_call_info;
MonoClass *ret_box_class;
- gboolean needs_rgctx;
MonoMethodSignature *sig;
+ gboolean gsharedvt_invoke;
gpointer *wrapper_arg;
} RuntimeInvokeInfo;
-gboolean
-mini_gsharedvt_runtime_invoke_supported (MonoMethodSignature *sig)
-{
- gboolean supported = TRUE;
- int i;
-
- for (i = 0; i < sig->param_count; ++i) {
- MonoType *t = sig->params [i];
-
- if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
- supported = FALSE;
- }
-
- return supported;
-}
-
static RuntimeInvokeInfo*
-create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer compiled_method)
+create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer compiled_method, gboolean callee_gsharedvt)
{
MonoMethod *invoke;
RuntimeInvokeInfo *info;
info = g_new0 (RuntimeInvokeInfo, 1);
- info->needs_rgctx = mono_llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE);
info->compiled_method = compiled_method;
- invoke = mono_marshal_get_runtime_invoke (method, FALSE, info->needs_rgctx);
+ invoke = mono_marshal_get_runtime_invoke (method, FALSE);
info->vtable = mono_class_vtable_full (domain, method->klass, TRUE);
g_assert (info->vtable);
if (method->string_ctor)
sig = mono_marshal_get_string_ctor_signature (method);
- g_assert (!info->needs_rgctx);
for (i = 0; i < sig->param_count; ++i) {
MonoType *t = sig->params [i];
if (!info->dyn_call_info) {
if (mono_llvm_only) {
- gboolean supported;
-
- supported = mini_gsharedvt_runtime_invoke_supported (sig);
-
- if (mono_class_is_contextbound (method->klass) || !info->compiled_method)
- supported = FALSE;
-
#ifndef ENABLE_GSHAREDVT
- supported = FALSE;
+ g_assert_not_reached ();
#endif
-
- if (supported) {
+ if (!callee_gsharedvt) {
/* Invoke a gsharedvt out wrapper instead */
MonoMethod *wrapper = mini_get_gsharedvt_out_sig_wrapper (sig);
MonoMethodSignature *wrapper_sig = mini_get_gsharedvt_out_sig_wrapper_signature (sig->hasthis, sig->ret->type != MONO_TYPE_VOID, sig->param_count);
+ info->gsharedvt_invoke = TRUE;
info->wrapper_arg = g_malloc0 (2 * sizeof (gpointer));
info->wrapper_arg [0] = info->compiled_method;
info->wrapper_arg [1] = mono_method_needs_static_rgctx_invoke (method, TRUE) ? mini_method_get_rgctx (method) : NULL;
g_free (wrapper_sig);
info->compiled_method = mono_jit_compile_method (wrapper);
+ } else {
+ /* Gsharedvt methods can be invoked the same way */
+ /* The out wrapper has the same signature as the compiled gsharedvt method */
+ MonoMethodSignature *wrapper_sig = mini_get_gsharedvt_out_sig_wrapper_signature (sig->hasthis, sig->ret->type != MONO_TYPE_VOID, sig->param_count);
+
+ info->gsharedvt_invoke = TRUE;
+ info->wrapper_arg = mono_method_needs_static_rgctx_invoke (method, TRUE) ? mini_method_get_rgctx (method) : NULL;
+
+ invoke = mono_marshal_get_runtime_invoke_for_sig (wrapper_sig);
+ g_free (wrapper_sig);
}
}
info->runtime_invoke = mono_jit_compile_method (invoke);
MonoDomain *domain = mono_domain_get ();
MonoJitDomainInfo *domain_info;
RuntimeInvokeInfo *info, *info2;
+ MonoJitInfo *ji = NULL;
+ gboolean callee_gsharedvt = FALSE;
if (obj == NULL && !(method->flags & METHOD_ATTRIBUTE_STATIC) && !method->string_ctor && (method->wrapper_type == 0)) {
g_warning ("Ignoring invocation of an instance method on a NULL instance.\n");
MonoMethod *wrapper;
wrapper = mono_marshal_get_array_accessor_wrapper (method);
- invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE, FALSE);
+ invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
callee = wrapper;
} else {
callee = NULL;
}
}
- compiled_method = mini_add_method_trampoline (callee, compiled_method, mono_method_needs_static_rgctx_invoke (callee, TRUE), FALSE);
+ if (mono_llvm_only) {
+ ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (compiled_method), NULL);
+ callee_gsharedvt = mini_jit_info_is_gsharedvt (ji);
+ }
+
+ if (!callee_gsharedvt)
+ compiled_method = mini_add_method_trampoline (callee, compiled_method, mono_method_needs_static_rgctx_invoke (callee, TRUE), FALSE);
} else {
compiled_method = NULL;
}
- info = create_runtime_invoke_info (domain, method, compiled_method);
+ info = create_runtime_invoke_info (domain, method, compiled_method, callee_gsharedvt);
mono_domain_lock (domain);
info2 = (RuntimeInvokeInfo *)mono_conc_hashtable_insert (domain_info->runtime_invoke_hash, method, info);
int i, pindex;
guint8 buf [512];
guint8 retval [256];
- gpointer rgctx;
if (!dyn_runtime_invoke) {
invoke = mono_marshal_get_runtime_invoke_dynamic ();
}
/* Convert the arguments to the format expected by start_dyn_call () */
- args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
+ args = (void **)g_alloca ((sig->param_count + sig->hasthis) * sizeof (gpointer));
pindex = 0;
if (sig->hasthis)
args [pindex ++] = &obj;
args [pindex ++] = params [i];
}
}
- if (info->needs_rgctx) {
- rgctx = mini_method_get_rgctx (method);
- args [pindex ++] = &rgctx;
- }
//printf ("M: %s\n", mono_method_full_name (method, TRUE));
runtime_invoke = (MonoObject *(*)(MonoObject *, void **, MonoObject **, void *))info->runtime_invoke;
- if (info->wrapper_arg) {
+ if (mono_llvm_only) {
MonoMethodSignature *sig = mono_method_signature (method);
gpointer *args;
gpointer retval_ptr;
guint8 retval [256];
- gpointer param_refs [256];
+ gpointer *param_refs;
int i, pindex;
+ g_assert (info->gsharedvt_invoke);
+
/*
* Instead of invoking the method directly, we invoke a gsharedvt out wrapper.
* The advantage of this is the gsharedvt out wrappers have a reduced set of
* signatures, so we only have to generate runtime invoke wrappers for these
* signatures.
+ * This code also handles invocation of gsharedvt methods directly, no
+ * out wrappers are used in that case.
*/
args = (void **)g_alloca ((sig->param_count + sig->hasthis + 2) * sizeof (gpointer));
+ param_refs = (gpointer*)g_alloca ((sig->param_count + sig->hasthis + 2) * sizeof (gpointer));
pindex = 0;
/*
* The runtime invoke wrappers expects pointers to primitive types, so have to
for (i = 0; i < sig->param_count; ++i) {
MonoType *t = sig->params [i];
+ if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) {
+ MonoClass *klass = mono_class_from_mono_type (t);
+ guint8 *nullable_buf;
+ int size;
+
+ size = mono_class_value_size (klass, NULL);
+ nullable_buf = g_alloca (size);
+ g_assert (nullable_buf);
+
+ /* The argument pointed to by params [i] is either a boxed vtype or null */
+ mono_nullable_init (nullable_buf, (MonoObject*)params [i], klass);
+ params [i] = nullable_buf;
+ }
+
if (MONO_TYPE_IS_REFERENCE (t)) {
param_refs [i] = params [i];
params [i] = &(param_refs [i]);
runtime_invoke (NULL, args, exc, info->compiled_method);
if (sig->ret->type != MONO_TYPE_VOID && info->ret_box_class)
- return mono_value_box (domain, info->ret_box_class, retval);
+ return mono_value_box (domain, info->ret_box_class, retval);
else
return *(MonoObject**)retval;
}
- // FIXME: Cache this
- if (info->needs_rgctx) {
- MonoMethodSignature *sig = mono_method_signature (method);
- gpointer rgctx;
- gpointer *args;
- int i, pindex;
+ return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
+}
- args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
- pindex = 0;
- rgctx = mini_method_get_rgctx (method);
- for (i = 0; i < sig->param_count; ++i)
- args [pindex ++] = params [i];
- args [pindex ++] = &rgctx;
- return runtime_invoke ((MonoObject *)obj, args, exc, info->compiled_method);
- } else {
- return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
+typedef struct {
+ MonoVTable *vtable;
+ int slot;
+} IMTThunkInfo;
+
+typedef gpointer (*IMTThunkFunc) (gpointer *arg, MonoMethod *imt_method);
+
+/*
+ * mini_llvmonly_initial_imt_thunk:
+ *
+ * This function is called the first time a call is made through an IMT thunk.
+ * It should have the same signature as the mono_llvmonly_imt_thunk_... functions.
+ */
+static gpointer
+mini_llvmonly_initial_imt_thunk (gpointer *arg, MonoMethod *imt_method)
+{
+ IMTThunkInfo *info = (IMTThunkInfo*)arg;
+ gpointer *imt;
+ gpointer *ftndesc;
+ IMTThunkFunc func;
+
+ mono_vtable_build_imt_slot (info->vtable, info->slot);
+
+ imt = (gpointer*)info->vtable;
+ imt -= MONO_IMT_SIZE;
+
+ /* Return what the real IMT thunk returns */
+ ftndesc = imt [info->slot];
+ func = ftndesc [0];
+
+ if (func == (IMTThunkFunc)mini_llvmonly_initial_imt_thunk)
+ /* Happens when the imt slot contains only a generic virtual method */
+ return NULL;
+ return func ((gpointer *)ftndesc [1], imt_method);
+}
+
+/* This is called indirectly through an imt slot. */
+static gpointer
+mono_llvmonly_imt_thunk (gpointer *arg, MonoMethod *imt_method)
+{
+ int i = 0;
+
+ /* arg points to an array created in mono_llvmonly_get_imt_thunk () */
+ while (arg [i] && arg [i] != imt_method)
+ i += 2;
+ g_assert (arg [i]);
+
+ return arg [i + 1];
+}
+
+/* Optimized versions of mono_llvmonly_imt_thunk () for different table sizes */
+static gpointer
+mono_llvmonly_imt_thunk_1 (gpointer *arg, MonoMethod *imt_method)
+{
+ //g_assert (arg [0] == imt_method);
+ return arg [1];
+}
+
+static gpointer
+mono_llvmonly_imt_thunk_2 (gpointer *arg, MonoMethod *imt_method)
+{
+ //g_assert (arg [0] == imt_method || arg [2] == imt_method);
+ if (arg [0] == imt_method)
+ return arg [1];
+ else
+ return arg [3];
+}
+
+static gpointer
+mono_llvmonly_imt_thunk_3 (gpointer *arg, MonoMethod *imt_method)
+{
+ //g_assert (arg [0] == imt_method || arg [2] == imt_method || arg [4] == imt_method);
+ if (arg [0] == imt_method)
+ return arg [1];
+ else if (arg [2] == imt_method)
+ return arg [3];
+ else
+ return arg [5];
+}
+
+/*
+ * A version of the imt thunk used for generic virtual methods.
+ * Unlikely a normal imt thunk, its possible that IMT_METHOD is not found
+ * in the search table. The original JIT code had a 'fallback' trampoline it could
+ * call, but we can't do that, so we just return NULL, and the compiled code
+ * will handle it.
+ */
+static gpointer
+mono_llvmonly_generic_virtual_imt_thunk (gpointer *arg, MonoMethod *imt_method)
+{
+ int i = 0;
+
+ while (arg [i] && arg [i] != imt_method)
+ i += 2;
+ if (!arg [i])
+ return NULL;
+
+ return arg [i + 1];
+}
+
+static gpointer
+mono_llvmonly_get_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp)
+{
+ gpointer *buf;
+ gpointer *res;
+ int i, index, real_count;
+ gboolean virtual_generic = FALSE;
+
+ /*
+ * Create an array which is passed to the imt thunk functions.
+ * The array contains MonoMethod-function descriptor pairs, terminated by a NULL entry.
+ */
+
+ real_count = 0;
+ for (i = 0; i < count; ++i) {
+ MonoIMTCheckItem *item = imt_entries [i];
+
+ if (item->is_equals)
+ real_count ++;
+ if (item->has_target_code)
+ virtual_generic = TRUE;
+ }
+
+ /*
+ * Initialize all vtable entries reachable from this imt slot, so the compiled
+ * code doesn't have to check it.
+ */
+ for (i = 0; i < count; ++i) {
+ MonoIMTCheckItem *item = imt_entries [i];
+ int vt_slot;
+
+ if (!item->is_equals || item->has_target_code)
+ continue;
+ vt_slot = item->value.vtable_slot;
+ mono_init_vtable_slot (vtable, vt_slot);
+ }
+
+ /* Save the entries into an array */
+ buf = (void **)mono_domain_alloc (domain, (real_count + 1) * 2 * sizeof (gpointer));
+ index = 0;
+ for (i = 0; i < count; ++i) {
+ MonoIMTCheckItem *item = imt_entries [i];
+
+ if (!item->is_equals)
+ continue;
+
+ g_assert (item->key);
+ buf [(index * 2)] = item->key;
+ if (item->has_target_code)
+ buf [(index * 2) + 1] = item->value.target_code;
+ else
+ buf [(index * 2) + 1] = vtable->vtable [item->value.vtable_slot];
+ index ++;
+ }
+ buf [(index * 2)] = NULL;
+ buf [(index * 2) + 1] = fail_tramp;
+
+ /*
+ * Return a function descriptor for a C function with 'buf' as its argument.
+ * It will by called by JITted code.
+ */
+ res = (void **)mono_domain_alloc (domain, 2 * sizeof (gpointer));
+ switch (real_count) {
+ case 1:
+ res [0] = mono_llvmonly_imt_thunk_1;
+ break;
+ case 2:
+ res [0] = mono_llvmonly_imt_thunk_2;
+ break;
+ case 3:
+ res [0] = mono_llvmonly_imt_thunk_3;
+ break;
+ default:
+ res [0] = mono_llvmonly_imt_thunk;
+ break;
}
+ if (virtual_generic)
+ res [0] = mono_llvmonly_generic_virtual_imt_thunk;
+ res [1] = buf;
+
+ return res;
}
MONO_SIG_HANDLER_FUNC (, mono_sigfpe_signal_handler)
static int vtable_trampolines_size;
gpointer
-mini_get_vtable_trampoline (int slot_index)
+mini_get_vtable_trampoline (MonoVTable *vt, int slot_index)
{
int index = slot_index + MONO_IMT_SIZE;
if (mono_llvm_only) {
- /* Not used */
- if (slot_index < 0)
- /* The vtable/imt construction code in object.c depends on this being non-NULL */
- return no_imt_trampoline;
- else
- return no_vcall_trampoline;
+ if (slot_index < 0) {
+ /* Initialize the IMT thunks to a 'trampoline' so the generated code doesn't have to initialize it */
+ // FIXME: Memory management
+ gpointer *ftndesc = g_malloc (2 * sizeof (gpointer));
+ IMTThunkInfo *info = g_new0 (IMTThunkInfo, 1);
+ info->vtable = vt;
+ info->slot = index;
+ ftndesc [0] = mini_llvmonly_initial_imt_thunk;
+ ftndesc [1] = info;
+ mono_memory_barrier ();
+ return ftndesc;
+ } else {
+ return NULL;
+ }
}
g_assert (slot_index >= - MONO_IMT_SIZE);
return vtable_trampolines [index];
}
+static gpointer
+mini_get_imt_trampoline (MonoVTable *vt, int slot_index)
+{
+ return mini_get_vtable_trampoline (vt, slot_index - MONO_IMT_SIZE);
+}
+
+static gboolean
+mini_imt_entry_inited (MonoVTable *vt, int imt_slot_index)
+{
+ if (mono_llvm_only)
+ return FALSE;
+
+ gpointer *imt = (gpointer*)vt;
+ imt -= MONO_IMT_SIZE;
+
+ return (imt [imt_slot_index] != mini_get_imt_trampoline (vt, imt_slot_index));
+}
+
gpointer
mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method)
{
is_interface = method->klass->flags & TYPE_ATTRIBUTE_INTERFACE ? TRUE : FALSE;
load_imt_reg = is_virtual_generic || is_interface;
- if (is_interface && !is_virtual_generic)
+ if (is_interface)
offset = ((gint32)mono_method_get_imt_slot (method) - MONO_IMT_SIZE) * SIZEOF_VOID_P;
else
offset = G_STRUCT_OFFSET (MonoVTable, vtable) + ((mono_method_get_vtable_index (method)) * (SIZEOF_VOID_P));
return cache [idx];
}
-static gpointer
-mini_get_imt_trampoline (int slot_index)
+gboolean
+mini_parse_debug_option (const char *arg)
{
- return mini_get_vtable_trampoline (slot_index - MONO_IMT_SIZE);
+ if (!strcmp (arg, "handle-sigint"))
+ debug_options.handle_sigint = TRUE;
+ else if (!strcmp (arg, "keep-delegates"))
+ debug_options.keep_delegates = TRUE;
+ else if (!strcmp (arg, "reverse-pinvoke-exceptions"))
+ debug_options.reverse_pinvoke_exceptions = TRUE;
+ else if (!strcmp (arg, "collect-pagefault-stats"))
+ debug_options.collect_pagefault_stats = TRUE;
+ else if (!strcmp (arg, "break-on-unverified"))
+ debug_options.break_on_unverified = TRUE;
+ else if (!strcmp (arg, "no-gdb-backtrace"))
+ debug_options.no_gdb_backtrace = TRUE;
+ else if (!strcmp (arg, "suspend-on-sigsegv"))
+ debug_options.suspend_on_sigsegv = TRUE;
+ else if (!strcmp (arg, "suspend-on-exception"))
+ debug_options.suspend_on_exception = TRUE;
+ else if (!strcmp (arg, "suspend-on-unhandled"))
+ debug_options.suspend_on_unhandled = TRUE;
+ else if (!strcmp (arg, "dont-free-domains"))
+ mono_dont_free_domains = TRUE;
+ else if (!strcmp (arg, "dyn-runtime-invoke"))
+ debug_options.dyn_runtime_invoke = TRUE;
+ else if (!strcmp (arg, "gdb"))
+ debug_options.gdb = TRUE;
+ else if (!strcmp (arg, "explicit-null-checks"))
+ debug_options.explicit_null_checks = TRUE;
+ else if (!strcmp (arg, "gen-seq-points"))
+ debug_options.gen_sdb_seq_points = TRUE;
+ else if (!strcmp (arg, "gen-compact-seq-points"))
+ debug_options.gen_seq_points_compact_data = TRUE;
+ else if (!strcmp (arg, "single-imm-size"))
+ debug_options.single_imm_size = TRUE;
+ else if (!strcmp (arg, "init-stacks"))
+ debug_options.init_stacks = TRUE;
+ else if (!strcmp (arg, "casts"))
+ debug_options.better_cast_details = TRUE;
+ else if (!strcmp (arg, "soft-breakpoints"))
+ debug_options.soft_breakpoints = TRUE;
+ else if (!strcmp (arg, "check-pinvoke-callconv"))
+ debug_options.check_pinvoke_callconv = TRUE;
+ else if (!strcmp (arg, "arm-use-fallback-tls"))
+ debug_options.arm_use_fallback_tls = TRUE;
+ else if (!strcmp (arg, "debug-domain-unload"))
+ mono_enable_debug_domain_unload (TRUE);
+ else if (!strcmp (arg, "partial-sharing"))
+ mono_set_partial_sharing_supported (TRUE);
+ else if (!strcmp (arg, "align-small-structs"))
+ mono_align_small_structs = TRUE;
+ else if (!strcmp (arg, "native-debugger-break"))
+ debug_options.native_debugger_break = TRUE;
+ else
+ return FALSE;
+
+ return TRUE;
}
static void
for (ptr = args; ptr && *ptr; ptr++) {
const char *arg = *ptr;
- if (!strcmp (arg, "handle-sigint"))
- debug_options.handle_sigint = TRUE;
- else if (!strcmp (arg, "keep-delegates"))
- debug_options.keep_delegates = TRUE;
- else if (!strcmp (arg, "reverse-pinvoke-exceptions"))
- debug_options.reverse_pinvoke_exceptions = TRUE;
- else if (!strcmp (arg, "collect-pagefault-stats"))
- debug_options.collect_pagefault_stats = TRUE;
- else if (!strcmp (arg, "break-on-unverified"))
- debug_options.break_on_unverified = TRUE;
- else if (!strcmp (arg, "no-gdb-backtrace"))
- debug_options.no_gdb_backtrace = TRUE;
- else if (!strcmp (arg, "suspend-on-sigsegv"))
- debug_options.suspend_on_sigsegv = TRUE;
- else if (!strcmp (arg, "suspend-on-exception"))
- debug_options.suspend_on_exception = TRUE;
- else if (!strcmp (arg, "suspend-on-unhandled"))
- debug_options.suspend_on_unhandled = TRUE;
- else if (!strcmp (arg, "dont-free-domains"))
- mono_dont_free_domains = TRUE;
- else if (!strcmp (arg, "dyn-runtime-invoke"))
- debug_options.dyn_runtime_invoke = TRUE;
- else if (!strcmp (arg, "gdb"))
- debug_options.gdb = TRUE;
- else if (!strcmp (arg, "explicit-null-checks"))
- debug_options.explicit_null_checks = TRUE;
- else if (!strcmp (arg, "gen-seq-points"))
- debug_options.gen_sdb_seq_points = TRUE;
- else if (!strcmp (arg, "gen-compact-seq-points"))
- debug_options.gen_seq_points_compact_data = TRUE;
- else if (!strcmp (arg, "single-imm-size"))
- debug_options.single_imm_size = TRUE;
- else if (!strcmp (arg, "init-stacks"))
- debug_options.init_stacks = TRUE;
- else if (!strcmp (arg, "casts"))
- debug_options.better_cast_details = TRUE;
- else if (!strcmp (arg, "soft-breakpoints"))
- debug_options.soft_breakpoints = TRUE;
- else if (!strcmp (arg, "check-pinvoke-callconv"))
- debug_options.check_pinvoke_callconv = TRUE;
- else if (!strcmp (arg, "arm-use-fallback-tls"))
- debug_options.arm_use_fallback_tls = TRUE;
- else if (!strcmp (arg, "debug-domain-unload"))
- mono_enable_debug_domain_unload (TRUE);
- else if (!strcmp (arg, "partial-sharing"))
- mono_set_partial_sharing_supported (TRUE);
- else if (!strcmp (arg, "align-small-structs"))
- mono_align_small_structs = TRUE;
- else if (!strcmp (arg, "native-debugger-break"))
- debug_options.native_debugger_break = TRUE;
- else {
+ if (!mini_parse_debug_option (arg)) {
fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dont-free-domains', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'gen-seq-points', 'gen-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', 'arm-use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
exit (1);
callbacks.get_vtable_trampoline = mini_get_vtable_trampoline;
callbacks.get_imt_trampoline = mini_get_imt_trampoline;
+ callbacks.imt_entry_inited = mini_imt_entry_inited;
mono_install_callbacks (&callbacks);
mono_marshal_use_aot_wrappers (TRUE);
}
- if (mono_aot_only)
+ if (mono_llvm_only) {
+ mono_install_imt_thunk_builder (mono_llvmonly_get_imt_thunk);
+ mono_set_always_build_imt_thunks (TRUE);
+ } else if (mono_aot_only) {
mono_install_imt_thunk_builder (mono_aot_get_imt_thunk);
- else
+ } else {
mono_install_imt_thunk_builder (mono_arch_build_imt_thunk);
+ }
/*Init arch tls information only after the metadata side is inited to make sure we see dynamic appdomain tls keys*/
mono_arch_finish_init ();
register_icall (mono_aot_init_gshared_method_this, "mono_aot_init_gshared_method_this", "void ptr int object", TRUE);
register_icall (mono_aot_init_gshared_method_rgctx, "mono_aot_init_gshared_method_rgctx", "void ptr int ptr", TRUE);
- register_icall_no_wrapper (mono_resolve_iface_call, "mono_resolve_iface_call", "ptr object int ptr ptr");
- register_icall_no_wrapper (mono_resolve_vcall, "mono_resolve_vcall", "ptr object int ptr ptr");
register_icall_no_wrapper (mono_resolve_iface_call_gsharedvt, "mono_resolve_iface_call_gsharedvt", "ptr object int ptr ptr");
register_icall_no_wrapper (mono_resolve_vcall_gsharedvt, "mono_resolve_vcall_gsharedvt", "ptr object int ptr ptr");
+ register_icall_no_wrapper (mono_resolve_generic_virtual_call, "mono_resolve_generic_virtual_call", "ptr ptr int ptr");
+ register_icall_no_wrapper (mono_resolve_generic_virtual_iface_call, "mono_resolve_generic_virtual_iface_call", "ptr ptr int ptr");
+ /* This needs a wrapper so it can have a preserveall cconv */
+ register_icall (mono_init_vtable_slot, "mono_init_vtable_slot", "ptr ptr int", FALSE);
register_icall (mono_init_delegate, "mono_init_delegate", "void object object ptr", TRUE);
register_icall (mono_init_delegate_virtual, "mono_init_delegate_virtual", "void object object ptr", TRUE);
register_icall (mono_get_assembly_object, "mono_get_assembly_object", "object ptr", TRUE);
}
mono_compile_method (method);
if (strcmp (method->name, "Finalize") == 0) {
- invoke = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+ invoke = mono_marshal_get_runtime_invoke (method, FALSE);
mono_compile_method (invoke);
}
#ifndef DISABLE_REMOTING
/* We can only use the AOT compiled code if we don't require further processing */
lookup_aot = !generic_virtual & !variant_iface;
- mono_vtable_build_imt_slot (vt, mono_method_get_imt_slot (imt_method));
+ if (!mono_llvm_only)
+ mono_vtable_build_imt_slot (vt, mono_method_get_imt_slot (imt_method));
if (imt_method->is_inflated && ((MonoMethodInflated*)imt_method)->context.method_inst) {
MonoError error;
* - generic sharing (ARG is the rgctx)
* - gsharedvt signature wrappers (ARG is a function descriptor)
*/
-gpointer
-mini_create_llvmonly_ftndesc (gpointer addr, gpointer arg)
+MonoFtnDesc*
+mini_create_llvmonly_ftndesc (MonoDomain *domain, gpointer addr, gpointer arg)
{
- gpointer *res;
-
- // FIXME: Memory management
- res = g_malloc0 (2 * sizeof (gpointer));
- res [0] = addr;
- res [1] = arg;
+ MonoFtnDesc *ftndesc = (MonoFtnDesc*)mono_domain_alloc0 (mono_domain_get (), 2 * sizeof (gpointer));
+ ftndesc->addr = addr;
+ ftndesc->arg = arg;
- return res;
+ return ftndesc;
}
/**
if (ji && !ji->is_trampoline)
jmethod = jinfo_get_method (ji);
- if (callee_gsharedvt && mini_is_gsharedvt_variable_signature (mono_method_signature (jmethod))) {
+
+ if (callee_gsharedvt)
+ callee_gsharedvt = mini_is_gsharedvt_variable_signature (mono_method_signature (jmethod));
+
+ if (!caller_gsharedvt && callee_gsharedvt) {
MonoMethodSignature *sig, *gsig;
/* Here m is a generic instance, while ji->method is the gsharedvt method implementing it */
/*
* This is a gsharedvt in wrapper, it gets passed a ftndesc for the gsharedvt method as an argument.
*/
- *out_arg = mini_create_llvmonly_ftndesc (compiled_method, mini_method_get_rgctx (m));
+ *out_arg = mini_create_llvmonly_ftndesc (mono_domain_get (), compiled_method, mini_method_get_rgctx (m));
//printf ("IN: %s\n", mono_method_full_name (m, TRUE));
}
if (!(*out_arg) && mono_method_needs_static_rgctx_invoke (m, FALSE))
*out_arg = mini_method_get_rgctx (m);
- if (caller_gsharedvt) {
+ if (caller_gsharedvt && !callee_gsharedvt) {
/*
* The callee uses the gsharedvt calling convention, have to add an out wrapper.
*/
gpointer out_wrapper = mini_get_gsharedvt_wrapper (FALSE, NULL, mono_method_signature (m), NULL, -1, FALSE);
- gpointer *out_wrapper_arg = g_malloc0 (2 * sizeof (gpointer));
- out_wrapper_arg [0] = addr;
- out_wrapper_arg [1] = *out_arg;
+ MonoFtnDesc *out_wrapper_arg = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, *out_arg);
addr = out_wrapper;
*out_arg = out_wrapper_arg;
cfg->extend_live_ranges = TRUE;
- /* Temporarily disable this when running in the debugger until we have support
- * for this in the debugger. */
- /* This is no longer needed with sdb */
- //cfg->disable_omit_fp = TRUE;
-
/* The debugger needs all locals to be on the stack or in a global register */
cfg->disable_vreg_to_lvreg = TRUE;
* may still want to view them. */
cfg->disable_deadce_vars = TRUE;
- // cfg->opt |= MONO_OPT_SHARED;
cfg->opt &= ~MONO_OPT_DEADCE;
cfg->opt &= ~MONO_OPT_INLINE;
cfg->opt &= ~MONO_OPT_COPYPROP;
cfg->opt &= ~MONO_OPT_CONSPROP;
- /* This is no longer needed with sdb */
- //cfg->opt &= ~MONO_OPT_GSHARED;
/* This is needed for the soft debugger, which doesn't like code after the epilog */
cfg->disable_out_of_line_bblocks = TRUE;
/* Parameter index in the LLVM signature */
int pindex;
MonoType *type;
+ /* Only if storage == LLVMArgAsFpArgs. Dummy fp args to insert before this arg */
+ int ndummy_fpargs;
} LLVMArgInfo;
typedef struct {
* Set on instructions during code emission which make calls, i.e. OP_CALL, OP_THROW.
* backend.pc_offset will be set to the pc offset at the end of the native call instructions.
*/
- MONO_INST_GC_CALLSITE = 128
+ MONO_INST_GC_CALLSITE = 128,
+ /* On comparisons, mark the branch following the condition as likely to be taken */
+ MONO_INST_LIKELY = 128,
};
#define inst_c0 data.op[0].const_val
gboolean need_rgctx_tramp;
} MonoDelegateTrampInfo;
+/*
+ * A function descriptor, which is a function address + argument pair.
+ * In llvm-only mode, these are used instead of trampolines to pass
+ * extra arguments to runtime functions/methods.
+ */
+typedef struct
+{
+ gpointer addr;
+ gpointer arg;
+} MonoFtnDesc;
+
typedef enum {
#define PATCH_INFO(a,b) MONO_PATCH_INFO_ ## a,
#include "patch-info.h"
#define OP_PADD_IMM OP_LADD_IMM
#define OP_PSUB_IMM OP_LSUB_IMM
#define OP_PAND_IMM OP_LAND_IMM
+#define OP_PXOR_IMM OP_LXOR_IMM
#define OP_PSUB OP_LSUB
#define OP_PMUL OP_LMUL
#define OP_PMUL_IMM OP_LMUL_IMM
#define OP_PADD_IMM OP_IADD_IMM
#define OP_PSUB_IMM OP_ISUB_IMM
#define OP_PAND_IMM OP_IAND_IMM
+#define OP_PXOR_IMM OP_IXOR_IMM
#define OP_PSUB OP_ISUB
#define OP_PMUL OP_IMUL
#define OP_PMUL_IMM OP_IMUL_IMM
MonoDomain* mini_init (const char *filename, const char *runtime_version);
void mini_cleanup (MonoDomain *domain);
MONO_API MonoDebugOptions *mini_get_debug_options (void);
+MONO_API gboolean mini_parse_debug_option (const char *option);
/* helper methods */
void mini_jit_init (void);
void mono_monitor_enter_v4_trampoline (mgreg_t *regs, guint8 *code, MonoObject *obj, guint8 *tramp);
void mono_monitor_exit_trampoline (mgreg_t *regs, guint8 *code, MonoObject *obj, guint8 *tramp);
gconstpointer mono_get_trampoline_func (MonoTrampolineType tramp_type);
-gpointer mini_get_vtable_trampoline (int slot_index);
+gpointer mini_get_vtable_trampoline (MonoVTable *vt, int slot_index);
const char* mono_get_generic_trampoline_simple_name (MonoTrampolineType tramp_type);
char* mono_get_generic_trampoline_name (MonoTrampolineType tramp_type);
char* mono_get_rgctx_fetch_trampoline_name (int slot);
gpointer mini_get_breakpoint_trampoline (void);
gpointer mini_add_method_trampoline (MonoMethod *m, gpointer compiled_method, gboolean add_static_rgctx_tramp, gboolean add_unbox_tramp);
gpointer mini_add_method_wrappers_llvmonly (MonoMethod *m, gpointer compiled_method, gboolean caller_gsharedvt, gboolean add_unbox_tramp, gpointer *out_arg);
-gpointer mini_create_llvmonly_ftndesc (gpointer addr, gpointer arg);
gboolean mini_jit_info_is_gsharedvt (MonoJitInfo *ji);
gpointer* mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_method, MonoMethod **impl_method, gpointer *out_aot_addr,
gboolean *out_need_rgctx_tramp, MonoMethod **variant_iface);
+MonoFtnDesc *mini_create_llvmonly_ftndesc (MonoDomain *domain, gpointer addr, gpointer arg);
gboolean mono_running_on_valgrind (void);
void* mono_global_codeman_reserve (int size);
void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg);
guint32 mono_arch_get_patch_offset (guint8 *code);
gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, mgreg_t *regs);
-void mono_arch_create_vars (MonoCompile *cfg);
+void mono_arch_create_vars (MonoCompile *cfg) MONO_LLVM_INTERNAL;
void mono_arch_save_unwind_info (MonoCompile *cfg);
void mono_arch_register_lowlevel_calls (void);
gpointer mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr);
public static int test_42_pass_16byte_struct_split () {
return pass_struct16 (null, null, null, null, null, new Struct16 () { a = 42 });
}
+
+ public interface IComparer2
+ {
+ Type foo<T> ();
+ }
+
+ public class AClass : IComparer2 {
+ public Type foo<T> () {
+ return typeof(T);
+ }
+ }
+
+ public static int test_0_delegate_to_virtual_generic_on_ifaces () {
+ IComparer2 c = new AClass ();
+
+ Func<Type> f = c.foo<string>;
+ return f () == typeof(string) ? 0 : 1;
+ }
+
}
#if __MOBILE__
mono_tls_key_set_offset (TLS_KEY_SGEN_TLAB_NEXT_ADDR, tlab_next_addr_offset);
mono_tls_key_set_offset (TLS_KEY_SGEN_TLAB_TEMP_END, tlab_temp_end_offset);
-
- g_assert (tlab_next_addr_offset != -1);
- g_assert (tlab_temp_end_offset != -1);
#endif
#ifdef HEAVY_STATISTICS
{
gboolean seen = FALSE;
+ // If TO set includes corlib, the FROM set may
+ // implicitly reference corlib, even if it's not
+ // present in the set explicitly.
+ if (to->images[to_idx] == mono_defaults.corlib)
+ seen = TRUE;
+
// For each item in to->images, scan over from->images looking for it.
for (from_idx = 0; !seen && from_idx < from->nimages; from_idx++)
{