summaryrefslogtreecommitdiff
path: root/src/jit/inline.h
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2016-05-19 10:39:25 -0700
committerAndy Ayers <andya@microsoft.com>2016-05-20 16:16:56 -0700
commit27484e2c82d8b3b98322e1d758b9caf312231c9c (patch)
tree77f4c24bbee1de05a7ef1d6893f1f366b6da7fe5 /src/jit/inline.h
parentce3ff76234bf199b4498a5d31f05af6eb43073f6 (diff)
downloadcoreclr-27484e2c82d8b3b98322e1d758b9caf312231c9c.tar.gz
coreclr-27484e2c82d8b3b98322e1d758b9caf312231c9c.tar.bz2
coreclr-27484e2c82d8b3b98322e1d758b9caf312231c9c.zip
Inliner: locks for xml read/write access
Move CritSecObject into util.h, and use it to lock around reading and writing inline Xml. Introduce CritSecHolder for RAII management of the locks. Add a simple file position cache for methods to speed up replay when the inline xml file is large.
Diffstat (limited to 'src/jit/inline.h')
-rw-r--r--src/jit/inline.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/jit/inline.h b/src/jit/inline.h
index cac0fc8145..15ff35c8b5 100644
--- a/src/jit/inline.h
+++ b/src/jit/inline.h
@@ -736,6 +736,17 @@ public:
void DumpXml(FILE* file = stderr, unsigned indent = 0);
static void FinalizeXml(FILE* file = stderr);
+ // Cache for file position of this method in the inline xml
+ long GetMethodXmlFilePosition()
+ {
+ return m_MethodXmlFilePosition;
+ }
+
+ void SetMethodXmlFilePosition(long val)
+ {
+ m_MethodXmlFilePosition = val;
+ }
+
#endif // defined(DEBUG) || defined(INLINE_DATA)
// Some inline limit values
@@ -773,8 +784,9 @@ private:
int EstimateSize(InlineContext* context);
#if defined(DEBUG) || defined(INLINE_DATA)
- static bool s_HasDumpedDataHeader;
- static bool s_HasDumpedXmlHeader;
+ static bool s_HasDumpedDataHeader;
+ static bool s_HasDumpedXmlHeader;
+ static CritSecObject s_XmlWriterLock;
#endif // defined(DEBUG) || defined(INLINE_DATA)
Compiler* m_Compiler;
@@ -792,6 +804,11 @@ private:
int m_InitialSizeEstimate;
int m_CurrentSizeEstimate;
bool m_HasForceViaDiscretionary;
+
+#if defined(DEBUG) || defined(INLINE_DATA)
+ long m_MethodXmlFilePosition;
+#endif // defined(DEBUG) || defined(INLINE_DATA)
+
};
#endif // _INLINE_H_