AC_DEFUN([LARGE_FILES], [
large_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $1"
- AC_TRY_RUN([
+ AC_TRY_COMPILE([
#include <sys/types.h>
+ #include <limits.h>
+ ], [
+ /* Lifted this compile time assert method from: http://www.jaggersoft.com/pubs/CVu11_3.html */
+ #define COMPILE_TIME_ASSERT(pred) \
+ switch(0){case 0:case pred:;}
- #define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
-
- int main(void) {
- int big_off_t=((BIG_OFF_T%2147483629==721) &&
- (BIG_OFF_T%2147483647==1));
- if(big_off_t) {
- exit(0);
- } else {
- exit(1);
- }
+ int main(void)
+ {
+ COMPILE_TIME_ASSERT(sizeof(off_t) * CHAR_BIT == 64);
+ return 0;
}
], [
AC_MSG_RESULT(ok)
large_offt=yes
], [
AC_MSG_RESULT(no)
- ], "")
+ ])
CPPFLAGS=$large_CPPFLAGS
])
ResolveAssemblies ();
ResolveAssemblyFiles ();
+ resolvedFiles = tempResolvedFiles.ToArray ();
alreadyScannedAssemblyNames = new Dictionary<string, string> ();
foreach (PrimaryReference pref in primaryReferences)
ResolveAssemblyFileDependencies (pref.TaskItem, pref.ParentCopyLocal);
- resolvedFiles = tempResolvedFiles.ToArray ();
copyLocalFiles = tempCopyLocalFiles.Values.ToArray ();
satelliteFiles = tempSatelliteFiles.Values.ToArray ();
relatedFiles = tempRelatedFiles.Values.ToArray ();
aname, asm.FullName, parent_copy_local);
if (resolved_ref != null && !IsFromGacOrTargetFramework (resolved_ref)
- && resolved_ref.FoundInSearchPath != SearchPath.PkgConfig)
+ && resolved_ref.FoundInSearchPath != SearchPath.PkgConfig) {
+ tempResolvedDepFiles[resolved_ref.AssemblyName.FullName] = resolved_ref.TaskItem;
dependencies.Enqueue (resolved_ref.TaskItem.ItemSpec);
+ }
}
alreadyScannedAssemblyNames.Add (asm.FullName, String.Empty);
}
using System;
using System.Collections;
+using System.Linq;
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Tasks;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Tasks {
-
+
[TestFixture]
public class ResolveAssemblyReferenceTest {
-
+
Engine engine;
Project project;
BuildItemGroup big;
[Test]
- [Ignore ("it won't succeed if mono is not installed")]
public void TestGac1 ()
{
- string documentString = @"
- <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
- <ItemGroup>
- <Reference Include='System' />
- </ItemGroup>
- <PropertyGroup>
- <SearchPaths>
- {CandidateAssemblyFiles};
- $(ReferencePath);
- {HintPathFromItem};
- {TargetFrameworkDirectory};
- {AssemblyFolders};
- {GAC};
- {RawFileName};
- $(OutputPath)
- </SearchPaths>
- </PropertyGroup>
- <Target Name='A'>
- <ResolveAssemblyReference
- Assemblies='@(Reference)'
- SearchPaths='$(SearchPaths)'
- >
- <Output TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
- </ResolveAssemblyReference>
- </Target>
- </Project>
- ";
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly ("System", null));
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
+ }
+
+ [Test]
+ public void TestHintPath1 ()
+ {
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
- project.LoadXml (documentString);
-
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\test.dll"));
+
Assert.IsTrue (project.Build ("A"), "A1");
big = project.GetEvaluatedItemsByName ("ResolvedFiles");
Assert.AreEqual (1, big.Count, "A2");
Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
}
+
+ [Test]
+ public void ResolveBinary_FancyStuff ()
+ {
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\FancyStuff.dll"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("FancyStuff.dll"), "A3");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (1, big.Count, "A4");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("SimpleWrite.dll")), "A5");
+ }
+
+ [Test]
+ public void ResolveBinary_SimpleWrite ()
+ {
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\SimpleWrite.dll"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("SimpleWrite.dll"), "A3");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (0, big.Count, "A4");
+ }
+
+ [Test]
+ public void ResolveBinary_Testing ()
+ {
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\Testing.dll"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("Testing.dll"), "A3");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (0, big.Count, "A4");
+ }
+
+ [Test]
+ public void ResolveBinary_XbuildReferenceBugTest ()
+ {
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\XbuildReferenceBugTest.exe"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("XbuildReferenceBugTest.exe"), "A3");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (3, big.Count, "A4");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("SimpleWrite.dll")), "A5");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("FancyStuff.dll")), "A6");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("Testing.dll")), "A7");
+ }
[Test]
- [Ignore ("it won't succeed if mono is not installed")]
- public void TestHintPath1 ()
+ public void ResolveBinary_FancyStuffAndXbuild ()
{
- string documentString = @"
- <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\FancyStuff.dll", @"Test\resources\binary\XbuildReferenceBugTest.exe"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (2, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("FancyStuff.dll"), "A3");
+ Assert.IsTrue (big[1].Include.EndsWith ("XbuildReferenceBugTest.exe"), "A3");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (2, big.Count, "A4");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("SimpleWrite.dll")), "A5");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("Testing.dll")), "A6");
+ }
+
+ [Test]
+ public void ResolveBinary_SameAssemblyTwice ()
+ {
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (ResolveAssembly (null, @"Test\resources\binary\XbuildReferenceBugTest.exe", @"Test\resources\binary\XbuildReferenceBugTest2.exe"));
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (2, big.Count, "A2");
+ Assert.IsTrue (big[0].Include.EndsWith ("XbuildReferenceBugTest.exe"), "A3");
+ Assert.IsTrue (big[1].Include.EndsWith ("XbuildReferenceBugTest2.exe"), "A3b");
+
+ big = project.GetEvaluatedItemsByName ("ResolvedDependencyFiles");
+ Assert.AreEqual (3, big.Count, "A4");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("SimpleWrite.dll")), "A5");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("FancyStuff.dll")), "A6");
+ Assert.IsTrue (big.Cast<BuildItem> ().Any (item => item.Include.EndsWith ("Testing.dll")), "A7");
+ }
+
+ string ResolveAssembly (string gacAssembly, params string[] hintPaths)
+ {
+ string reference = "";
+ if (string.IsNullOrEmpty (gacAssembly)) {
+ foreach (var hintPath in hintPaths) {
+ reference += string.Format (
+ @"<Reference Include='{0}'>
+ <HintPath>{1}</HintPath>
+ </Reference>", System.IO.Path.GetFileNameWithoutExtension (hintPath), hintPath);
+ }
+ } else {
+ reference += string.Format (
+ @"<Reference Include='{0}'/>", gacAssembly);
+ }
+
+ return @"
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
- <Reference Include='test'>
- <HintPath>Test\resources\test.dll</HintPath>
- </Reference>
+ " + reference + @"
</ItemGroup>
<PropertyGroup>
<SearchPaths>
SearchPaths='$(SearchPaths)'
>
<Output TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
+ <Output TaskParameter='ResolvedDependencyFiles' ItemName='ResolvedDependencyFiles'/>
</ResolveAssemblyReference>
</Target>
</Project>
";
-
- engine = new Engine (Consts.BinPath);
- project = engine.CreateNewProject ();
- project.LoadXml (documentString);
-
- Assert.IsTrue (project.Build ("A"), "A1");
- big = project.GetEvaluatedItemsByName ("ResolvedFiles");
- Assert.AreEqual (1, big.Count, "A2");
- Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
}
}
}
RESOURCES = $(RESX_RESOURCES) $(OTHER_RESOURCES)
+PREBUILT = $(RESX_RESOURCES:=.prebuilt)
+
LIBRARY = Mono.Data.Sqlite.dll
LIB_MCS_FLAGS = /unsafe /r:System.dll /r:System.Data.dll /r:System.Transactions.dll /r:System.Xml.dll \
$(RESOURCES:%=-resource:%) -d:SQLITE_STANDARD
resources/ChangeLog \
resources/DataTypes.xml \
resources/MetaDataCollections.xml \
+ $(PREBUILT) \
$(wildcard resources/*.bmp)
CLEAN_FILES += $(RESX_RESOURCES)
+CLEAN_FILES = $(RESX_RESOURCES)
+
test-local: test.db
test.db: Test/test.sql
$(the_lib): $(RESOURCES)
+$(PREBUILT): %.prebuilt: %
+ cp $* $@
+
$(RESX_RESOURCES): %.resources: %.resx
- $(RESGEN) $<
+ $(RESGEN) $< || cp $@.prebuilt $@
+
protected void OnPingCompleted (PingCompletedEventArgs e)
{
- if (PingCompleted != null)
- PingCompleted (this, e);
user_async_state = null;
worker = null;
#if NET_4_5
cts = null;
#endif
+
+ if (PingCompleted != null)
+ PingCompleted (this, e);
}
// Sync
int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback
SslPolicyErrors errors = 0;
X509Chain chain = null;
+ bool result = false;
#if !MONOTOUCH
chain = new X509Chain ();
chain.ChainPolicy = new X509ChainPolicy ();
Console.Error.WriteLine ("Please, report this problem to the Mono team");
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
}
-#endif
- if (!CheckCertificateUsage (leaf)) {
- errors |= SslPolicyErrors.RemoteCertificateChainErrors;
- status11 = -2146762490; //CERT_E_PURPOSE 0x800B0106
- }
- if (!CheckServerIdentity (certs [0], Host)) {
- errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
- status11 = -2146762481; // CERT_E_CN_NO_MATCH 0x800B010F
- }
+ // for OSX and iOS we're using the native API to check for the SSL server policy and host names
+ if (!is_macosx) {
+ if (!CheckCertificateUsage (leaf)) {
+ errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+ status11 = -2146762490; //CERT_E_PURPOSE 0x800B0106
+ }
- bool result = false;
- // No certificate root found means no mozroots or monotouch
-#if !MONOTOUCH
- if (is_macosx) {
+ if (!CheckServerIdentity (certs [0], Host)) {
+ errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
+ status11 = -2146762481; // CERT_E_CN_NO_MATCH 0x800B010F
+ }
+ } else {
#endif
// Attempt to use OSX certificates
// Ideally we should return the SecTrustResult
MSX.OSX509Certificates.SecTrustResult trustResult = MSX.OSX509Certificates.SecTrustResult.Deny;
try {
- trustResult = MSX.OSX509Certificates.TrustEvaluateSsl (certs);
+ trustResult = MSX.OSX509Certificates.TrustEvaluateSsl (certs, Host);
// We could use the other values of trustResult to pass this extra information
// to the .NET 2 callback for values like SecTrustResult.Confirm
result = (trustResult == MSX.OSX509Certificates.SecTrustResult.Proceed ||
} catch {
// Ignore
}
- // Clear error status if the OS told us to trust the certificate
- if (result) {
- status11 = 0;
- errors = 0;
- } else {
+
+ if (!result) {
// callback and DefaultCertificatePolicy needs this since 'result' is not specified
status11 = (int) trustResult;
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
#if MONODROID
result = AndroidPlatform.TrustEvaluateSsl (certs, sender, leaf, chain, errors);
- if (result) {
- status11 = 0;
- errors = 0;
- }
#endif
if (policy != null && (!(policy is DefaultCertificatePolicy) || cb == null)) {
}
return (int) result;
}
-
+#if !MONOTOUCH
static SslPolicyErrors GetErrorsFromChain (X509Chain chain)
{
SslPolicyErrors errors = SslPolicyErrors.None;
string start = pattern.Substring (0, index);
return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0);
}
+#endif
}
#endif
}
// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+// Copyright 2012 Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
extern static int SecTrustCreateWithCertificates (IntPtr certOrCertArray, IntPtr policies, out IntPtr sectrustref);
[DllImport (SecurityLibrary)]
- extern static IntPtr SecPolicyCreateSSL (int server, IntPtr cfStringHostname);
+ extern static IntPtr SecPolicyCreateSSL (bool server, IntPtr cfStringHostname);
[DllImport (SecurityLibrary)]
extern static int SecTrustEvaluate (IntPtr secTrustRef, out SecTrustResult secTrustResultTime);
+ [DllImport (CoreFoundationLibrary, CharSet=CharSet.Unicode)]
+ extern static IntPtr CFStringCreateWithCharacters (IntPtr allocator, string str, int count);
+
[DllImport (CoreFoundationLibrary)]
unsafe extern static IntPtr CFDataCreate (IntPtr allocator, byte *bytes, IntPtr length);
ResultOtherError,
}
- static IntPtr sslsecpolicy = SecPolicyCreateSSL (0, IntPtr.Zero);
-
static IntPtr MakeCFData (byte [] data)
{
unsafe {
}
}
- public static SecTrustResult TrustEvaluateSsl (X509CertificateCollection certificates)
+ public static SecTrustResult TrustEvaluateSsl (X509CertificateCollection certificates, string host)
{
+ if (certificates == null)
+ return SecTrustResult.Deny;
+
try {
- return _TrustEvaluateSsl (certificates);
+ return _TrustEvaluateSsl (certificates, host);
} catch {
return SecTrustResult.Deny;
}
}
- static SecTrustResult _TrustEvaluateSsl (X509CertificateCollection certificates)
+ static SecTrustResult _TrustEvaluateSsl (X509CertificateCollection certificates, string hostName)
{
- if (certificates == null)
- throw new ArgumentNullException ("certificates");
-
int certCount = certificates.Count;
IntPtr [] cfDataPtrs = new IntPtr [certCount];
IntPtr [] secCerts = new IntPtr [certCount];
IntPtr certArray = IntPtr.Zero;
+ IntPtr sslsecpolicy = IntPtr.Zero;
+ IntPtr host = IntPtr.Zero;
try {
for (int i = 0; i < certCount; i++)
return SecTrustResult.Deny;
}
certArray = FromIntPtrs (secCerts);
+ host = CFStringCreateWithCharacters (IntPtr.Zero, hostName, hostName.Length);
+ sslsecpolicy = SecPolicyCreateSSL (true, host);
IntPtr sectrust;
int code = SecTrustCreateWithCertificates (certArray, sslsecpolicy, out sectrust);
if (code == 0){
for (int i = 0; i < certCount; i++)
if (secCerts [i] != IntPtr.Zero)
CFRelease (secCerts [i]);
+
+ if (sslsecpolicy != IntPtr.Zero)
+ CFRelease (sslsecpolicy);
+ if (host != IntPtr.Zero)
+ CFRelease (host);
}
}
}
Marshal.ThrowExceptionForHR (hr);
ComInteropProxy obj = FindProxy (ppv);
if (obj == null) {
- Marshal.Release (pItf);
+ Marshal.Release (ppv);
return new ComInteropProxy (ppv);
}
else {
- Marshal.Release (pItf);
+ Marshal.Release (ppv);
System.Threading.Interlocked.Increment (ref obj.ref_count);
return obj;
}
// or it's a parameter
//
if (CurrentAnonymousMethod.IsIterator)
- return local.IsParameter || CurrentBlock.Explicit.HasYield;
+ return local.IsParameter || local.Block.Explicit.HasYield;
//
// Capture only if this or any of child blocks contain await
// or it's a parameter
//
if (CurrentAnonymousMethod is AsyncInitializer)
- return local.IsParameter || CurrentBlock.Explicit.HasAwait;
+ return local.IsParameter || local.Block.Explicit.HasAwait || CurrentBlock.Explicit.HasAwait;
return local.Block.ParametersBlock != CurrentBlock.ParametersBlock.Original;
}
// if the type matches
//
Expression e = fp.DefaultValue;
- if (!(e is Constant) || e.Type.IsGenericOrParentIsGeneric || e.Type.IsGenericParameter) {
+ if (!(e is Constant) || e.Type != ptypes [i]) {
//
// LAMESPEC: No idea what the exact rules are for System.Reflection.Missing.Value instead of null
//
- if (e == EmptyExpression.MissingValue && ptypes[i].BuiltinType == BuiltinTypeSpec.Type.Object || ptypes[i].BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
+ var ptype = ptypes [i];
+ if (e == EmptyExpression.MissingValue && ptype.BuiltinType == BuiltinTypeSpec.Type.Object || ptype.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
e = new MemberAccess (new MemberAccess (new MemberAccess (
new QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, "System", loc), "Reflection", loc), "Missing", loc), "Value", loc);
+ } else if (e is Constant) {
+ //
+ // Handles int to int? conversions
+ //
+ e = Convert.ImplicitConversionStandard (ec, e, ptype, loc);
+
+ //
+ // When constant type paramter contains type argument
+ //
+ // Foo (T[] arg = null)
+ //
+ if (e == null) {
+ e = new DefaultValueExpression (new TypeExpression (ptype, loc), loc);
+ }
} else {
- e = new DefaultValueExpression (new TypeExpression (ptypes [i], loc), loc);
+ e = new DefaultValueExpression (new TypeExpression (ptype, loc), loc);
}
+
e = e.Resolve (ec);
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+public class CompilerBug
+{
+ static void Main ()
+ {
+ foreach (string message in Foo ())
+ Console.WriteLine (message);
+ }
+
+ static IEnumerable<string> Foo ()
+ {
+ Action fnAction;
+ {
+ fnAction = () => { };
+ }
+ yield return "Executing action";
+ {
+ fnAction ();
+ }
+ yield return "Action executed";
+ }
+}
--- /dev/null
+using System;
+
+public class Usage
+{
+ public static void Main ()
+ {
+ var bug = new Bug ();
+ string[] tags = bug.MethodWithOptionalParameter<string> (0);
+ }
+}
+
+public class Bug
+{
+ public TValue[] MethodWithOptionalParameter<TValue> (int index, TValue[] defaultValue = null)
+ {
+ return null;
+ }
+}
+
--- /dev/null
+using System;
+using System.Threading.Tasks;
+
+public class CompilerBug
+{
+ static void Main ()
+ {
+ var res = Foo ().Result;
+ Console.WriteLine (res);
+ return;
+ }
+
+ static async Task<string> Foo ()
+ {
+ Action fnAction;
+ {
+ fnAction = () => { };
+ }
+ await Task.Delay (10);
+ {
+ fnAction ();
+ }
+ return "val";
+ }
+}
</method>\r
</type>\r
</test>\r
+ <test name="gtest-iter-27.cs">\r
+ <type name="CompilerBug">\r
+ <method name="Void Main()" attrs="145">\r
+ <size>61</size>\r
+ </method>\r
+ <method name="IEnumerable`1 Foo()" attrs="145">\r
+ <size>23</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="CompilerBug+<Foo>c__Iterator0">\r
+ <method name="System.String System.Collections.Generic.IEnumerator<string>.get_Current()" attrs="2529">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="IEnumerator`1 System.Collections.Generic.IEnumerable<string>.GetEnumerator()" attrs="481">\r
+ <size>26</size>\r
+ </method>\r
+ <method name="Boolean MoveNext()" attrs="486">\r
+ <size>161</size>\r
+ </method>\r
+ <method name="Void Dispose()" attrs="486">\r
+ <size>15</size>\r
+ </method>\r
+ <method name="Void Reset()" attrs="486">\r
+ <size>6</size>\r
+ </method>\r
+ <method name="Void <>m__0()" attrs="145">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-lambda-01.cs">\r
<type name="IntFunc">\r
<method name="Int32 Invoke(Int32)" attrs="454">\r
</method>\r
</type>\r
</test>\r
+ <test name="gtest-optional-25.cs">\r
+ <type name="Usage">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="Bug">\r
+ <method name="TValue[] MethodWithOptionalParameter[TValue](Int32, TValue[])" attrs="134">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-partial-01.cs">\r
<type name="B`1[U]">\r
<method name="Void .ctor()" attrs="6278">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-async-39.cs">\r
+ <type name="CompilerBug">\r
+ <method name="Void Main()" attrs="145">\r
+ <size>24</size>\r
+ </method>\r
+ <method name="System.Threading.Tasks.Task`1[System.String] Foo()" attrs="145">\r
+ <size>33</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="CompilerBug+<Foo>c__async0">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>220</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Void <>m__0()" attrs="145">\r
+ <size>2</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-cls-00.cs">\r
<type name="CLSCLass_6">\r
<method name="Void add_Disposed(Delegate)" attrs="2182">\r
struct _MonoGenericParam {
MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
guint16 num;
+ /* For internal runtime use, used to make different versions of the same param */
+ guint16 serial;
/*
* If owner is NULL, or owner is 'owned' by this gparam,
* then this is the image whose mempool this struct was allocated from.
static MonoClass *
get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar)
{
- int n = mono_generic_param_num (param);
+ int n = mono_generic_param_num (param) | ((guint32)param->serial << 16);
MonoImage *image = param->image;
GHashTable *ht;
static void
set_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, MonoClass *klass)
{
- int n = mono_generic_param_num (param);
+ int n = mono_generic_param_num (param) | ((guint32)param->serial << 16);
MonoImage *image = param->image;
GHashTable *ht;
MonoMethodSignature *sig, *csig;
MonoMethodBuilder *mb;
MonoMethod *res;
+ WrapperInfo *info;
int i;
mb = mono_mb_new_no_dup_name (class, name, MONO_WRAPPER_MANAGED_TO_MANAGED);
res = mono_mb_create_method (mb, csig, csig->param_count + 16);
+ info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER);
+ info->d.generic_array_helper.method = method;
+ mono_marshal_set_wrapper_info (res, info);
+
mono_mb_free (mb);
return res;
WRAPPER_SUBTYPE_ICALL_WRAPPER,
WRAPPER_SUBTYPE_NATIVE_FUNC_AOT,
/* Subtypes of MONO_WRAPPER_UNKNOWN */
- WRAPPER_SUBTYPE_SYNCHRONIZED_INNER
+ WRAPPER_SUBTYPE_SYNCHRONIZED_INNER,
+ /* Subtypes of MONO_WRAPPER_MANAGED_TO_MANAGED */
+ WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER
} WrapperSubtype;
typedef struct {
MonoMethod *method;
} SynchronizedInnerWrapperInfo;
+typedef struct {
+ MonoMethod *method;
+} GenericArrayHelperWrapperInfo;
+
/*
* This structure contains additional information to uniquely identify a given wrapper
* method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
ManagedToNativeWrapperInfo managed_to_native;
/* SYNCHRONIZED_INNER */
SynchronizedInnerWrapperInfo synchronized_inner;
+ /* GENERIC_ARRAY_HELPER */
+ GenericArrayHelperWrapperInfo generic_array_helper;
} d;
} WrapperInfo;
return TRUE;
if (mono_generic_param_num (p1) != mono_generic_param_num (p2))
return FALSE;
+ if (p1->serial != p2->serial)
+ return FALSE;
/*
* We have to compare the image as well because if we didn't,
offset &= 0xffffff;
offset /= sizeof (gpointer);
/* offset is now the bitmap offset */
- for (i = 0; i < max_set; ++i) {
+ for (i = 0; i <= max_set; ++i) {
if (bitmap [i / sizeof (uintptr_t)] & (1L << (i & (sizeof (uintptr_t) * 8 -1))))
rb [(offset + i) / (sizeof (uintptr_t) * 8)] |= (1L << ((offset + i) & (sizeof (uintptr_t) * 8 -1)));
}
generics.cs \
generics-variant-types.il\
basic-simd.cs \
- aot-tests.cs
+ aot-tests.cs \
+ gc-test.cs
regtests=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe
rcheck: mono $(regtests)
$(RUNTIME) --regression $(regtests)
+gctest: mono gc-test.exe
+ MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(RUNTIME) --regression gc-test.exe
+
LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,)
aotcheck: mono $(regtests)
- rm -f *.exe.so
+ rm -f *.exe.so *.exe.dylib
$(RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot $(regtests) || exit 1
for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
- rm -f *.exe.so
+ rm -f *.exe.so *.exe.dylib
llvmaotcheck:
$(MAKE) aotcheck LLVM=1
}
} else if ((klass->byval_arg.type == MONO_TYPE_VAR) || (klass->byval_arg.type == MONO_TYPE_MVAR)) {
MonoGenericContainer *container = mono_type_get_generic_param_owner (&klass->byval_arg);
- g_assert (container);
+ MonoGenericParam *par = klass->byval_arg.data.generic_param;
encode_value (MONO_AOT_TYPEREF_VAR, p, &p);
encode_value (klass->byval_arg.type, p, &p);
encode_value (mono_type_get_generic_param_num (&klass->byval_arg), p, &p);
-
- encode_value (container->is_method, p, &p);
- if (container->is_method)
- encode_method_ref (acfg, container->owner.method, p, &p);
- else
- encode_klass_ref (acfg, container->owner.klass, p, &p);
+
+ encode_value (container ? 1 : 0, p, &p);
+ if (container) {
+ encode_value (container->is_method, p, &p);
+ g_assert (par->serial == 0);
+ if (container->is_method)
+ encode_method_ref (acfg, container->owner.method, p, &p);
+ else
+ encode_klass_ref (acfg, container->owner.klass, p, &p);
+ } else {
+ encode_value (par->serial, p, &p);
+ }
} else if (klass->byval_arg.type == MONO_TYPE_PTR) {
encode_value (MONO_AOT_TYPEREF_PTR, p, &p);
encode_type (acfg, &klass->byval_arg, p, &p);
}
case MONO_AOT_TYPEREF_VAR: {
MonoType *t;
- MonoGenericContainer *container;
+ MonoGenericContainer *container = NULL;
int type = decode_value (p, &p);
int num = decode_value (p, &p);
- gboolean is_method = decode_value (p, &p);
+ gboolean has_container = decode_value (p, &p);
+ int serial = 0;
- if (is_method) {
- MonoMethod *method_def;
- g_assert (type == MONO_TYPE_MVAR);
- method_def = decode_resolve_method_ref (module, p, &p);
- if (!method_def)
- return NULL;
-
- container = mono_method_get_generic_container (method_def);
+ if (has_container) {
+ gboolean is_method = decode_value (p, &p);
+
+ if (is_method) {
+ MonoMethod *method_def;
+ g_assert (type == MONO_TYPE_MVAR);
+ method_def = decode_resolve_method_ref (module, p, &p);
+ if (!method_def)
+ return NULL;
+
+ container = mono_method_get_generic_container (method_def);
+ } else {
+ MonoClass *class_def;
+ g_assert (type == MONO_TYPE_VAR);
+ class_def = decode_klass_ref (module, p, &p);
+ if (!class_def)
+ return NULL;
+
+ container = class_def->generic_container;
+ }
} else {
- MonoClass *class_def;
- g_assert (type == MONO_TYPE_VAR);
- class_def = decode_klass_ref (module, p, &p);
- if (!class_def)
- return NULL;
-
- container = class_def->generic_container;
+ serial = decode_value (p, &p);
}
- g_assert (container);
-
// FIXME: Memory management
t = g_new0 (MonoType, 1);
t->type = type;
- t->data.generic_param = mono_generic_container_get_param (container, num);
+
+ if (container) {
+ t->data.generic_param = mono_generic_container_get_param (container, num);
+ g_assert (serial == 0);
+ } else {
+ /* Anonymous */
+ MonoGenericParam *par = (MonoGenericParam*)g_new0 (MonoGenericParamFull, 1);
+ par->num = num;
+ par->serial = serial;
+ // FIXME:
+ par->image = mono_defaults.corlib;
+ t->data.generic_param = par;
+ }
// FIXME: Maybe use types directly to avoid
// the overhead of creating MonoClass-es
#define ABBREV_PARAM_LOCLIST 15
#define ABBREV_INHERITANCE 16
#define ABBREV_STRUCT_TYPE_NOCHILDREN 17
+#define ABBREV_TRAMP_SUBPROGRAM 18
static int compile_unit_attr [] = {
DW_AT_producer ,DW_FORM_string,
DW_AT_frame_base , DW_FORM_block1
};
+static int tramp_subprogram_attr [] = {
+ DW_AT_name , DW_FORM_string,
+ DW_AT_description , DW_FORM_string,
+ DW_AT_low_pc , DW_FORM_addr,
+ DW_AT_high_pc , DW_FORM_addr,
+};
+
static int param_attr [] = {
DW_AT_name, DW_FORM_string,
DW_AT_type, DW_FORM_ref4,
reference_type_attr, G_N_ELEMENTS (reference_type_attr));
emit_dwarf_abbrev (w, ABBREV_INHERITANCE, DW_TAG_inheritance, FALSE,
inheritance_attr, G_N_ELEMENTS (inheritance_attr));
+ emit_dwarf_abbrev (w, ABBREV_TRAMP_SUBPROGRAM, DW_TAG_subprogram, FALSE,
+ tramp_subprogram_attr, G_N_ELEMENTS (tramp_subprogram_attr));
emit_byte (w, 0);
emit_section_change (w, ".debug_info", 0);
emit_section_change (w, ".debug_info", 0);
/* Subprogram */
- emit_uleb128 (w, ABBREV_SUBPROGRAM);
+ emit_uleb128 (w, ABBREV_TRAMP_SUBPROGRAM);
emit_string (w, tramp_name);
emit_pointer_value (w, code);
emit_pointer_value (w, code + code_size);
- /* frame_base */
- emit_byte (w, 2);
- emit_byte (w, DW_OP_breg6);
- emit_byte (w, 16);
/* Subprogram end */
emit_uleb128 (w, 0x0);
/* Pop arguments off the stack */
/*
* FIXME: LLVM doesn't push these, we can't use ji->from_llvm as it describes
- * the caller.
+ * the callee.
*/
#ifndef ENABLE_LLVM
if (ji->has_arch_eh_info)
MonoMethod *method = (*lmf)->method;
MonoJitArgumentInfo *arg_info = g_newa (MonoJitArgumentInfo, mono_method_signature (method)->param_count + 1);
- guint32 stack_to_pop = mono_arch_get_argument_info (mono_method_signature (method), mono_method_signature (method)->param_count, arg_info);
+ guint32 stack_to_pop = mono_arch_get_argument_info (NULL, mono_method_signature (method), mono_method_signature (method)->param_count, arg_info);
new_ctx->esp += stack_to_pop;
}
#endif
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Collections;
+using System.Threading;
/*
* Regression tests for the GC support in the JIT
liveness_13_inner (ref arr);
return 0;
}
+
+ static ThreadLocal<object> tls;
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void alloc_tls_obj () {
+ tls = new ThreadLocal<object> ();
+ tls.Value = new object ();
+ }
+
+ public static int test_0_thread_local () {
+ alloc_tls_obj ();
+ GC.Collect ();
+ Type t = tls.Value.GetType ();
+ if (t == typeof (object))
+ return 0;
+ else
+ return 1;
+ }
}
\ No newline at end of file
/* Debugging support */
#if 0
if (supported_tail_call) {
- static int count = 0;
- count ++;
- if (getenv ("COUNT")) {
- if (count == atoi (getenv ("COUNT")))
- printf ("LAST: %s\n", mono_method_full_name (cmethod, TRUE));
- if (count > atoi (getenv ("COUNT")))
- supported_tail_call = FALSE;
- }
+ if (!mono_debug_count ())
+ supported_tail_call = FALSE;
}
#endif
/*------------------------------------------------------------------*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig,
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig,
int param_count,
MonoJitArgumentInfo *arg_info)
{
return "unknown";
}
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
- static int count = 0;
- count ++;
-
- if (!getenv ("COUNT"))
- return TRUE;
-
- if (count == atoi (getenv ("COUNT"))) {
- break_count ();
- }
-
- if (count > atoi (getenv ("COUNT"))) {
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
debug_omit_fp (void)
{
#if 0
- return debug_count ();
+ return mono_debug_count ();
#else
return TRUE;
#endif
* Returns the size of the argument area on the stack.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k;
CallInfo *cinfo = get_call_info (NULL, NULL, csig);
* Returns the size of the activation frame.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k, frame_size = 0;
guint32 size, align, pad;
#ifndef DISABLE_JIT
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
- static int count = 0;
- count ++;
-
- if (!getenv ("COUNT"))
- return TRUE;
-
- if (count == atoi (getenv ("COUNT"))) {
- break_count ();
- }
-
- if (count > atoi (getenv ("COUNT"))) {
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
debug_omit_fp (void)
{
#if 0
- return debug_count ();
+ return mono_debug_count ();
#else
return TRUE;
#endif
} RegTrack;
#ifndef DISABLE_LOGGING
+
+static const char*
+info_type_to_str (MonoRgctxInfoType type)
+{
+ switch (type) {
+ case MONO_RGCTX_INFO_STATIC_DATA: return "STATIC_DATA";
+ case MONO_RGCTX_INFO_KLASS: return "KLASS";
+ case MONO_RGCTX_INFO_VTABLE: return "VTABLE";
+ case MONO_RGCTX_INFO_TYPE: return "TYPE";
+ case MONO_RGCTX_INFO_REFLECTION_TYPE: return "REFLECTION_TYPE";
+ case MONO_RGCTX_INFO_METHOD: return "METHOD";
+ case MONO_RGCTX_INFO_GENERIC_METHOD_CODE: return "GENERIC_METHOD_CODE";
+ case MONO_RGCTX_INFO_CLASS_FIELD: return "CLASS_FIELD";
+ case MONO_RGCTX_INFO_METHOD_RGCTX: return "METHOD_RGCTX";
+ case MONO_RGCTX_INFO_METHOD_CONTEXT: return "METHOD_CONTEXT";
+ case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK: return "REMOTING_INVOKE_WITH_CHECK";
+ case MONO_RGCTX_INFO_METHOD_DELEGATE_CODE: return "METHOD_DELEGATE_CODE";
+ case MONO_RGCTX_INFO_CAST_CACHE: return "CAST_CACHE";
+ default:
+ return "<UNKNOWN RGCTX INFO TYPE>";
+ }
+}
+
+static void
+print_ji (MonoJumpInfo *ji)
+{
+ switch (ji->type) {
+ case MONO_PATCH_INFO_RGCTX_FETCH: {
+ MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry;
+
+ printf ("[RGCTX_FETCH ");
+ print_ji (entry->data);
+ printf (" - %s]", info_type_to_str (entry->info_type));
+ break;
+ }
+ case MONO_PATCH_INFO_METHODCONST: {
+ char *s = mono_method_full_name (ji->data.method, TRUE);
+ printf ("[METHODCONST - %s]", s);
+ g_free (s);
+ break;
+ }
+ default:
+ printf ("[%d]", ji->type);
+ break;
+ }
+}
+
void
mono_print_ins_index (int i, MonoInst *ins)
{
case OP_IAND_IMM:
case OP_IOR_IMM:
case OP_IXOR_IMM:
+ case OP_SUB_IMM:
printf (" [%d]", (int)ins->inst_imm);
break;
case OP_ADD_IMM:
char *full_name = mono_method_full_name (call->method, TRUE);
printf (" [%s]", full_name);
g_free (full_name);
+ } else if (call->fptr_is_patch) {
+ MonoJumpInfo *ji = (MonoJumpInfo*)call->fptr;
+
+ printf (" ");
+ print_ji (ji);
} else if (call->fptr) {
MonoJitICallInfo *info = mono_find_jit_icall_by_addr (call->fptr);
if (info)
//#define ALLOW_PARTIAL_SHARING TRUE
#define ALLOW_PARTIAL_SHARING FALSE
+
+#if 0
+#define DEBUG(...) __VA_ARGS__
+#else
+#define DEBUG(...)
+#endif
static void
mono_class_unregister_image_generic_subclasses (MonoImage *image, gpointer user_data);
/*
* LOCKING: loader lock
*/
-static MonoRuntimeGenericContextOtherInfoTemplate*
-get_other_info_templates (MonoRuntimeGenericContextTemplate *template, int type_argc)
+static MonoRuntimeGenericContextInfoTemplate*
+get_info_templates (MonoRuntimeGenericContextTemplate *template, int type_argc)
{
g_assert (type_argc >= 0);
if (type_argc == 0)
- return template->other_infos;
+ return template->infos;
return g_slist_nth_data (template->method_templates, type_argc - 1);
}
* LOCKING: loader lock
*/
static void
-set_other_info_templates (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc,
- MonoRuntimeGenericContextOtherInfoTemplate *oti)
+set_info_templates (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc,
+ MonoRuntimeGenericContextInfoTemplate *oti)
{
g_assert (type_argc >= 0);
if (type_argc == 0)
- template->other_infos = oti;
+ template->infos = oti;
else {
int length = g_slist_length (template->method_templates);
GSList *list;
/*
* LOCKING: loader lock
*/
-static MonoRuntimeGenericContextOtherInfoTemplate*
+static MonoRuntimeGenericContextInfoTemplate*
rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template, int type_argc, int slot)
{
int i;
- MonoRuntimeGenericContextOtherInfoTemplate *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti;
g_assert (slot >= 0);
- for (oti = get_other_info_templates (template, type_argc), i = 0; i < slot; oti = oti->next, ++i) {
+ for (oti = get_info_templates (template, type_argc), i = 0; i < slot; oti = oti->next, ++i) {
if (!oti)
return NULL;
}
* LOCKING: loader lock
*/
static int
-rgctx_template_num_other_infos (MonoRuntimeGenericContextTemplate *template, int type_argc)
+rgctx_template_num_infos (MonoRuntimeGenericContextTemplate *template, int type_argc)
{
- MonoRuntimeGenericContextOtherInfoTemplate *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti;
int i;
- for (i = 0, oti = get_other_info_templates (template, type_argc); oti; ++i, oti = oti->next)
+ for (i = 0, oti = get_info_templates (template, type_argc); oti; ++i, oti = oti->next)
;
return i;
return mono_image_alloc0 (class->image, size);
}
-static MonoRuntimeGenericContextOtherInfoTemplate*
+static MonoRuntimeGenericContextInfoTemplate*
alloc_oti (MonoImage *image)
{
static gboolean inited = FALSE;
static int num_allocted = 0;
static int num_bytes = 0;
- int size = sizeof (MonoRuntimeGenericContextOtherInfoTemplate);
+ int size = sizeof (MonoRuntimeGenericContextInfoTemplate);
if (!inited) {
mono_counters_register ("RGCTX oti num allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_allocted);
* Some info types expect that each insert results in a new slot been assigned.
*/
static int
-other_info_has_identity (MonoRgctxInfoType info_type)
+info_has_identity (MonoRgctxInfoType info_type)
{
return info_type != MONO_RGCTX_INFO_CAST_CACHE;
}
* LOCKING: loader lock
*/
static void
-rgctx_template_set_other_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc,
+rgctx_template_set_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc,
int slot, gpointer data, MonoRgctxInfoType info_type)
{
static gboolean inited = FALSE;
static int num_data = 0;
int i;
- MonoRuntimeGenericContextOtherInfoTemplate *list = get_other_info_templates (template, type_argc);
- MonoRuntimeGenericContextOtherInfoTemplate **oti = &list;
+ MonoRuntimeGenericContextInfoTemplate *list = get_info_templates (template, type_argc);
+ MonoRuntimeGenericContextInfoTemplate **oti = &list;
if (!inited) {
mono_counters_register ("RGCTX oti num markers", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_markers);
(*oti)->data = data;
(*oti)->info_type = info_type;
- set_other_info_templates (image, template, type_argc, list);
+ set_info_templates (image, template, type_argc, list);
if (data == MONO_RGCTX_SLOT_USED_MARKER)
++num_markers;
}
static gpointer
-inflate_other_data (gpointer data, MonoRgctxInfoType info_type, MonoGenericContext *context, MonoClass *class, gboolean temporary)
+inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *context, MonoClass *class, gboolean temporary)
{
+ gpointer data = oti->data;
+ MonoRgctxInfoType info_type = oti->info_type;
MonoError error;
g_assert (data);
return NULL;
}
-static gpointer
-inflate_other_info (MonoRuntimeGenericContextOtherInfoTemplate *oti,
- MonoGenericContext *context, MonoClass *class, gboolean temporary)
-{
- return inflate_other_data (oti->data, oti->info_type, context, class, temporary);
-}
-
static void
free_inflated_info (MonoRgctxInfoType info_type, gpointer info)
{
}
}
-static MonoRuntimeGenericContextOtherInfoTemplate
+static MonoRuntimeGenericContextInfoTemplate
class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free);
static MonoClass*
* mono_class_get_runtime_generic_context_template:
* @class: a class
*
- * Looks up or constructs, if necessary, the runtime generic context
- * for class.
+ * Looks up or constructs, if necessary, the runtime generic context template for class.
+ * The template is the same for all instantiations of a class.
*/
static MonoRuntimeGenericContextTemplate*
mono_class_get_runtime_generic_context_template (MonoClass *class)
MonoRuntimeGenericContextTemplate *parent_template, *template;
guint32 i;
+ class = get_shared_class (class);
+
mono_loader_lock ();
template = class_lookup_rgctx_template (class);
mono_loader_unlock ();
mono_loader_lock ();
if (class->parent) {
- if (class->parent->generic_class) {
- guint32 num_entries;
- int max_argc, type_argc;
-
- parent_template = mono_class_get_runtime_generic_context_template
- (class->parent->generic_class->container_class);
-
- max_argc = template_get_max_argc (parent_template);
+ guint32 num_entries;
+ int max_argc, type_argc;
- for (type_argc = 0; type_argc <= max_argc; ++type_argc) {
- num_entries = rgctx_template_num_other_infos (parent_template, type_argc);
+ parent_template = mono_class_get_runtime_generic_context_template (class->parent);
+ max_argc = template_get_max_argc (parent_template);
- /* FIXME: quadratic! */
- for (i = 0; i < num_entries; ++i) {
- MonoRuntimeGenericContextOtherInfoTemplate oti;
+ for (type_argc = 0; type_argc <= max_argc; ++type_argc) {
+ num_entries = rgctx_template_num_infos (parent_template, type_argc);
- oti = class_get_rgctx_template_oti (class->parent, type_argc, i, FALSE, FALSE, NULL);
- if (oti.data && oti.data != MONO_RGCTX_SLOT_USED_MARKER) {
- rgctx_template_set_other_slot (class->image, template, type_argc, i,
- oti.data, oti.info_type);
- }
- }
- }
- } else {
- guint32 num_entries;
- int max_argc, type_argc;
-
- parent_template = mono_class_get_runtime_generic_context_template (class->parent);
+ /* FIXME: quadratic! */
+ for (i = 0; i < num_entries; ++i) {
+ MonoRuntimeGenericContextInfoTemplate oti;
- max_argc = template_get_max_argc (parent_template);
-
- for (type_argc = 0; type_argc <= max_argc; ++type_argc) {
- num_entries = rgctx_template_num_other_infos (parent_template, type_argc);
-
- /* FIXME: quadratic! */
- for (i = 0; i < num_entries; ++i) {
- MonoRuntimeGenericContextOtherInfoTemplate oti;
-
- oti = class_get_rgctx_template_oti (class->parent, type_argc, i, FALSE, FALSE, NULL);
- if (oti.data && oti.data != MONO_RGCTX_SLOT_USED_MARKER) {
- rgctx_template_set_other_slot (class->image, template, type_argc, i,
- oti.data, oti.info_type);
- }
+ oti = class_get_rgctx_template_oti (class->parent, type_argc, i, FALSE, FALSE, NULL);
+ if (oti.data && oti.data != MONO_RGCTX_SLOT_USED_MARKER) {
+ rgctx_template_set_slot (class->image, template, type_argc, i,
+ oti.data, oti.info_type);
}
-
}
}
}
}
/*
+ * class_get_rgctx_template_oti:
+ *
+ * Return the info template of CLASS numbered TYPE_ARGC/SLOT.
* temporary signifies whether the inflated info (oti.data) will be
* used temporarily, in which case it might be heap-allocated, or
* permanently, in which case it will be mempool-allocated. If
*
* LOCKING: loader lock
*/
-static MonoRuntimeGenericContextOtherInfoTemplate
+static MonoRuntimeGenericContextInfoTemplate
class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gboolean temporary, gboolean shared, gboolean *do_free)
{
g_assert ((temporary && do_free) || (!temporary && !do_free));
+ DEBUG (printf ("get slot: %s %d\n", mono_type_full_name (&class->byval_arg), slot));
+
if (class->generic_class && !shared) {
- MonoRuntimeGenericContextOtherInfoTemplate oti;
+ MonoRuntimeGenericContextInfoTemplate oti;
gboolean tmp_do_free;
oti = class_get_rgctx_template_oti (class->generic_class->container_class,
type_argc, slot, TRUE, FALSE, &tmp_do_free);
if (oti.data) {
gpointer info = oti.data;
- oti.data = inflate_other_info (&oti, &class->generic_class->context, class, temporary);
+ oti.data = inflate_info (&oti, &class->generic_class->context, class, temporary);
if (tmp_do_free)
free_inflated_info (oti.info_type, info);
}
return oti;
} else {
MonoRuntimeGenericContextTemplate *template;
- MonoRuntimeGenericContextOtherInfoTemplate *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti;
template = mono_class_get_runtime_generic_context_template (class);
oti = rgctx_template_get_other_slot (template, type_argc, slot);
}
static gpointer
-instantiate_other_info (MonoDomain *domain, MonoRuntimeGenericContextOtherInfoTemplate *oti,
+instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti,
MonoGenericContext *context, MonoClass *class)
{
gpointer data;
temporary = FALSE;
}
- data = inflate_other_info (oti, context, class, temporary);
+ data = inflate_info (oti, context, class, temporary);
switch (oti->info_type) {
case MONO_RGCTX_INFO_STATIC_DATA:
MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (class);
MonoClass *subclass;
- rgctx_template_set_other_slot (class->image, template, type_argc, index, data, info_type);
+ rgctx_template_set_slot (class->image, template, type_argc, index, data, info_type);
/* Recurse for all subclasses */
if (generic_subclass_hash)
subclass = NULL;
while (subclass) {
- MonoRuntimeGenericContextOtherInfoTemplate subclass_oti;
+ MonoRuntimeGenericContextInfoTemplate subclass_oti;
MonoRuntimeGenericContextTemplate *subclass_template = class_lookup_rgctx_template (subclass);
g_assert (subclass_template);
}
}
+G_GNUC_UNUSED static const char*
+info_type_to_str (MonoRgctxInfoType type)
+{
+ switch (type) {
+ case MONO_RGCTX_INFO_STATIC_DATA: return "STATIC_DATA";
+ case MONO_RGCTX_INFO_KLASS: return "KLASS";
+ case MONO_RGCTX_INFO_VTABLE: return "VTABLE";
+ case MONO_RGCTX_INFO_TYPE: return "TYPE";
+ case MONO_RGCTX_INFO_REFLECTION_TYPE: return "REFLECTION_TYPE";
+ case MONO_RGCTX_INFO_METHOD: return "METHOD";
+ case MONO_RGCTX_INFO_GENERIC_METHOD_CODE: return "GENERIC_METHOD_CODE";
+ case MONO_RGCTX_INFO_CLASS_FIELD: return "CLASS_FIELD";
+ case MONO_RGCTX_INFO_METHOD_RGCTX: return "METHOD_RGCTX";
+ case MONO_RGCTX_INFO_METHOD_CONTEXT: return "METHOD_CONTEXT";
+ case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK: return "REMOTING_INVOKE_WITH_CHECK";
+ case MONO_RGCTX_INFO_METHOD_DELEGATE_CODE: return "METHOD_DELEGATE_CODE";
+ case MONO_RGCTX_INFO_CAST_CACHE: return "CAST_CACHE";
+ default:
+ return "<>";
+ }
+}
+
+G_GNUC_UNUSED static char*
+rgctx_info_to_str (MonoRgctxInfoType info_type, gpointer data)
+{
+ switch (info_type) {
+ case MONO_RGCTX_INFO_VTABLE:
+ return mono_type_full_name ((MonoType*)data);
+ default:
+ return g_strdup_printf ("<%p>", data);
+ }
+}
+
/*
* LOCKING: loader lock
*/
static int
-register_other_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type)
+register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type)
{
int i;
MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (class);
MonoClass *parent;
- MonoRuntimeGenericContextOtherInfoTemplate *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti;
- for (i = 0, oti = get_other_info_templates (template, type_argc); oti; ++i, oti = oti->next) {
+ for (i = 0, oti = get_info_templates (template, type_argc); oti; ++i, oti = oti->next) {
if (!oti->data)
break;
}
- //g_print ("template %s . other_infos [%d] = %s\n", mono_type_get_full_name (class), i, mono_type_get_full_name (other_class));
+ DEBUG (printf ("set slot %s, infos [%d] = %s, %s\n", mono_type_get_full_name (class), i, info_type_to_str (info_type), rgctx_info_to_str (info_type, data)));
/* Mark the slot as used in all parent classes (until we find
a parent class which already has it marked used). */
parent = class->parent;
while (parent != NULL) {
MonoRuntimeGenericContextTemplate *parent_template;
- MonoRuntimeGenericContextOtherInfoTemplate *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti;
if (parent->generic_class)
parent = parent->generic_class->container_class;
if (oti && oti->data)
break;
- rgctx_template_set_other_slot (parent->image, parent_template, type_argc, i,
- MONO_RGCTX_SLOT_USED_MARKER, 0);
+ rgctx_template_set_slot (parent->image, parent_template, type_argc, i,
+ MONO_RGCTX_SLOT_USED_MARKER, 0);
parent = parent->parent;
}
}
static gboolean
-other_info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type)
+info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type)
{
switch (info_type) {
case MONO_RGCTX_INFO_STATIC_DATA:
}
static int
-lookup_or_register_other_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type,
+lookup_or_register_info (MonoClass *class, int type_argc, gpointer data, MonoRgctxInfoType info_type,
MonoGenericContext *generic_context)
{
static gboolean inited = FALSE;
MonoRuntimeGenericContextTemplate *rgctx_template =
mono_class_get_runtime_generic_context_template (class);
- MonoRuntimeGenericContextOtherInfoTemplate *oti_list, *oti;
+ MonoRuntimeGenericContextInfoTemplate *oti_list, *oti;
int i;
+ class = get_shared_class (class);
+
mono_loader_lock ();
- if (other_info_has_identity (info_type)) {
- oti_list = get_other_info_templates (rgctx_template, type_argc);
+ if (info_has_identity (info_type)) {
+ oti_list = get_info_templates (rgctx_template, type_argc);
for (oti = oti_list, i = 0; oti; oti = oti->next, ++i) {
gpointer inflated_data;
if (oti->info_type != info_type || !oti->data)
continue;
- inflated_data = inflate_other_info (oti, generic_context, class, TRUE);
+ inflated_data = inflate_info (oti, generic_context, class, TRUE);
- if (other_info_equal (data, inflated_data, info_type)) {
+ if (info_equal (data, inflated_data, info_type)) {
free_inflated_info (info_type, inflated_data);
mono_loader_unlock ();
return i;
}
/* We haven't found the info */
- i = register_other_info (class, type_argc, data, info_type);
+ i = register_info (class, type_argc, data, info_type);
mono_loader_unlock ();
}
/*
- * mono_method_lookup_or_register_other_info:
+ * mono_method_lookup_or_register_info:
* @method: a method
* @in_mrgctx: whether to put the data into the MRGCTX
* @data: the info data
* encoded slot number.
*/
guint32
-mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
+mono_method_lookup_or_register_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
MonoRgctxInfoType info_type, MonoGenericContext *generic_context)
{
MonoClass *class = method->klass;
type_argc = 0;
}
- index = lookup_or_register_other_info (class, type_argc, data, info_type, generic_context);
+ index = lookup_or_register_info (class, type_argc, data, info_type, generic_context);
//g_print ("rgctx item at index %d argc %d\n", index, type_argc);
MonoDomain *domain = class_vtable->domain;
MonoClass *class = class_vtable->klass;
MonoGenericContext *class_context = class->generic_class ? &class->generic_class->context : NULL;
- MonoRuntimeGenericContextOtherInfoTemplate oti;
+ MonoRuntimeGenericContextInfoTemplate oti;
MonoGenericContext context = { class_context ? class_context->class_inst : NULL, method_inst };
int rgctx_index;
gboolean do_free;
oti = class_get_rgctx_template_oti (get_shared_class (class),
method_inst ? method_inst->type_argc : 0, slot, TRUE, TRUE, &do_free);
/* This might take the loader lock */
- info = instantiate_other_info (domain, &oti, &context, class);
+ info = instantiate_info (domain, &oti, &context, class);
/*
if (method_inst)
* @class_vtable: a vtable
* @slot: a slot index to be instantiated
*
- * Instantiates a slot in the RGCTX.
+ * Instantiates a slot in the RGCTX, returning its value.
*/
gpointer
mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot)
info = fill_runtime_generic_context (class_vtable, rgctx, slot, 0);
+ DEBUG (printf ("get rgctx slot: %s %d -> %p\n", mono_type_full_name (&class_vtable->klass->byval_arg), slot, info));
+
return info;
}
* Returns the size of the activation frame.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k, align;
CallInfo *cinfo;
return "unknown";
}
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
- static int count = 0;
- count ++;
-
- if (count == atoi (getenv ("COUNT"))) {
- break_count ();
- }
-
- if (count > atoi (getenv ("COUNT"))) {
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
debug_ins_sched (void)
{
#if 0
- return debug_count ();
+ return mono_debug_count ();
#else
return TRUE;
#endif
debug_omit_fp (void)
{
#if 0
- return debug_count ();
+ return mono_debug_count ();
#else
return TRUE;
#endif
* Returns the size of the argument area on the stack.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k;
CallInfo *cinfo = get_call_info (NULL, NULL, csig, FALSE);
* Returns the size of the activation frame.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k, frame_size = 0;
guint32 size, align, pad;
return cinfo;
}
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
- static int count = 0;
- count ++;
-
- if (!getenv ("COUNT"))
- return TRUE;
-
- if (count == atoi (getenv ("COUNT"))) {
- break_count ();
- }
-
- if (count > atoi (getenv ("COUNT"))) {
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
debug_omit_fp (void)
{
#if 0
- return debug_count ();
+ return mono_debug_count ();
#else
return TRUE;
#endif
* Returns the size of the activation frame.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
#ifdef __mono_ppc64__
NOT_IMPLEMENTED;
return cinfo;
}
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
- static int count = 0;
- count ++;
-
- if (!getenv ("COUNT"))
- return TRUE;
-
- if (count == atoi (getenv ("COUNT"))) {
- break_count ();
- }
-
- if (count > atoi (getenv ("COUNT"))) {
- return FALSE;
- }
-
- return TRUE;
-}
-
gboolean
mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig)
{
}
/*
- if (!debug_count ())
+ if (!mono_debug_count ())
res = FALSE;
*/
/*------------------------------------------------------------------*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig,
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig,
int param_count,
MonoJitArgumentInfo *arg_info)
{
/*------------------------------------------------------------------*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig,
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig,
int param_count,
MonoJitArgumentInfo *arg_info)
{
* Returns the size of the activation frame.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int k, align;
CallInfo *cinfo;
* FIXME: The metadata calls might not be signal safe.
*/
int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
int len, k, args_size = 0;
int size, pad;
cinfo = (CallInfo*)g_newa (guint8*, len);
memset (cinfo, 0, len);
- cinfo = get_call_info_internal (NULL, cinfo, csig);
+ cinfo = get_call_info_internal (gsctx, cinfo, csig);
arg_info [0].offset = offset;
if (CALLCONV_IS_STDCALL (sig)) {
MonoJitArgumentInfo *arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1));
- stack_to_pop = mono_arch_get_argument_info (sig, sig->param_count, arg_info);
+ stack_to_pop = mono_arch_get_argument_info (cfg->generic_sharing_context, sig, sig->param_count, arg_info);
} else if (MONO_TYPE_ISSTRUCT (mono_method_signature (cfg->method)->ret) && (cinfo->ret.storage == ArgOnStack))
stack_to_pop = 4;
else
g_free (info);
}
+G_GNUC_UNUSED static void
+break_count (void)
+{
+}
+
+/*
+ * Runtime debugging tool, use if (debug_count ()) <x> else <y> to do <x> the first COUNT times, then do <y> afterwards.
+ * Set a breakpoint in break_count () to break the last time <x> is done.
+ */
+G_GNUC_UNUSED gboolean
+mono_debug_count (void)
+{
+ static int count = 0;
+ count ++;
+
+ if (!getenv ("COUNT"))
+ return TRUE;
+
+ if (count == atoi (getenv ("COUNT"))) {
+ break_count ();
+ }
+
+ if (count > atoi (getenv ("COUNT"))) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
#define MONO_INIT_VARINFO(vi,id) do { \
(vi)->range.first_use.pos.bid = 0xffff; \
(vi)->reg = -1; \
switch (entry->data->type) {
case MONO_PATCH_INFO_CLASS:
- slot = mono_method_lookup_or_register_other_info (entry->method, entry->in_mrgctx, &entry->data->data.klass->byval_arg, entry->info_type, mono_method_get_context (entry->method));
+ slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, &entry->data->data.klass->byval_arg, entry->info_type, mono_method_get_context (entry->method));
break;
case MONO_PATCH_INFO_METHOD:
case MONO_PATCH_INFO_METHODCONST:
- slot = mono_method_lookup_or_register_other_info (entry->method, entry->in_mrgctx, entry->data->data.method, entry->info_type, mono_method_get_context (entry->method));
+ slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, entry->data->data.method, entry->info_type, mono_method_get_context (entry->method));
break;
case MONO_PATCH_INFO_FIELD:
- slot = mono_method_lookup_or_register_other_info (entry->method, entry->in_mrgctx, entry->data->data.field, entry->info_type, mono_method_get_context (entry->method));
+ slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, entry->data->data.field, entry->info_type, mono_method_get_context (entry->method));
break;
default:
g_assert_not_reached ();
* mono_arch_get_argument_info () is not signal safe.
*/
arg_info = g_newa (MonoJitArgumentInfo, sig->param_count + 1);
- stack_size = mono_arch_get_argument_info (sig, sig->param_count, arg_info);
+ stack_size = mono_arch_get_argument_info (cfg->generic_sharing_context, sig, sig->param_count, arg_info);
if (stack_size)
arch_eh_info_size = sizeof (MonoArchEHJitInfo);
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 83
+#define MONO_AOT_FILE_VERSION 84
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
MONO_RGCTX_INFO_CAST_CACHE
} MonoRgctxInfoType;
-typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
+typedef struct _MonoRuntimeGenericContextInfoTemplate {
MonoRgctxInfoType info_type;
gpointer data;
- struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
-} MonoRuntimeGenericContextOtherInfoTemplate;
+ struct _MonoRuntimeGenericContextInfoTemplate *next;
+} MonoRuntimeGenericContextInfoTemplate;
typedef struct {
MonoClass *next_subclass;
- MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
+ MonoRuntimeGenericContextInfoTemplate *infos;
GSList *method_templates;
} MonoRuntimeGenericContextTemplate;
void mono_print_code (MonoCompile *cfg, const char *msg) MONO_INTERNAL;
void mono_print_method_from_ip (void *ip);
char *mono_pmip (void *ip);
+gboolean mono_debug_count (void) MONO_INTERNAL;
const char* mono_inst_name (int op);
void mono_inst_set_src_registers (MonoInst *ins, int *regs) MONO_INTERNAL;
int mono_op_to_op_imm (int opcode) MONO_INTERNAL;
void mono_arch_free_jit_tls_data (MonoJitTlsData *tls) MONO_INTERNAL;
void mono_arch_fill_argument_info (MonoCompile *cfg) MONO_INTERNAL;
void mono_arch_allocate_vars (MonoCompile *m) MONO_INTERNAL;
-int mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info) MONO_INTERNAL;
+int mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info) MONO_INTERNAL;
gboolean mono_arch_print_tree (MonoInst *tree, int arity) MONO_INTERNAL;
void mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) MONO_INTERNAL;
void mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src) MONO_INTERNAL;
mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
guint32
-mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
+mono_method_lookup_or_register_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
MonoRgctxInfoType info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
MonoGenericContext
arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1));
- mono_arch_get_argument_info (sig, sig->param_count, arg_info);
+ mono_arch_get_argument_info (NULL, sig, sig->param_count, arg_info);
if (MONO_TYPE_ISSTRUCT (mono_method_signature (method)->ret)) {
g_assert (!mono_method_signature (method)->ret->byref);
return j;
}
+#if (defined (__MACH__) && defined (TARGET_ARM))
static int
mono_shared_area_instances_helper (void **array, int count, gboolean cleanup)
{
g_dir_close (dir);
return i;
}
+#else
+#define mono_shared_area_instances_helper mono_shared_area_instances_slow
+#endif
void*
mono_shared_area (void)