Integrate bug fixes from desktop
authorJan Kotas <jkotas@microsoft.com>
Wed, 25 Nov 2015 22:47:47 +0000 (14:47 -0800)
committerJan Kotas <jkotas@microsoft.com>
Wed, 25 Nov 2015 22:47:47 +0000 (14:47 -0800)
[tfs-changeset: 1552157]

src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs
src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs
src/mscorlib/src/mscorlib.txt
src/vm/appdomain.hpp
src/vm/jithelpers.cpp

index 5d90253673faed4001c40234d745baa44c9e8159..54f7b47d2891a02469bdbfd7e931f6be81b62718 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Diagnostics.Tracing
     /// On any normal event log the event with activityTracker.CurrentActivityId
     /// </summary>
     internal class ActivityTracker
-    { 
+    {
 
         /// <summary>
         /// Called on work item begins.  The activity name = providerName + activityName without 'Start' suffix.
@@ -77,9 +77,9 @@ namespace System.Diagnostics.Tracing
 
             var currentActivity = m_current.Value;
             var fullActivityName = NormalizeActivityName(providerName, activityName, task);
-            
+
             var etwLog = TplEtwProvider.Log;
-            if (etwLog.Debug) 
+            if (etwLog.Debug)
             {
                 etwLog.DebugFacilityMessage("OnStartEnter", fullActivityName);
                 etwLog.DebugFacilityMessage("OnStartEnterActivityState", ActivityInfo.LiveActivities(currentActivity));
@@ -125,7 +125,7 @@ namespace System.Diagnostics.Tracing
             // Remember the current ID so we can log it 
             activityId = newActivity.ActivityId;
 
-            if (etwLog.Debug) 
+            if (etwLog.Debug)
             {
                 etwLog.DebugFacilityMessage("OnStartRetActivityState", ActivityInfo.LiveActivities(newActivity));
                 etwLog.DebugFacilityMessage1("OnStartRet", activityId.ToString(), relatedActivityId.ToString());
@@ -146,13 +146,13 @@ namespace System.Diagnostics.Tracing
             var fullActivityName = NormalizeActivityName(providerName, activityName, task);
 
             var etwLog = TplEtwProvider.Log;
-            if (etwLog.Debug) 
+            if (etwLog.Debug)
             {
                 etwLog.DebugFacilityMessage("OnStopEnter", fullActivityName);
                 etwLog.DebugFacilityMessage("OnStopEnterActivityState", ActivityInfo.LiveActivities(m_current.Value));
             }
 
-            for (; ;) // This is a retry loop.
+            for (; ; ) // This is a retry loop.
             {
                 ActivityInfo currentActivity = m_current.Value;
                 ActivityInfo newCurrentActivity = null;               // if we have seen any live activities (orphans), at he first one we have seen.   
@@ -225,12 +225,12 @@ namespace System.Diagnostics.Tracing
         [System.Security.SecuritySafeCritical]
         public void Enable()
         {
-            if (m_current == null) 
+            if (m_current == null)
             {
                 m_current = new AsyncLocal<ActivityInfo>(ActivityChanging);
             }
         }
-        
+
         /// <summary>
         /// An activity tracker is a singleton, this is how you get the one and only instance.
         /// </summary>
@@ -310,19 +310,19 @@ namespace System.Diagnostics.Tracing
                 }
             }
 
-            public static string Path(ActivityInfo activityInfo) 
+            public static string Path(ActivityInfo activityInfo)
             {
                 if (activityInfo == null)
                     return ("");
                 return Path(activityInfo.m_creator) + "/" + activityInfo.m_uniqueId;
             }
 
-            public override string ToString() 
+            public override string ToString()
             {
                 string dead = "";
                 if (m_stopped != 0)
-                   dead = ",DEAD";
-                 return m_name + "(" + Path(this) + dead + ")";
+                    dead = ",DEAD";
+                return m_name + "(" + Path(this) + dead + ")";
             }
 
             public static string LiveActivities(ActivityInfo list)
@@ -363,7 +363,7 @@ namespace System.Diagnostics.Tracing
             [System.Security.SecuritySafeCritical]
             private unsafe void CreateActivityPathGuid(out Guid idRet, out int activityPathGuidOffset)
             {
-                fixed (Guid* outPtr = &idRet) 
+                fixed (Guid* outPtr = &idRet)
                 {
                     int activityPathGuidOffsetStart = 0;
                     if (m_creator != null)
@@ -371,7 +371,7 @@ namespace System.Diagnostics.Tracing
                         activityPathGuidOffsetStart = m_creator.m_activityPathGuidOffset;
                         idRet = m_creator.m_guid;
                     }
-                    else 
+                    else
                     {
                         // TODO FIXME - differentiate between AD inside PCL
                         int appDomainID = 0;
@@ -471,9 +471,9 @@ namespace System.Diagnostics.Tracing
                     {
                         if (endPtr <= ptr + 2)        // I need at least 2 bytes
                             return 13;
-                        
+
                         // Write out the prefix code nibble and the length nibble 
-                        WriteNibble(ref ptr, endPtr, (uint) NumberListCodes.PrefixCode);
+                        WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.PrefixCode);
                     }
                     // The rest is the same for overflow and non-overflow case
                     WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.MultiByte1 + (len - 1));
@@ -535,7 +535,7 @@ namespace System.Diagnostics.Tracing
             #endregion // CreateGuidForActivityPath
 
             readonly internal string m_name;                        // The name used in the 'start' and 'stop' APIs to help match up
-            readonly long m_uniqueId;                                    // a small number that makes this activity unique among its siblings
+            readonly long m_uniqueId;                               // a small number that makes this activity unique among its siblings
             internal readonly Guid m_guid;                          // Activity Guid, it is basically an encoding of the Path() (see CreateActivityPathGuid)
             internal readonly int m_activityPathGuidOffset;         // Keeps track of where in m_guid the causality path stops (used to generated child GUIDs)
             internal readonly int m_level;                          // current depth of the Path() of the activity (used to keep recursion under control)
@@ -565,7 +565,7 @@ namespace System.Diagnostics.Tracing
                 if (cur == null || prev.m_activityIdToRestore != cur.ActivityId)
                 {
                     EventSource.SetCurrentThreadActivityId(prev.m_activityIdToRestore);
-                return;
+                    return;
                 }
             }
 
@@ -577,7 +577,7 @@ namespace System.Diagnostics.Tracing
             {
                 // We found a live activity (typically the first time), set it to that.  
                 if (cur.m_stopped == 0)
-            {
+                {
                     EventSource.SetCurrentThreadActivityId(cur.ActivityId);
                     return;
                 }
index 2eb7c38e3c8b864001e3e02fff9833ebcc3e71df..6799a09cd531a8ac2d405eca6601ff1a017dd323 100644 (file)
@@ -4478,6 +4478,9 @@ namespace System.Diagnostics.Tracing
         /// </summary>
         private static void RemoveReferencesToListenerInEventSources(EventListener listenerToRemove)
         {
+#if !ES_BUILD_STANDALONE
+            Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock));
+#endif
             // Foreach existing EventSource in the appdomain
             foreach (WeakReference eventSourceRef in s_EventSources)
             {
index de472423ebc29c68eddb1bfec44c7f3b764c41e7..cdc233fd5204c2d43a2e2626af6a7ccc2246b8f2 100644 (file)
@@ -1010,7 +1010,7 @@ EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the
 EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}).
 EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).
 EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}).
-EventSource_EventChannelOutOfRange = Channel {0} has a value of [1} which is outside the legal range (16-254).
+EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254).
 EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}.
 EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider.
 EventSource_DuplicateStringKey = Multiple definitions for string "{0}".
@@ -1036,6 +1036,8 @@ EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not su
 EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group
 EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported
 EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix.
+EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.
+EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.
 
 ; ExecutionEngineException
 ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions.
index de60e95259c4659d5d47339f6a706b0465e4c125..261ca4dc0041363b04ef83a8cda268be82341c90 100644 (file)
@@ -1221,12 +1221,6 @@ public:
     }
 #endif
 
-    //****************************************************************************************
-    //
-
-    virtual IApplicationSecurityDescriptor* GetSecurityDescriptor() { LIMITED_METHOD_CONTRACT; return NULL; }
-
-
     //****************************************************************************************
     // Get the class init lock. The method is limited to friends because inappropriate use
     // will cause deadlocks in the system
@@ -4603,13 +4597,6 @@ public:
     static HRESULT NotifyProfilerShutdown();
 #endif // PROFILING_SUPPORTED
 
-    IApplicationSecurityDescriptor* GetSecurityDescriptor()
-    {
-        LIMITED_METHOD_CONTRACT;
-
-        return NULL;
-    }
-
     //****************************************************************************************
     // return the dev path
 #ifdef FEATURE_FUSION    
index a1ba4beee523ff64ecaf287361391962209d878a..4ad2956efe8f304c7eaf005233cee2c593eb9c54 100644 (file)
@@ -5739,7 +5739,7 @@ HCIMPLEND;
 //
 //========================================================================
 
-HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
+NOINLINE HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
 {
     FCALL_CONTRACT;
 
@@ -5754,6 +5754,7 @@ HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateH
 }
 HCIMPLEND
 
+#include <optsmallperfcritical.h>
 /*************************************************************/
 HCIMPL2(void, JIT_DelegateSecurityCheck, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd)
 {
@@ -5772,11 +5773,12 @@ HCIMPL2(void, JIT_DelegateSecurityCheck, CORINFO_CLASS_HANDLE delegateHnd, CORIN
     HCCALL2(JIT_DelegateSecurityCheck_Internal, delegateHnd, calleeMethodHnd);
 }
 HCIMPLEND
+#include <optdefault.h>
 
 
 /*************************************************************/
 //Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout
-HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
 {
     FCALL_CONTRACT;
 
@@ -5819,6 +5821,7 @@ HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethod
 HCIMPLEND
 
 
+#include <optsmallperfcritical.h>
 /*************************************************************/
 //Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout
 HCIMPL4(void, JIT_MethodAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check)
@@ -5841,10 +5844,11 @@ HCIMPL4(void, JIT_MethodAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORI
     HCCALL4(JIT_MethodAccessCheck_Internal, callerMethodHnd, calleeMethodHnd, calleeTypeHnd, check);
 }
 HCIMPLEND
+#include <optdefault.h>
 
 
 // Slower checks (including failure paths) for determining if a method has runtime access to a field
-HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
 {
     FCALL_CONTRACT;
 
@@ -5875,6 +5879,7 @@ HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodH
 }
 HCIMPLEND
 
+#include <optsmallperfcritical.h>
 // Check to see if a method has runtime access to a field
 HCIMPL3(void, JIT_FieldAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check)
 {
@@ -5903,9 +5908,10 @@ HCIMPL3(void, JIT_FieldAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORIN
     HCCALL3(JIT_FieldAccessCheck_Internal, callerMethodHnd, calleeFieldHnd, check);
 }
 HCIMPLEND
+#include <optdefault.h>
 
 // Slower checks (including failure paths) for determining if a method has runtime access to a type
-HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
+NOINLINE HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
 {
     FCALL_CONTRACT;
 
@@ -5920,6 +5926,7 @@ HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodH
 }
 HCIMPLEND
 
+#include <optsmallperfcritical.h>
 // Check to see if a method has runtime access to a type
 HCIMPL3(void, JIT_ClassAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check)
 {
@@ -5948,6 +5955,7 @@ HCIMPL3(void, JIT_ClassAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORIN
     HCCALL3(JIT_ClassAccessCheck_Internal, callerMethodHnd, calleeClassHnd, check);
 }
 HCIMPLEND
+#include <optdefault.h>
 
 NOINLINE HCIMPL2(void, JIT_Security_Prolog_Framed, CORINFO_METHOD_HANDLE methHnd_, OBJECTREF* ppFrameSecDesc)
 {
@@ -6022,7 +6030,7 @@ HCIMPLEND
 #include <optdefault.h>
 
 /*************************************************************/
-HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_)
+NOINLINE HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_)
 {
     FCALL_CONTRACT;
 
@@ -6061,6 +6069,7 @@ HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methH
 }
 HCIMPLEND
 
+#include <optsmallperfcritical.h>
 /*************************************************************/
 HCIMPL1(void, JIT_VerificationRuntimeCheck, CORINFO_METHOD_HANDLE methHnd_)
 {
@@ -6079,6 +6088,7 @@ HCIMPL1(void, JIT_VerificationRuntimeCheck, CORINFO_METHOD_HANDLE methHnd_)
 
 }
 HCIMPLEND
+#include <optdefault.h>