summaryrefslogtreecommitdiff
path: root/src/vm/assembly.cpp
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2017-03-07 18:58:11 -0800
committerBrian Sullivan <briansul@microsoft.com>2017-03-13 12:45:14 -0700
commitc67474bd34847bf5ceff3d49f29eb4b778848748 (patch)
treeca4220191ea1fcc24361c023cfeb4fd55544ae54 /src/vm/assembly.cpp
parenta7bed220d5455a705452eb0cc7248b941a6ecd99 (diff)
downloadcoreclr-c67474bd34847bf5ceff3d49f29eb4b778848748.tar.gz
coreclr-c67474bd34847bf5ceff3d49f29eb4b778848748.tar.bz2
coreclr-c67474bd34847bf5ceff3d49f29eb4b778848748.zip
Work for IBC profiling with ReadyToRun images
Incremented ReadyToRun version to 2.2 Implemented caching for IsInstrumented using IS_INSTRUMENTED_UNSET Added method Module::InitializeForProfiling() Added full support for method profile counts in ReadyToRun image
Diffstat (limited to 'src/vm/assembly.cpp')
-rw-r--r--src/vm/assembly.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp
index 5f0e75dd4d..d95eec0720 100644
--- a/src/vm/assembly.cpp
+++ b/src/vm/assembly.cpp
@@ -141,6 +141,9 @@ Assembly::Assembly(BaseDomain *pDomain, PEAssembly* pFile, DebuggerAssemblyContr
#ifdef FEATURE_COMINTEROP
, m_InteropAttributeStatus(INTEROP_ATTRIBUTE_UNSET)
#endif
+#ifdef FEATURE_PREJIT
+ , m_isInstrumentedStatus(IS_INSTRUMENTED_UNSET)
+#endif
{
STANDARD_VM_CONTRACT;
}
@@ -2329,21 +2332,37 @@ BOOL Assembly::IsInstrumented()
STATIC_CONTRACT_GC_TRIGGERS;
STATIC_CONTRACT_FAULT;
- BOOL isInstrumented = false;
-
- EX_TRY
+ // This will set the value of m_isInstrumentedStatus by calling IsInstrumentedHelper()
+ // that method performs string pattern matching using the Config value of ZapBBInstr
+ // We cache the value returned from that method in m_isInstrumentedStatus
+ //
+ if (m_isInstrumentedStatus == IS_INSTRUMENTED_UNSET)
{
- FAULT_NOT_FATAL();
+ EX_TRY
+ {
+ FAULT_NOT_FATAL();
- isInstrumented = IsInstrumentedHelper();
- }
- EX_CATCH
- {
- isInstrumented = false;
+ if (IsInstrumentedHelper())
+ {
+ m_isInstrumentedStatus = IS_INSTRUMENTED_TRUE;
+ }
+ else
+ {
+ m_isInstrumentedStatus = IS_INSTRUMENTED_FALSE;
+ }
+ }
+
+ EX_CATCH
+ {
+ m_isInstrumentedStatus = IS_INSTRUMENTED_FALSE;
+ }
+ EX_END_CATCH(RethrowTerminalExceptions);
}
- EX_END_CATCH(RethrowTerminalExceptions);
- return isInstrumented;
+ // At this point m_isInstrumentedStatus can't have the value of IS_INSTRUMENTED_UNSET
+ _ASSERTE(m_isInstrumentedStatus != IS_INSTRUMENTED_UNSET);
+
+ return (m_isInstrumentedStatus == IS_INSTRUMENTED_TRUE);
}
BOOL Assembly::IsInstrumentedHelper()
@@ -2357,7 +2376,7 @@ BOOL Assembly::IsInstrumentedHelper()
return false;
// We must have a native image in order to perform IBC instrumentation
- if (!GetManifestFile()->HasNativeImage())
+ if (!GetManifestFile()->HasNativeOrReadyToRunImage())
return false;
// @Consider using the full name instead of the short form