Merge pull request #1570 from mono/fix27010
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 17 Feb 2015 19:49:05 +0000 (13:49 -0600)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 17 Feb 2015 19:49:05 +0000 (13:49 -0600)
Bug 27010 - Difference in Assembly.GetExportedTypes with .NET

46 files changed:
.gitignore
external/referencesource
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
mcs/class/System.ServiceModel.Web/System/UriTemplate.cs
mcs/class/System.ServiceModel.Web/Test/System/UriTemplateTest.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ReplyChannelBase.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseRequestProcessor.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs
mcs/errors/cs0135-2.cs [deleted file]
mcs/errors/cs0135-3.cs [deleted file]
mcs/errors/cs0135-4.cs [deleted file]
mcs/errors/cs0135-5.cs [deleted file]
mcs/errors/cs0135-6.cs [deleted file]
mcs/errors/cs0135-7.cs [deleted file]
mcs/errors/cs0135.cs [deleted file]
mcs/errors/cs0573-3.cs [new file with mode: 0644]
mcs/mcs/cs-parser.jay
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/modifiers.cs
mcs/mcs/property.cs
mcs/tests/gtest-autoproperty-16.cs [new file with mode: 0644]
mcs/tests/test-914.cs [new file with mode: 0644]
mcs/tests/test-915.cs [new file with mode: 0644]
mcs/tests/test-916.cs [new file with mode: 0644]
mcs/tests/test-917.cs [new file with mode: 0644]
mcs/tests/test-918.cs [new file with mode: 0644]
mcs/tests/test-anon-174.cs [new file with mode: 0644]
mcs/tests/test-anon-175.cs [new file with mode: 0644]
mcs/tests/test-dictinit-04.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml
mono/dis/Makefile.am
mono/metadata/marshal.c
mono/metadata/object-offsets.h
mono/metadata/sgen-os-win32.c
mono/mini/aot-compiler.c
mono/mini/aot_dump.c [deleted file]
mono/mini/driver.c
mono/mini/gshared.cs
mono/mini/method-to-ir.c
mono/mini/mini-arm.c
mono/mini/mini-codegen.c
mono/utils/Makefile.am
mono/utils/json.c [new file with mode: 0644]
mono/utils/json.h [new file with mode: 0644]
msvc/libmonoutils.vcxproj

index 55a955ec624e0e86ba27aba53940285245c10261..4d01e37cc2acc0c7bbff799a6cf5fb8b99a33c46 100644 (file)
@@ -109,6 +109,10 @@ GRTAGS
 GSYMS
 GTAGS
 
+# Doxygen
+docs/doxygen*
+docs/perlmod*
+
 
 ##############################################################################
 # Mono-specific patterns
index 5661f22d9630849d04de94f6dd2e72bca484f85f..b23609f81a95b384538dba01a1cbf49fe2a9b95a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5661f22d9630849d04de94f6dd2e72bca484f85f
+Subproject commit b23609f81a95b384538dba01a1cbf49fe2a9b95a
index f99086d1e804b67071f20dcff554a5c2293cca1a..2b619caa12da418065f9e698f5eb6f2aa8e0c749 100644 (file)
@@ -235,7 +235,7 @@ namespace Microsoft.Build.Tasks {
                                        Log.LogMessage ("Copying failed. Retries left: {0}.", i);
 
                                        if (i == 0)
-                                               throw ex;
+                                               throw;
 
                                        Thread.Sleep (retryDelayMilliseconds);
                                }
index 875acb2117ec61a67808e9e4c99958795ec84a7f..b72c14c4324db300f91f9bdaa6ca2837d0294564 100644 (file)
@@ -321,11 +321,15 @@ namespace System
                        string [] parameters = Uri.UnescapeDataString (candidate.Query.Substring (1)).Split ('&'); // chop first '?'
                        foreach (string parameter in parameters) {
                                string [] pair = parameter.Split ('=');
-                               m.QueryParameters.Add (pair [0], pair [1]);
-                               if (!query_params.ContainsKey (pair [0]))
-                                       continue;
-                               string templateName = query_params [pair [0]];
-                               vc.Add (templateName, pair [1]);
+                               if (pair.Length > 0) {
+                                       m.QueryParameters.Add (pair [0], pair.Length == 2 ? pair [1] : null);
+                                       if (!query_params.ContainsKey (pair [0]))
+                                               continue;
+                                       if (pair.Length > 1) {
+                                               string templateName = query_params [pair [0]];
+                                               vc.Add (templateName, pair [1]);
+                                       }
+                               }
                        }
 
                        return m;
index 24ec92861d82a1bc9d6f8e4a8202a6f6dd9ec5b0..361921ddcfcbbfc17d6959310ab30975201a115e 100644 (file)
@@ -461,6 +461,14 @@ namespace MonoTests.System
                        Assert.AreEqual ("qqq", m.WildcardPathSegments [2], "#5");
                }
 
+               [Test]
+               public void MatchIgnoreQueryParamNoValue ()
+               {
+                       var t = new UriTemplate ("/{a}/*", true);
+                       var m = t.Match (new Uri ("http://s"), new Uri ("http://s/a/b?foo"));
+                       Assert.AreEqual (1, m.QueryParameters.Keys.Count, "#1");
+               }
+
                [Test]
                public void IgnoreTrailingSlash ()
                {
index 01d85a20b5d9f26215fd814c0dcde9f1bd8e9143..d73b0866495cf0a32fe3ef8b2796ea619e8a36f2 100644 (file)
@@ -29,11 +29,13 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Net;
+using System.Net.Sockets;
 using System.Net.Security;
 using System.ServiceModel;
 using System.ServiceModel.Description;
 using System.ServiceModel.Security;
 using System.Threading;
+using System.Xml;
 
 namespace System.ServiceModel.Channels
 {
@@ -124,12 +126,29 @@ namespace System.ServiceModel.Channels
                                        }
                                        try {
                                                return TryReceiveRequest (tout, out ctx);
+                                       } catch (XmlException ex) {
+                                               Console.WriteLine ("Xml Exception (Dropped Connection?):" + ex.Message);
+                                               //on dropped connection, 
+                                               //whatever you do don't crash
+                                               //the whole app.  Ignore for now
+                                       } catch (SocketException ex) {
+                                               Console.WriteLine ("Socket Exception (Dropped Connection?):" + ex.Message);
+                                               //on dropped connection, 
+                                               //whatever you do don't crash
+                                               //the whole app.  Ignore for now
+                                       } catch (IOException ex) {
+                                               Console.WriteLine ("I/O Exception (Dropped Connection?):" + ex.Message);
+                                               //on dropped connection, 
+                                               //whatever you do don't crash
+                                               //the whole app.  Ignore for now
                                        } finally {
                                                lock (async_result_lock) {
                                                        CurrentAsyncResult = null;
                                                        CurrentAsyncThread = null;
                                                }
                                        }
+                                       ctx = null;
+                                       return false;
                                        });
                        RequestContext dummy;
                        IAsyncResult result;
index fe05194d15b9e2054b90e581a3e7bdb55ea01ab3..1fcb4e2c413219142c6373d833efc88a60b68263 100644 (file)
@@ -5,6 +5,9 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Security;
 using System.ServiceModel.Security.Tokens;
 using System.Text;
+using System.IO;
+using System.Xml;
+using System.Net.Sockets;
 
 namespace System.ServiceModel.Dispatcher
 {
@@ -24,8 +27,34 @@ namespace System.ServiceModel.Dispatcher
                        using (new OperationContextScope (mrc.OperationContext)) {
                                try {
                                        process_handlers_chain.ProcessRequestChain (mrc);
-                               }
-                               catch (Exception e) {
+                               } catch (IOException e) {
+                                       // FIXME?: On dropped connection do not
+                                       // dump a stacktrace, but should be safe
+                                       // to dump a console message as in
+                                       // default exception handler and 
+                                       // call error_handlers_chain
+                                       Console.WriteLine ("I/O Error (Dropped Connection?): " + e.Message);
+                                       mrc.ProcessingException = e;
+                                       error_handlers_chain.ProcessRequestChain (mrc);
+                               } catch (SocketException e) {
+                                       // FIXME?: On dropped connection do not
+                                       // dump a stacktrace, but should be safe
+                                       // to dump a console message as in
+                                       // default exception handler and 
+                                       // call error_handlers_chain
+                                       Console.WriteLine ("SocketExcpetion (Dropped Connection?): " + e.Message);
+                                       mrc.ProcessingException = e;
+                                       error_handlers_chain.ProcessRequestChain (mrc);
+                               } catch (XmlException e) {
+                                       // FIXME?: On dropped connection do not
+                                       // dump a stacktrace, but should be safe
+                                       // to dump a console message as in
+                                       // default exception handler and 
+                                       // call error_handlers_chain
+                                       Console.WriteLine ("XmlException (Dropped Connection?): " + e.Message);
+                                       mrc.ProcessingException = e;
+                                       error_handlers_chain.ProcessRequestChain (mrc);                         
+                               } catch (Exception e) {
                                        // FIXME: this is not really expected use of ChannelDispatcher.ErrorHandlers.
                                        // They are now correctly used in process_handler_chain (namely OperationInvokerHandler).
                                        // For this kind of "outsider" exceptions are actually left thrown
index 15731e65a3a594d4909d5bdf3a59236debb2f5ab..ca5e2e34c81bbd40723ec97a1865f59a52b58207 100644 (file)
@@ -35,6 +35,9 @@ using System.Threading;
 using System.Transactions;
 using System.ServiceModel;
 using System.ServiceModel.Description;
+using System.Net.Sockets;
+using System.Xml;
+using System.IO;
 
 namespace System.ServiceModel.Dispatcher
 {
@@ -598,7 +601,10 @@ namespace System.ServiceModel.Dispatcher
                                        if (ProcessErrorWithHandlers (reply, ex, out res))
                                                return;
 
-                                       rc.Reply (res);
+                                       if ((!(ex is SocketException)) && 
+                                           (!(ex is XmlException)) &&
+                                           (!(ex is IOException)))
+                                               rc.Reply (res);
                                        
                                        reply.Close (owner.DefaultCloseTimeout); // close the channel
                                } finally {
diff --git a/mcs/errors/cs0135-2.cs b/mcs/errors/cs0135-2.cs
deleted file mode 100644 (file)
index 788e3c0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// CS0135: `i' conflicts with a declaration in a child block
-// Line: 10
-
-delegate int F (int i);
-class Foo {
-       static int i;
-       static void Main ()
-       {
-               F f = delegate (int i) { return i; };
-               i = 0;
-       }
-}
diff --git a/mcs/errors/cs0135-3.cs b/mcs/errors/cs0135-3.cs
deleted file mode 100644 (file)
index bc1a8c2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// CS0135: `i' conflicts with a declaration in a child block
-// Line: 9
-
-delegate int F (int i);
-class Foo {
-       static int i;
-       static void Main ()
-       {
-               i = 0;
-               F f = delegate (int i) { return i; };
-       }
-}
diff --git a/mcs/errors/cs0135-4.cs b/mcs/errors/cs0135-4.cs
deleted file mode 100644 (file)
index 62e6e62..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// CS0135: `test' conflicts with a declaration in a child block
-// Line: 13
-
-class ClassMain
-{
-       static bool test = true;
-
-       public static void Main ()
-       {
-               if (true) {
-                       const bool test = false;
-               }
-               test = false;
-       }
-}
-
diff --git a/mcs/errors/cs0135-5.cs b/mcs/errors/cs0135-5.cs
deleted file mode 100644 (file)
index 8e75a88..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// CS0135: `bar' conflicts with a declaration in a child block
-// Line: 13
-
-public class Foo
-{
-       public static class Nested
-       {
-               static int bar ()
-               {
-                       return 0;
-               }
-               
-               public static void Bar ()
-               {
-                       var i = bar ();
-                       {
-                               bool bar = false;
-                       }
-               } 
-       }
-}
-
diff --git a/mcs/errors/cs0135-6.cs b/mcs/errors/cs0135-6.cs
deleted file mode 100644 (file)
index fd4a007..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// CS0135: `bar' conflicts with a declaration in a child block
-// Line: 13
-
-public class Foo
-{
-       public static class Nested
-       {
-               class bar
-               {
-                       public static int value;
-               }
-               
-               public static void Bar ()
-               {
-                       {
-                               bool bar = false;
-                       }
-                       
-                       var i = bar.value;
-               } 
-       }
-}
-
diff --git a/mcs/errors/cs0135-7.cs b/mcs/errors/cs0135-7.cs
deleted file mode 100644 (file)
index 4a61197..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// CS0135: `x' conflicts with a declaration in a child block
-// Line: 18
-
-public class Test
-{
-       Test x;
-
-       void Foo ()
-       {
-               {
-                       string x = "dd";
-               }
-
-               {
-                       x = null;
-               }
-
-               x = new Test ();
-       }
-
-       public static void Main () { }
-}
\ No newline at end of file
diff --git a/mcs/errors/cs0135.cs b/mcs/errors/cs0135.cs
deleted file mode 100644 (file)
index 8366f70..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// CS0135: `test' conflicts with a declaration in a child block
-// Line: 11
-
-class ClassMain {
-        static bool test = true;
-    
-        public static void Main() {
-                if (true) {
-                        bool test = false;
-                }
-                test = false;
-        }
-}
-
diff --git a/mcs/errors/cs0573-3.cs b/mcs/errors/cs0573-3.cs
new file mode 100644 (file)
index 0000000..e3faa9b
--- /dev/null
@@ -0,0 +1,9 @@
+// CS0573: 'S': Structs cannot have instance property or field initializers
+// Line: 8
+
+using System;
+
+struct S
+{
+       event Action E = null;
+}
\ No newline at end of file
index d6f4a51e3708a3982427460cb719095f44995607..1f44fc2d566f552bfa6d025befb483173c70b08a 100644 (file)
@@ -3611,12 +3611,12 @@ member_initializer
 
                lbag.AddLocation ($$, GetLocation ($3));
          }
-       | OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET ASSIGN initializer_value
+       | OPEN_BRACKET_EXPR argument_list CLOSE_BRACKET ASSIGN initializer_value
          {
                if (lang_version < LanguageVersion.V_6)
                        FeatureIsNotAvailable (GetLocation ($1), "dictionary initializer");
 
-               $$ = new DictionaryElementInitializer ((List<Expression>)$2, (Expression) $5, GetLocation ($1));
+               $$ = new DictionaryElementInitializer ((Arguments)$2, (Expression) $5, GetLocation ($1));
                lbag.AddLocation ($$, GetLocation ($3), GetLocation ($4));
          }
        | OPEN_BRACE CLOSE_BRACE
index a6aada45ef0f71270b077ffdb81cee28c1a72a25..19d041818bf74e1231169460b192e7431338c4ed 100644 (file)
@@ -996,6 +996,11 @@ namespace Mono.CSharp {
                        return members;
                }
 
+               protected static void Error_NamedArgument (NamedArgument na, Report Report)
+               {
+                       Report.Error (1742, na.Location, "An element access expression cannot use named argument");
+               }
+
                protected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc)
                {
                        throw new NotImplementedException ();
@@ -1169,7 +1174,7 @@ namespace Mono.CSharp {
                        if (source.type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
                                Arguments args = new Arguments (1);
                                args.Add (new Argument (source));
-                               return new DynamicConversion (btypes.Int, CSharpBinderFlags.ConvertArrayIndex, args, loc).Resolve (ec);
+                               return new DynamicConversion (btypes.Int, CSharpBinderFlags.ConvertArrayIndex, args, source.loc).Resolve (ec);
                        }
 
                        Expression converted;
@@ -1206,6 +1211,27 @@ namespace Mono.CSharp {
                        return new ArrayIndexCast (converted, btypes.Int).Resolve (ec);
                }
 
+               public Expression MakePointerAccess (ResolveContext rc, TypeSpec type, Arguments args)
+               {
+                       if (args.Count != 1){
+                               rc.Report.Error (196, loc, "A pointer must be indexed by only one value");
+                               return null;
+                       }
+
+                       var arg = args [0];
+                       if (arg is NamedArgument)
+                               Error_NamedArgument ((NamedArgument) arg, rc.Report);
+
+                       var index = arg.Expr.Resolve (rc);
+                       if (index == null)
+                               return null;
+
+                       index = ConvertExpressionToArrayIndex (rc, index, true);
+
+                       Expression p = new PointerArithmetic (Binary.Operator.Addition, this, index, type, loc);
+                       return new Indirection (p, loc);
+               }
+
                //
                // Derived classes implement this method by cloning the fields that
                // could become altered during the Resolve stage
@@ -2812,12 +2838,6 @@ namespace Mono.CSharp {
                                                        ErrorIsInaccesible (rc, me.GetSignatureForError (), loc);
                                                }
                                        } else {
-                                               // LAMESPEC: again, ignores InvocableOnly
-                                               if (variable != null) {
-                                                       rc.Report.SymbolRelatedToPreviousError (variable.Location, Name);
-                                                       rc.Report.Error (135, loc, "`{0}' conflicts with a declaration in a child block", Name);
-                                               }
-
                                                //
                                                // MemberLookup does not check accessors availability, this is actually needed for properties only
                                                //
@@ -2856,11 +2876,6 @@ namespace Mono.CSharp {
                                //
                                if ((restrictions & MemberLookupRestrictions.InvocableOnly) == 0 && !variable_found) {
                                        if (IsPossibleTypeOrNamespace (rc)) {
-                                               if (variable != null) {
-                                                       rc.Report.SymbolRelatedToPreviousError (variable.Location, Name);
-                                                       rc.Report.Error (135, loc, "`{0}' conflicts with a declaration in a child block", Name);
-                                               }
-
                                                return ResolveAsTypeOrNamespace (rc, false);
                                        }
                                }
index c72137b46e3a8370ed08d64c09314cb652b37d7f..fc415dadd8b89ac639251d0a4bafa5a9be1add51 100644 (file)
@@ -10195,13 +10195,13 @@ namespace Mono.CSharp
                                };
 
                        if (type.IsPointer)
-                               return MakePointerAccess (ec, type);
+                               return Expr.MakePointerAccess (ec, type, Arguments);
 
                        FieldExpr fe = Expr as FieldExpr;
                        if (fe != null) {
                                var ff = fe.Spec as FixedFieldSpec;
                                if (ff != null) {
-                                       return MakePointerAccess (ec, ff.ElementType);
+                                       return Expr.MakePointerAccess (ec, ff.ElementType, Arguments);
                                }
                        }
 
@@ -10243,27 +10243,6 @@ namespace Mono.CSharp
                        return ConditionalAccess || Expr.HasConditionalAccess ();
                }
 
-               Expression MakePointerAccess (ResolveContext rc, TypeSpec type)
-               {
-                       if (Arguments.Count != 1){
-                               rc.Report.Error (196, loc, "A pointer must be indexed by only one value");
-                               return null;
-                       }
-
-                       var arg = Arguments[0];
-                       if (arg is NamedArgument)
-                               Error_NamedArgument ((NamedArgument) arg, rc.Report);
-
-                       var index = arg.Expr.Resolve (rc);
-                       if (index == null)
-                               return null;
-
-                       index = ConvertExpressionToArrayIndex (rc, index, true);
-
-                       Expression p = new PointerArithmetic (Binary.Operator.Addition, Expr, index, type, loc);
-                       return new Indirection (p, loc);
-               }
-               
                protected override Expression DoResolve (ResolveContext rc)
                {
                        Expression expr;
@@ -10300,11 +10279,6 @@ namespace Mono.CSharp
                        throw new Exception ("Should never be reached");
                }
 
-               public static void Error_NamedArgument (NamedArgument na, Report Report)
-               {
-                       Report.Error (1742, na.Location, "An element access expression cannot use named argument");
-               }
-
                public override void FlowAnalysis (FlowAnalysisContext fc)
                {
                        Expr.FlowAnalysis (fc);
@@ -11767,12 +11741,10 @@ namespace Mono.CSharp
        {
                readonly Arguments args;
 
-               public DictionaryElementInitializer (List<Expression> arguments, Expression initializer, Location loc)
+               public DictionaryElementInitializer (Arguments arguments, Expression initializer, Location loc)
                        : base (null, initializer, loc)
                {
-                       this.args = new Arguments (arguments.Count);
-                       foreach (var arg in arguments)
-                               this.args.Add (new Argument (arg));
+                       this.args = arguments;
                }
 
                public override Expression CreateExpressionTree (ResolveContext ec)
@@ -11791,6 +11763,11 @@ namespace Mono.CSharp
                                return true;
                        }
 
+                       if (type.IsPointer) {
+                               target = init.MakePointerAccess (rc, type, args);
+                               return true;
+                       }
+
                        var indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);
                        if (indexers == null && type.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {
                                ElementAccess.Error_CannotApplyIndexing (rc, type, loc);
index c8c6b73e60aa3f212a457940c91da8cfbfbc9994..bfae5985a0345f1d5058e6e6586618d0fd185ba1 100644 (file)
@@ -52,6 +52,7 @@ namespace Mono.CSharp
                BACKING_FIELD                   = 0x200000,
                DEBUGGER_HIDDEN                 = 0x400000,
                DEBUGGER_STEP_THROUGH   = 0x800000,
+               AutoProperty                    = 0x1000000,
 
                AccessibilityMask = PUBLIC | PROTECTED | INTERNAL | PRIVATE,
                AllowedExplicitImplFlags = UNSAFE | EXTERN,
index d52b1da393ea05e99971a02458a74f56cb66fbd9..1d46ab2dab8b87ed13f9e871bd5459a3ee07f6a4 100644 (file)
@@ -557,7 +557,7 @@ namespace Mono.CSharp
                                        ok = false;
                                }
 
-                               if (Get.IsCompilerGenerated) {
+                               if ((ModFlags & Modifiers.AutoProperty) != 0) {
                                        Report.Error (8080, Location, "`{0}': Auto-implemented properties must override all accessors of the overridden property",
                                                GetSignatureForError ());
                                        ok = false;
@@ -867,6 +867,7 @@ namespace Mono.CSharp
                        }
 
                        if (auto) {
+                               ModFlags |= Modifiers.AutoProperty;
                                if (Get == null) {
                                        Report.Error (8051, Location, "Auto-implemented property `{0}' must have get accessor",
                                                GetSignatureForError ());
diff --git a/mcs/tests/gtest-autoproperty-16.cs b/mcs/tests/gtest-autoproperty-16.cs
new file mode 100644 (file)
index 0000000..6676261
--- /dev/null
@@ -0,0 +1,13 @@
+abstract class A
+{
+       public abstract int Foo { get; }
+}
+
+class B : A
+{
+       public override int Foo => 1;
+
+       public static void Main ()
+       {
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-914.cs b/mcs/tests/test-914.cs
new file mode 100644 (file)
index 0000000..8366f70
--- /dev/null
@@ -0,0 +1,14 @@
+// CS0135: `test' conflicts with a declaration in a child block
+// Line: 11
+
+class ClassMain {
+        static bool test = true;
+    
+        public static void Main() {
+                if (true) {
+                        bool test = false;
+                }
+                test = false;
+        }
+}
+
diff --git a/mcs/tests/test-915.cs b/mcs/tests/test-915.cs
new file mode 100644 (file)
index 0000000..b793698
--- /dev/null
@@ -0,0 +1,13 @@
+class ClassMain
+{
+       static bool test = true;
+
+       public static void Main ()
+       {
+               if (true) {
+                       const int test = 0;
+               }
+               test = false;
+       }
+}
+
diff --git a/mcs/tests/test-916.cs b/mcs/tests/test-916.cs
new file mode 100644 (file)
index 0000000..f63c1c2
--- /dev/null
@@ -0,0 +1,19 @@
+public class Foo
+{
+       public static class Nested
+       {
+               static int bar ()
+               {
+                       return 0;
+               }
+               
+               public static void Main ()
+               {
+                       var i = bar ();
+                       {
+                               bool bar = false;
+                       }
+               } 
+       }
+}
+
diff --git a/mcs/tests/test-917.cs b/mcs/tests/test-917.cs
new file mode 100644 (file)
index 0000000..6c82172
--- /dev/null
@@ -0,0 +1,20 @@
+public class Foo
+{
+       public static class Nested
+       {
+               class bar
+               {
+                       public static int value;
+               }
+               
+               public static void Main ()
+               {
+                       {
+                               bool bar = false;
+                       }
+                       
+                       var i = bar.value;
+               } 
+       }
+}
+
diff --git a/mcs/tests/test-918.cs b/mcs/tests/test-918.cs
new file mode 100644 (file)
index 0000000..e8e0f9f
--- /dev/null
@@ -0,0 +1,19 @@
+public class Test
+{
+       Test x;
+
+       void Foo ()
+       {
+               {
+                       string x = "dd";
+               }
+
+               {
+                       x = null;
+               }
+
+               x = new Test ();
+       }
+
+       public static void Main () { }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-anon-174.cs b/mcs/tests/test-anon-174.cs
new file mode 100644 (file)
index 0000000..ef038d0
--- /dev/null
@@ -0,0 +1,9 @@
+delegate int F (int i);
+class Foo {
+       static int i;
+       static void Main ()
+       {
+               F f = delegate (int i) { return i; };
+               i = 0;
+       }
+}
diff --git a/mcs/tests/test-anon-175.cs b/mcs/tests/test-anon-175.cs
new file mode 100644 (file)
index 0000000..8dd625a
--- /dev/null
@@ -0,0 +1,9 @@
+delegate int F (int i);
+class Foo {
+       static int i;
+       static void Main ()
+       {
+               i = 0;
+               F f = delegate (int i) { return i; };
+       }
+}
diff --git a/mcs/tests/test-dictinit-04.cs b/mcs/tests/test-dictinit-04.cs
new file mode 100644 (file)
index 0000000..570e77c
--- /dev/null
@@ -0,0 +1,29 @@
+// Compiler options: -unsafe
+
+unsafe class C
+{
+       int* X;
+
+       static int Main()
+       {
+               var ptrs = new[] { 0 };
+
+               fixed (int* p = ptrs) {
+                       new C (p) {
+                               X = {
+                                       [0] = 1
+                               }
+                       };
+               }
+
+               if (ptrs [0] != 1)
+                       return 1;
+
+               return 0;
+       }
+
+       C (int* x)
+       {
+               X = x;
+       }
+}
\ No newline at end of file
index c38d69a64dbc4b171ad4fcb2677e57b6ceffce18..8aebc062dffef663cc28ad0ef1a14ee6e8c5585f 100644 (file)
       </method>\r
     </type>\r
   </test>\r
+  <test name="gtest-autoproperty-16.cs">\r
+    <type name="A">\r
+      <method name="Int32 get_Foo()" attrs="3526">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6276">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="B">\r
+      <method name="Int32 get_Foo()" attrs="2246">\r
+        <size>9</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\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-collectioninit-01.cs">\r
     <type name="Test">\r
       <method name="Void TestList(System.Collections.Generic.List`1[System.Int32], Int32)" attrs="145">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-914.cs">\r
+    <type name="ClassMain">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>12</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void .cctor()" attrs="6289">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="test-915.cs">\r
+    <type name="ClassMain">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+      <method name="Void .cctor()" attrs="6289">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="test-916.cs">\r
+    <type name="Foo">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="Foo+Nested">\r
+      <method name="Int32 bar()" attrs="145">\r
+        <size>10</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\r
+        <size>12</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="test-917.cs">\r
+    <type name="Foo">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+    <type name="Foo+Nested">\r
+      <method name="Void Main()" attrs="150">\r
+        <size>12</size>\r
+      </method>\r
+    </type>\r
+    <type name="Foo+Nested+bar">\r
+      <method name="Void .ctor()" attrs="6278">\r
+        <size>7</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
+  <test name="test-918.cs">\r
+    <type name="Test">\r
+      <method name="Void Foo()" attrs="129">\r
+        <size>30</size>\r
+      </method>\r
+      <method name="Void Main()" attrs="150">\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="test-92.cs">\r
     <type name="Outer">\r
       <method name="Void .ctor()" attrs="6278">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-anon-174.cs">\r
+    <type name="F">\r
+      <method name="Int32 Invoke(Int32)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="System.IAsyncResult BeginInvoke(Int32, System.AsyncCallback, System.Object)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="Int32 EndInvoke(System.IAsyncResult)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="Void .ctor(Object, IntPtr)" attrs="6278">\r
+        <size>0</size>\r
+      </method>\r
+    </type>\r
+    <type name="Foo">\r
+      <method name="Void Main()" attrs="145">\r
+        <size>38</size>\r
+      </method>\r
+      <method name="Int32 &lt;Main&gt;m__0(Int32)" attrs="145">\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="test-anon-175.cs">\r
+    <type name="F">\r
+      <method name="Int32 Invoke(Int32)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="System.IAsyncResult BeginInvoke(Int32, System.AsyncCallback, System.Object)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="Int32 EndInvoke(System.IAsyncResult)" attrs="454">\r
+        <size>0</size>\r
+      </method>\r
+      <method name="Void .ctor(Object, IntPtr)" attrs="6278">\r
+        <size>0</size>\r
+      </method>\r
+    </type>\r
+    <type name="Foo">\r
+      <method name="Void Main()" attrs="145">\r
+        <size>38</size>\r
+      </method>\r
+      <method name="Int32 &lt;Main&gt;m__0(Int32)" attrs="145">\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="test-anon-18.cs">\r
     <type name="A">\r
       <method name="Void Invoke()" attrs="454">\r
       </method>\r
     </type>\r
   </test>\r
+  <test name="test-dictinit-04.cs">\r
+    <type name="C">\r
+      <method name="Int32 Main()" attrs="145">\r
+        <size>84</size>\r
+      </method>\r
+      <method name="Void .ctor(Int32*)" attrs="6273">\r
+        <size>15</size>\r
+      </method>\r
+    </type>\r
+  </test>\r
   <test name="test-ex-filter-01.cs">\r
     <type name="X">\r
       <method name="Int32 Main()" attrs="150">\r
index fcf17c001b9ffb9b531f6cec7ce17fa087fb3d8e..173ffeb36db042a94d0ad4babf481f95143cd1ba 100644 (file)
@@ -12,7 +12,7 @@ gc_lib=$(LIBGC_STATIC_LIBS)
 endif
 
 runtime_lib=   \
-       ../mini/$(LIBMONO_LA) \
+       $(metadata_lib) \
        $(top_builddir)/mono/io-layer/libwapi.la        \
        $(top_builddir)/mono/utils/libmonoutils.la \
        $(GLIB_LIBS) $(LIBICONV) \
index 0015944addc727142b261358d890d3b970ff6fb3..9307c0040fb4302892a37591034d8a96e6b9a6f1 100644 (file)
@@ -9544,10 +9544,11 @@ static int elem_addr_cache_next = 0;
  * @rank: rank of the array type
  * @elem_size: size in bytes of an element of an array.
  *
- * Returns a MonoMethd that implements the code to get the address
+ * Returns a MonoMethod that implements the code to get the address
  * of an element in a multi-dimenasional array of @rank dimensions.
  * The returned method takes an array as the first argument and then
  * @rank indexes for the @rank dimensions.
+ * If ELEM_SIZE is 0, read the array size from the array object.
  */
 MonoMethod*
 mono_marshal_get_array_address (int rank, int elem_size)
@@ -9556,6 +9557,7 @@ mono_marshal_get_array_address (int rank, int elem_size)
        MonoMethodBuilder *mb;
        MonoMethodSignature *sig;
        WrapperInfo *info;
+       char *name;
        int i, bounds, ind, realidx;
        int branch_pos, *branch_positions;
        int cached;
@@ -9583,7 +9585,9 @@ mono_marshal_get_array_address (int rank, int elem_size)
                sig->params [i + 1] = &mono_defaults.int32_class->byval_arg;
        }
 
-       mb = mono_mb_new (mono_defaults.object_class, "ElementAddr", MONO_WRAPPER_MANAGED_TO_MANAGED);
+       name = g_strdup_printf ("ElementAddr_%d", elem_size);
+       mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_MANAGED);
+       g_free (name);
        
 #ifndef DISABLE_JIT
        bounds = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
@@ -9651,8 +9655,24 @@ mono_marshal_get_array_address (int rank, int elem_size)
        mono_mb_emit_ldarg (mb, 0);
        mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoArray, vector));
        mono_mb_emit_ldloc (mb, ind);
-       mono_mb_emit_icon (mb, elem_size);
-       mono_mb_emit_byte (mb, CEE_MUL);
+       if (elem_size) {
+               mono_mb_emit_icon (mb, elem_size);
+       } else {
+               /* Load arr->vtable->klass->sizes.element_class */
+               mono_mb_emit_ldarg (mb, 0);
+               mono_mb_emit_byte (mb, CEE_CONV_I);
+               mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoObject, vtable));
+               mono_mb_emit_byte (mb, CEE_ADD);
+               mono_mb_emit_byte (mb, CEE_LDIND_I);
+               mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoVTable, klass));
+               mono_mb_emit_byte (mb, CEE_ADD);
+               mono_mb_emit_byte (mb, CEE_LDIND_I);
+               /* sizes is an union, so this reads sizes.element_size */
+               mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoClass, sizes));
+               mono_mb_emit_byte (mb, CEE_ADD);
+               mono_mb_emit_byte (mb, CEE_LDIND_I4);
+       }
+               mono_mb_emit_byte (mb, CEE_MUL);
        mono_mb_emit_byte (mb, CEE_ADD);
        mono_mb_emit_byte (mb, CEE_RET);
 
index 7fb5790528113236fad27acfb003e8166ed23055..ec6eb18540d8c7ce10b89079eafc851c7718d4aa 100644 (file)
@@ -186,6 +186,9 @@ DECL_OFFSET(MonoLMF, fregs)
 #elif defined(TARGET_ARM64)
 DECL_OFFSET(MonoLMF, pc)
 DECL_OFFSET(MonoLMF, gregs)
+DECL_OFFSET(DynCallArgs, fpregs)
+DECL_OFFSET(DynCallArgs, n_fpargs)
+DECL_OFFSET(DynCallArgs, n_fpret)
 #endif
 
 #ifdef TARGET_AMD64
index 36769f35cb2d7aca67fef29ccf08623703d5ad21..fa1ed01c024978a4e2f650a4dd4f9be18bfaa58d 100644 (file)
@@ -57,6 +57,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
 
        CloseHandle (handle);
 
+#if !defined(MONO_CROSS_COMPILE)
 #ifdef USE_MONO_CTX
        memset (&info->ctx, 0, sizeof (MonoContext));
 #ifdef TARGET_AMD64
@@ -103,6 +104,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
        info->regs [7] = context.Esp;
        info->stopped_ip = (gpointer)context.Eip;
        info->stack_start = (char*)context.Esp - REDZONE_SIZE;
+#endif
 #endif
 
        /* Notify the JIT */
index b48bb5d87f5d07a811567a8e2213087e9a879b1c..11c4317bb4e0482b9136414e9bb368e2b0a3cba7 100644 (file)
@@ -50,6 +50,7 @@
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/json.h>
 
 #include "mini.h"
 #include "seq-points.h"
@@ -6824,8 +6825,12 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                                        }
                                        add_generic_class_with_depth (acfg, m->klass, depth + 5, "method");
                                }
-                               if (m->wrapper_type == MONO_WRAPPER_MANAGED_TO_MANAGED && !strcmp (m->name, "ElementAddr"))
-                                       add_extra_method_with_depth (acfg, m, depth + 1);
+                               if (m->wrapper_type == MONO_WRAPPER_MANAGED_TO_MANAGED) {
+                                       WrapperInfo *info = mono_marshal_get_wrapper_info (m);
+
+                                       if (info && info->subtype == WRAPPER_SUBTYPE_ELEMENT_ADDR)
+                                               add_extra_method_with_depth (acfg, m, depth + 1);
+                               }
                                break;
                        }
                        case MONO_PATCH_INFO_VTABLE: {
@@ -8904,7 +8909,158 @@ acfg_free (MonoAotCompile *acfg)
        g_free (acfg);
 }
 
-#include "aot_dump.c"
+#define WRAPPER(e,n) n,
+static const char* const
+wrapper_type_names [MONO_WRAPPER_NUM + 1] = {
+#include "mono/metadata/wrapper-types.h"
+       NULL
+};
+
+static G_GNUC_UNUSED const char*
+get_wrapper_type_name (int type)
+{
+       return wrapper_type_names [type];
+}
+
+//#define DUMP_PLT
+//#define DUMP_GOT
+
+static void aot_dump (MonoAotCompile *acfg)
+{
+       FILE *dumpfile;
+       char * dumpname;
+
+       JsonWriter writer;
+       json_writer_init (&writer);
+
+       json_writer_object_begin(&writer);
+
+       // Methods
+       json_writer_indent (&writer);
+       json_writer_object_key(&writer, "methods");
+       json_writer_array_begin (&writer);
+
+       int i;
+       for (i = 0; i < acfg->nmethods; ++i) {
+               MonoCompile *cfg;
+               MonoMethod *method;
+               MonoClass *klass;
+
+               cfg = acfg->cfgs [i];
+               if (!cfg)
+                       continue;
+
+               method = cfg->orig_method;
+
+               json_writer_indent (&writer);
+               json_writer_object_begin(&writer);
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "name");
+               json_writer_printf (&writer, "\"%s\",\n", method->name);
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "signature");
+               json_writer_printf (&writer, "\"%s\",\n", mono_method_full_name (method,
+                       /*signature=*/TRUE));
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "code_size");
+               json_writer_printf (&writer, "\"%d\",\n", cfg->code_size);
+
+               klass = method->klass;
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "class");
+               json_writer_printf (&writer, "\"%s\",\n", klass->name);
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "namespace");
+               json_writer_printf (&writer, "\"%s\",\n", klass->name_space);
+
+               json_writer_indent (&writer);
+               json_writer_object_key(&writer, "wrapper_type");
+               json_writer_printf (&writer, "\"%s\",\n", get_wrapper_type_name(method->wrapper_type));
+
+               json_writer_indent_pop (&writer);
+               json_writer_indent (&writer);
+               json_writer_object_end (&writer);
+               json_writer_printf (&writer, ",\n");
+       }
+
+       json_writer_indent_pop (&writer);
+       json_writer_indent (&writer);
+       json_writer_array_end (&writer);
+       json_writer_printf (&writer, ",\n");
+
+       // PLT entries
+#ifdef DUMP_PLT
+       json_writer_indent_push (&writer);
+       json_writer_indent (&writer);
+       json_writer_object_key(&writer, "plt");
+       json_writer_array_begin (&writer);
+
+       for (i = 0; i < acfg->plt_offset; ++i) {
+               MonoPltEntry *plt_entry = NULL;
+               MonoJumpInfo *ji;
+
+               if (i == 0)
+                       /* 
+                        * The first plt entry is unused.
+                        */
+                       continue;
+
+               plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i));
+               ji = plt_entry->ji;
+
+               json_writer_indent (&writer);
+               json_writer_printf (&writer, "{ ");
+               json_writer_object_key(&writer, "symbol");
+               json_writer_printf (&writer, "\"%s\" },\n", plt_entry->symbol);
+       }
+
+       json_writer_indent_pop (&writer);
+       json_writer_indent (&writer);
+       json_writer_array_end (&writer);
+       json_writer_printf (&writer, ",\n");
+#endif
+
+       // GOT entries
+#ifdef DUMP_GOT
+       json_writer_indent_push (&writer);
+       json_writer_indent (&writer);
+       json_writer_object_key(&writer, "got");
+       json_writer_array_begin (&writer);
+
+       json_writer_indent_push (&writer);
+       for (i = 0; i < acfg->got_info.got_patches->len; ++i) {
+               MonoJumpInfo *ji = g_ptr_array_index (acfg->got_info.got_patches, i);
+
+               json_writer_indent (&writer);
+               json_writer_printf (&writer, "{ ");
+               json_writer_object_key(&writer, "patch_name");
+               json_writer_printf (&writer, "\"%s\" },\n", get_patch_name (ji->type));
+       }
+
+       json_writer_indent_pop (&writer);
+       json_writer_indent (&writer);
+       json_writer_array_end (&writer);
+       json_writer_printf (&writer, ",\n");
+#endif
+
+       json_writer_indent_pop (&writer);
+       json_writer_indent (&writer);
+       json_writer_object_end (&writer);
+
+       dumpname = g_strdup_printf ("%s.json", g_path_get_basename (acfg->image->name));
+       dumpfile = fopen (dumpname, "w+");
+       g_free (dumpname);
+
+       fprintf (dumpfile, "%s", writer.text->str);
+       fclose (dumpfile);
+
+       json_writer_destroy (&writer);
+}
 
 int
 mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
diff --git a/mono/mini/aot_dump.c b/mono/mini/aot_dump.c
deleted file mode 100644 (file)
index 8dbefcd..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * aot-dump.c: mono Ahead of Time compiler JSON dumping
- *
- * Author:
- *   Joao Matos (joao.matos@xamarin.com)
- *
- * Copyright 2015 Xamarin Inc (http://www.xamarin.com)
- */
-
-#ifndef MONO_SMALL_CONFIG
-
-#define JSON_INDENT_VALUE 2
-
-typedef struct JsonWriter {
-       GString* text;
-       int indent;
-} JsonWriter;
-
-static void json_writer_init (JsonWriter* writer) MONO_INTERNAL;
-static void json_writer_destroy (JsonWriter* writer);
-static void json_writer_indent(JsonWriter* writer);
-static void json_writer_indent_push(JsonWriter* writer);
-static void json_writer_indent_pop(JsonWriter* writer);
-static void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
-static void json_writer_printf(JsonWriter* writer, const gchar *format, ...);
-static void json_writer_array_begin(JsonWriter* writer);
-static void json_writer_array_end(JsonWriter* writer);
-static void json_writer_object_begin(JsonWriter* writer);
-static void json_writer_object_end(JsonWriter* writer);
-static void json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
-
-static void json_writer_init (JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-
-       writer->text = g_string_new ("");
-       writer->indent = 0;
-}
-
-static void json_writer_destroy (JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       g_string_free (writer->text, /*free_segment=*/TRUE);
-}
-
-static void json_writer_indent_push(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       writer->indent += JSON_INDENT_VALUE;
-}
-
-static void json_writer_indent_pop(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       writer->indent -= JSON_INDENT_VALUE;
-}
-
-static void json_writer_indent(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-
-       int i = 0;
-       for (i = 0; i < writer->indent; ++i)
-               g_string_append_c (writer->text, ' ');
-}
-
-static void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       g_string_append_vprintf (writer->text, format, args);
-}
-
-static void json_writer_printf(JsonWriter* writer, const gchar *format, ...)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-
-       va_list args;
-       va_start (args, format);
-
-       g_string_append_vprintf (writer->text, format, args);
-
-       va_end (args);
-}
-
-static void json_writer_array_begin(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       g_string_append_printf (writer->text, "[\n");
-       writer->indent += JSON_INDENT_VALUE;
-}
-
-static void json_writer_array_end(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       g_string_append_printf (writer->text, "]");
-       writer->indent -= JSON_INDENT_VALUE;
-}
-
-static void json_writer_object_begin(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       json_writer_printf (writer, "{\n");
-       writer->indent += JSON_INDENT_VALUE;
-}
-
-static void json_writer_object_end(JsonWriter* writer)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-       json_writer_printf (writer, "}");
-}
-
-static void json_writer_object_key(JsonWriter* writer, const gchar* format, ...)
-{
-       g_assert (writer && "Expected a valid JSON writer instance");
-
-       va_list args;
-       va_start (args, format);
-
-       g_string_append_printf (writer->text, "\"");
-       json_writer_vprintf (writer, format, args);
-       g_string_append_printf (writer->text, "\" : ");
-
-       va_end (args);
-}
-
-#define WRAPPER(e,n) n,
-static const char* const
-wrapper_type_names [MONO_WRAPPER_NUM + 1] = {
-#include "mono/metadata/wrapper-types.h"
-       NULL
-};
-
-static G_GNUC_UNUSED const char*
-get_wrapper_type_name (int type)
-{
-       return wrapper_type_names [type];
-}
-
-//#define DUMP_PLT
-//#define DUMP_GOT
-
-static void aot_dump (MonoAotCompile *acfg)
-{
-       FILE *dumpfile;
-       char * dumpname;
-
-       JsonWriter writer;
-       json_writer_init (&writer);
-
-       json_writer_object_begin(&writer);
-
-       // Methods
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "methods");
-       json_writer_array_begin (&writer);
-
-       int i;
-       for (i = 0; i < acfg->nmethods; ++i) {
-               MonoCompile *cfg;
-               MonoMethod *method;
-               MonoClass *klass;
-               int index;
-
-               cfg = acfg->cfgs [i];
-               if (!cfg)
-                       continue;
-
-               method = cfg->orig_method;
-
-               json_writer_indent (&writer);
-               json_writer_object_begin(&writer);
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "name");
-               json_writer_printf (&writer, "\"%s\",\n", method->name);
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "signature");
-               json_writer_printf (&writer, "\"%s\",\n", mono_method_full_name (method,
-                       /*signature=*/TRUE));
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "code_size");
-               json_writer_printf (&writer, "\"%d\",\n", cfg->code_size);
-
-               klass = method->klass;
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "class");
-               json_writer_printf (&writer, "\"%s\",\n", klass->name);
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "namespace");
-               json_writer_printf (&writer, "\"%s\",\n", klass->name_space);
-
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "wrapper_type");
-               json_writer_printf (&writer, "\"%s\",\n", get_wrapper_type_name(method->wrapper_type));
-
-               json_writer_indent_pop (&writer);
-               json_writer_indent (&writer);
-               json_writer_object_end (&writer);
-               json_writer_printf (&writer, ",\n");
-       }
-
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
-
-       // PLT entries
-#ifdef DUMP_PLT
-       json_writer_indent_push (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "plt");
-       json_writer_array_begin (&writer);
-
-       for (i = 0; i < acfg->plt_offset; ++i) {
-               MonoPltEntry *plt_entry = NULL;
-               MonoJumpInfo *ji;
-
-               if (i == 0)
-                       /* 
-                        * The first plt entry is unused.
-                        */
-                       continue;
-
-               plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i));
-               ji = plt_entry->ji;
-
-               json_writer_indent (&writer);
-               json_writer_printf (&writer, "{ ");
-               json_writer_object_key(&writer, "symbol");
-               json_writer_printf (&writer, "\"%s\" },\n", plt_entry->symbol);
-       }
-
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
-#endif
-
-       // GOT entries
-#ifdef DUMP_GOT
-       json_writer_indent_push (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "got");
-       json_writer_array_begin (&writer);
-
-       json_writer_indent_push (&writer);
-       for (i = 0; i < acfg->got_info.got_patches->len; ++i) {
-               MonoJumpInfo *ji = g_ptr_array_index (acfg->got_info.got_patches, i);
-
-               json_writer_indent (&writer);
-               json_writer_printf (&writer, "{ ");
-               json_writer_object_key(&writer, "patch_name");
-               json_writer_printf (&writer, "\"%s\" },\n", get_patch_name (ji->type));
-       }
-
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
-#endif
-
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_end (&writer);
-
-       dumpname = g_strdup_printf ("%s.json", g_path_get_basename (acfg->image->name));
-       dumpfile = fopen (dumpname, "w+");
-       g_free (dumpname);
-
-       fprintf (dumpfile, "%s", writer.text->str);
-       fclose (dumpfile);
-
-       json_writer_destroy (&writer);
-}
-
-#else
-
-static void aot_dump (MonoAotCompile *acfg)
-{
-
-}
-
-#endif
\ No newline at end of file
index 4be4026aadeed22ca9f8c3c0efef8193364e7e67..b4e3e858d8964f501867f513f280fc03e709dbdd 100644 (file)
@@ -1860,8 +1860,11 @@ mono_main (int argc, char* argv[])
                   fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.\n");
                   exit (1);
        }
-#if SIZEOF_VOID_P == 8 && defined(TARGET_ARM)
-       fprintf (stderr, "Can't cross-compile on 64 bit platforms to arm.\n");
+#if SIZEOF_VOID_P == 8 && (defined(TARGET_ARM) || defined(TARGET_X86))
+       fprintf (stderr, "Can't cross-compile on 64-bit platforms to 32-bit architecture.\n");
+       exit (1);
+#elif SIZEOF_VOID_P == 4 && (defined(TARGET_ARM64) || defined(TARGET_AMD64))
+       fprintf (stderr, "Can't cross-compile on 32-bit platforms to 64-bit architecture.\n");
        exit (1);
 #endif
 #endif
index d0ee4fac40dcf89a0cfa392493aba69e6847775b..ea146bda57d13777695b38460d3fa0c067173748 100644 (file)
@@ -1575,6 +1575,124 @@ public class Tests
                        return 1;
                return 0;
        }
+
+       struct EmptyStruct {
+       }
+
+       public struct BStruct {
+               public int a, b, c, d;
+       }
+
+       interface IFoo3<T> {
+               int Bytes (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                  byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8);
+               int SBytes (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                       sbyte b1, sbyte b2, sbyte b3, sbyte b4);
+               int Shorts (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                       short b1, short b2, short b3, short b4);
+               int UShorts (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                       ushort b1, ushort b2, ushort b3, ushort b4);
+               int Ints (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                 int i1, int i2, int i3, int i4);
+               int UInts (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                  uint i1, uint i2, uint i3, uint i4);
+               int Structs (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                        BStruct s);
+       }
+
+       class Foo3<T> : IFoo3<T> {
+               public int Bytes (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                                 byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) {
+                       return b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8;
+               }
+               public int SBytes (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                                 sbyte b1, sbyte b2, sbyte b3, sbyte b4) {
+                       return b1 + b2 + b3 + b4;
+               }
+               public int Shorts (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                                  short b1, short b2, short b3, short b4) {
+                       return b1 + b2 + b3 + b4;
+               }
+               public int UShorts (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                                       ushort b1, ushort b2, ushort b3, ushort b4) {
+                       return b1 + b2 + b3 + b4;
+               }
+               public int Ints (T t, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8,
+                                                  int i1, int i2, int i3, int i4) {
+                       return i1 + i2 + i3 + i4;
+               }
+               public int UInts (T t, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8,
+                                                 uint i1, uint i2, uint i3, uint i4) {
+                       return (int)(i1 + i2 + i3 + i4);
+               }
+               public int Structs (T t, int dummy1, int a2, int a3, int a4, int a5, int a6, int a7, int dummy8,
+                                                       BStruct s) {
+                       return s.a + s.b + s.c + s.d;
+               }
+       }
+
+       // Passing small normal arguments on the stack
+       public static int test_0_arm64_small_stack_args () {
+               IFoo3<EmptyStruct> o = (IFoo3<EmptyStruct>)Activator.CreateInstance (typeof (Foo3<>).MakeGenericType (new Type [] { typeof (EmptyStruct) }));
+               int res = o.Bytes (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
+               if (res != 36)
+                       return 1;
+               int res2 = o.SBytes (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, -1, -2, -3, -4);
+               if (res2 != -10)
+                       return 2;
+               int res3 = o.Shorts (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, -1, -2, -3, -4);
+               if (res3 != -10)
+                       return 3;
+               int res4 = o.UShorts (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4);
+               if (res4 != 10)
+                       return 4;
+               int res5 = o.Ints (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, -1, -2, -3, -4);
+               if (res5 != -10)
+                       return 5;
+               int res6 = o.UInts (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4);
+               if (res6 != 10)
+                       return 6;
+               return 0;
+       }
+
+       // Passing vtype normal arguments on the stack
+       public static int test_0_arm64_vtype_stack_args () {
+               IFoo3<EmptyStruct> o = (IFoo3<EmptyStruct>)Activator.CreateInstance (typeof (Foo3<>).MakeGenericType (new Type [] { typeof (EmptyStruct) }));
+               int res = o.Structs (new EmptyStruct (), 1, 2, 3, 4, 5, 6, 7, 8, new BStruct () { a = 1, b = 2, c = 3, d = 4 });
+               if (res != 10)
+                       return 1;
+               return 0;
+       }
+
+       interface IFoo4<T> {
+               T Get(T[,] arr, T t);
+       }
+
+       class Foo4<T> : IFoo4<T> {
+               public T Get(T[,] arr, T t) {
+                       arr [1, 1] = t;
+                       return arr [1, 1];
+               }
+       }
+
+       struct AStruct {
+               public int a, b;
+       }
+
+       public static int test_0_multi_dim_arrays_2 () {
+               IFoo4<int> foo = new Foo4<int> ();
+               var arr = new int [10, 10];
+               int res = foo.Get (arr, 10);
+               if (res != 10)
+                       return 1;
+
+               IFoo4<AStruct> foo2 = new Foo4<AStruct> ();
+               var arr2 = new AStruct [10, 10];
+               var res2 = foo2.Get (arr2, new AStruct () { a = 1, b = 2 });
+               if (res2.a != 1 || res2.b != 2)
+                       return 2;
+               return 0;
+       }
 }
 
 // #13191
index 56047489f80de54825131ade3e99a250399ce5ea..2fc0f49c9a9bb269b5d931bdb4619ff2bb11536c 100755 (executable)
@@ -5276,20 +5276,24 @@ mini_emit_ldelema_ins (MonoCompile *cfg, MonoMethod *cmethod, MonoInst **sp, uns
        MonoInst *addr;
        MonoMethod *addr_method;
        int element_size;
+       MonoClass *eclass = cmethod->klass->element_class;
 
        rank = mono_method_signature (cmethod)->param_count - (is_set? 1: 0);
 
        if (rank == 1)
-               return mini_emit_ldelema_1_ins (cfg, cmethod->klass->element_class, sp [0], sp [1], TRUE);
+               return mini_emit_ldelema_1_ins (cfg, eclass, sp [0], sp [1], TRUE);
 
 #ifndef MONO_ARCH_EMULATE_MUL_DIV
        /* emit_ldelema_2 depends on OP_LMUL */
-       if (rank == 2 && (cfg->opt & MONO_OPT_INTRINS)) {
-               return mini_emit_ldelema_2_ins (cfg, cmethod->klass->element_class, sp [0], sp [1], sp [2]);
+       if (rank == 2 && (cfg->opt & MONO_OPT_INTRINS) && !mini_is_gsharedvt_variable_klass (cfg, eclass)) {
+               return mini_emit_ldelema_2_ins (cfg, eclass, sp [0], sp [1], sp [2]);
        }
 #endif
 
-       element_size = mono_class_array_element_size (cmethod->klass->element_class);
+       if (mini_is_gsharedvt_variable_klass (cfg, eclass))
+               element_size = 0;
+       else
+               element_size = mono_class_array_element_size (eclass);
        addr_method = mono_marshal_get_array_address (rank, element_size);
        addr = mono_emit_method_call (cfg, addr_method, sp, NULL);
 
@@ -9160,7 +9164,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * This needs to be used for all generic calls, not just ones with a gsharedvt signature, to avoid
                         * patching gshared method addresses into a gsharedvt method.
                         */
-                       if (cmethod && cfg->gsharedvt && (mini_is_gsharedvt_signature (cfg, fsig) || cmethod->is_inflated || cmethod->klass->generic_class)) {
+                       if (cmethod && cfg->gsharedvt && (mini_is_gsharedvt_signature (cfg, fsig) || cmethod->is_inflated || cmethod->klass->generic_class) &&
+                               !(cmethod->klass->rank && cmethod->klass->byval_arg.type != MONO_TYPE_SZARRAY)) {
                                MonoRgctxInfoType info_type;
 
                                if (virtual) {
@@ -9186,10 +9191,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        }
                                }
 
-                               if (cmethod->klass->rank && cmethod->klass->byval_arg.type != MONO_TYPE_SZARRAY)
-                                       /* test_0_multi_dim_arrays () in gshared.cs */
-                                       GSHAREDVT_FAILURE (*ip);
-
                                if ((cmethod->klass->parent == mono_defaults.multicastdelegate_class) && (!strcmp (cmethod->name, "Invoke")))
                                        keep_this_alive = sp [0];
 
@@ -9309,6 +9310,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, fsig->params [fsig->param_count - 1], addr->dreg, 0, val->dreg);
                                        if (cfg->gen_write_barriers && val->type == STACK_OBJ && !(val->opcode == OP_PCONST && val->inst_c0 == 0))
                                                emit_write_barrier (cfg, addr, val);
+                                       if (cfg->gen_write_barriers && mini_is_gsharedvt_klass (cfg, cmethod->klass))
+                                               GSHAREDVT_FAILURE (*ip);
                                } else if (strcmp (cmethod->name, "Get") == 0) { /* array Get */
                                        addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, FALSE);
 
index fe1cc21b73826459c9686f4a6e673e0c6cf9af41..ea04525ff14fa08ed11e769046fd1cecfb098102 100644 (file)
@@ -971,7 +971,7 @@ mono_arch_init (void)
         */
        const char *soft = g_getenv ("MONO_ARM_FORCE_SOFT_FLOAT");
 
-       if (!strncmp (soft, "1", 1))
+       if (soft && !strncmp (soft, "1", 1))
                arm_fpu = MONO_ARM_FPU_NONE;
 #endif
 #endif
index 04b2ec30be4410daf07787972101d26be1eb25c5..92a22729dfa44dc0a75e8e150f19e8ce64ab78c5 100644 (file)
@@ -580,6 +580,7 @@ mono_print_ins_index (int i, MonoInst *ins)
        case OP_IOR_IMM:
        case OP_IXOR_IMM:
        case OP_SUB_IMM:
+       case OP_STORE_MEMBASE_IMM:
                printf (" [%d]", (int)ins->inst_imm);
                break;
        case OP_ADD_IMM:
index 7e16bc60ffac240fb43f9dd351173dc9ccacf4a6..8003b5666666f3f32aee3016854dcfdaa8d6a08a 100644 (file)
@@ -123,6 +123,8 @@ monoutils_sources = \
        mono-conc-hashtable.c   \
        sha1.h          \
        sha1.c  \
+       json.h  \
+       json.c  \
        networking.c    \
        networking-posix.c      \
        networking-fallback.c   \
diff --git a/mono/utils/json.c b/mono/utils/json.c
new file mode 100644 (file)
index 0000000..4de3e9f
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * json.c: JSON writer
+ *
+ * Author:
+ *   Joao Matos (joao.matos@xamarin.com)
+ *
+ * Copyright 2015 Xamarin Inc (http://www.xamarin.com)
+ */
+
+#include <mono/utils/json.h>
+
+void json_writer_init (JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+
+       writer->text = g_string_new ("");
+       writer->indent = 0;
+}
+
+void json_writer_destroy (JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       g_string_free (writer->text, /*free_segment=*/TRUE);
+}
+
+void json_writer_indent_push(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       writer->indent += JSON_INDENT_VALUE;
+}
+
+void json_writer_indent_pop(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       writer->indent -= JSON_INDENT_VALUE;
+}
+
+void json_writer_indent(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+
+       int i = 0;
+       for (i = 0; i < writer->indent; ++i)
+               g_string_append_c (writer->text, ' ');
+}
+
+void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       g_string_append_vprintf (writer->text, format, args);
+}
+
+void json_writer_printf(JsonWriter* writer, const gchar *format, ...)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+
+       va_list args;
+       va_start (args, format);
+
+       g_string_append_vprintf (writer->text, format, args);
+
+       va_end (args);
+}
+
+void json_writer_array_begin(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       g_string_append_printf (writer->text, "[\n");
+       writer->indent += JSON_INDENT_VALUE;
+}
+
+void json_writer_array_end(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       g_string_append_printf (writer->text, "]");
+       writer->indent -= JSON_INDENT_VALUE;
+}
+
+void json_writer_object_begin(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       json_writer_printf (writer, "{\n");
+       writer->indent += JSON_INDENT_VALUE;
+}
+
+void json_writer_object_end(JsonWriter* writer)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+       json_writer_printf (writer, "}");
+}
+
+void json_writer_object_key(JsonWriter* writer, const gchar* format, ...)
+{
+       g_assert (writer && "Expected a valid JSON writer instance");
+
+       va_list args;
+       va_start (args, format);
+
+       g_string_append_printf (writer->text, "\"");
+       json_writer_vprintf (writer, format, args);
+       g_string_append_printf (writer->text, "\" : ");
+
+       va_end (args);
+}
diff --git a/mono/utils/json.h b/mono/utils/json.h
new file mode 100644 (file)
index 0000000..5e5a06a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * json.h: JSON writer
+ *
+ * Author:
+ *   Joao Matos (joao.matos@xamarin.com)
+ *
+ * Copyright 2015 Xamarin Inc (http://www.xamarin.com)
+ */
+
+#ifndef __MONO_UTILS_JSON_H__
+#define __MONO_UTILS_JSON_H__
+
+ #include <glib.h>
+
+#define JSON_INDENT_VALUE 2
+
+typedef struct JsonWriter {
+       GString* text;
+       int indent;
+} JsonWriter;
+
+void json_writer_init (JsonWriter* writer);
+void json_writer_destroy (JsonWriter* writer);
+void json_writer_indent(JsonWriter* writer);
+void json_writer_indent_push(JsonWriter* writer);
+void json_writer_indent_pop(JsonWriter* writer);
+void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
+void json_writer_printf(JsonWriter* writer, const gchar *format, ...);
+void json_writer_array_begin(JsonWriter* writer);
+void json_writer_array_end(JsonWriter* writer);
+void json_writer_object_begin(JsonWriter* writer);
+void json_writer_object_end(JsonWriter* writer);
+void json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
+
+#endif
index 681f758ed7ec9308ffc177bc7022f98f49faff2a..a091267ea896a81a1d73d318bf8f266ea67ad41f 100644 (file)
@@ -73,6 +73,7 @@
     <ClCompile Include="..\mono\utils\mono-hwcap.c" />\r
     <ClCompile Include="..\mono\utils\mono-hwcap-x86.c" />\r
     <ClCompile Include="..\mono\utils\bsearch.c" />\r
+    <ClInclude Include="..\mono\utils\json.c" />    \r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\utils\dlmalloc.h" />\r
     <ClInclude Include="..\mono\utils\mono-hwcap.h" />\r
     <ClInclude Include="..\mono\utils\mono-hwcap-x86.h" />\r
     <ClInclude Include="..\mono\utils\bsearch.h" />\r
+    <ClInclude Include="..\mono\utils\json.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <MASM Include="..\mono\utils\win64.asm">\r