summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2015-04-29 20:17:48 -0700
committerSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2015-05-05 13:39:09 -0700
commitb503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8 (patch)
tree358b860c39546d3dac102b06fd4a0494f9543af0
parente79b36be0a49362908f5d191ca5b1f68eef8b39f (diff)
downloadcoreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.tar.gz
coreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.tar.bz2
coreclr-b503f15c45f9a7e6d0f90e5f4f9d3985f2060fe8.zip
GcInfo: Add support for Standalone build
The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library independently by clients outside the CoreClr tree. The GcInfo library uses some custom data-structures (ex: ArrayList) and includes some utility libraries (ex: UtilCode) which pull in several other headers with considerable unrelated content. Rather than porting all the utility code to suite other clients, the STANDALONE_BUILD switch can be used to include only the minimal set of headers specific to GcInfo encodings. Clients of STANDALONE_BUILD will likely use standard library implementations of data-structures like ArrayList, HashMap etc., in place of the custom implementation currently used by GcInfoEncoder. Rather than spew the GcInfoEnoder code with #ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special header GcInfoUtil.h in STANDALONE_BUILD mode. GcInfoUtil.h is expected to supply the interface/implementation for the data-structures and utilities used by GcInfoEncoder. This header should be provided by the clients doing the standalone build in their source tree.
-rw-r--r--src/.nuget/Microsoft.DotNet.CoreCLR.Debug.Development.nuspec5
-rw-r--r--src/.nuget/Microsoft.DotNet.CoreCLR.Development.nuspec3
-rw-r--r--src/gcinfo/CMakeLists.txt3
-rw-r--r--src/gcinfo/gcinfoencoder.cpp6
-rw-r--r--src/inc/CMakeLists.txt2
-rw-r--r--src/inc/gcinfoencoder.h36
-rw-r--r--src/inc/gcinfotypes.h1
7 files changed, 48 insertions, 8 deletions
diff --git a/src/.nuget/Microsoft.DotNet.CoreCLR.Debug.Development.nuspec b/src/.nuget/Microsoft.DotNet.CoreCLR.Debug.Development.nuspec
index 7cedd34318..4fbbdf5791 100644
--- a/src/.nuget/Microsoft.DotNet.CoreCLR.Debug.Development.nuspec
+++ b/src/.nuget/Microsoft.DotNet.CoreCLR.Debug.Development.nuspec
@@ -40,6 +40,9 @@
<file src="..\inc\corinfo.h" target="inc\corinfo.h" />
<file src="..\inc\corjit.h" target="inc\corjit.h" />
<file src="..\inc\opcode.def" target="inc\opcode.def" />
- <file src="..\inc\openum.h" target="inc\openum.h" />
+ <file src="..\inc\openum.h" target="inc\openum.h" />
+ <file src="..\inc\gcinfoencoder.h" target="inc\gcinfoencoder.h" />
+ <file src="..\inc\gcinfotypes.h" target="inc\gcinfotypes.h" />
+ <file src="..\gcinfo\gcinfoencoder.cpp" target="gcinfo\gcinfoencoder.cpp" />
</files>
</package>
diff --git a/src/.nuget/Microsoft.DotNet.CoreCLR.Development.nuspec b/src/.nuget/Microsoft.DotNet.CoreCLR.Development.nuspec
index 0f9a7d052b..fe3a59f472 100644
--- a/src/.nuget/Microsoft.DotNet.CoreCLR.Development.nuspec
+++ b/src/.nuget/Microsoft.DotNet.CoreCLR.Development.nuspec
@@ -41,5 +41,8 @@
<file src="..\inc\corjit.h" target="inc\corjit.h" />
<file src="..\inc\opcode.def" target="inc\opcode.def" />
<file src="..\inc\openum.h" target="inc\openum.h" />
+ <file src="..\inc\gcinfoencoder.h" target="inc\gcinfoencoder.h" />
+ <file src="..\inc\gcinfotypes.h" target="inc\gcinfotypes.h" />
+ <file src="..\.\gcinfo\gcinfoencoder.cpp" target="gcinfo\gcinfoencoder.cpp" />
</files>
</package>
diff --git a/src/gcinfo/CMakeLists.txt b/src/gcinfo/CMakeLists.txt
index 47789d8ccb..0093815b8a 100644
--- a/src/gcinfo/CMakeLists.txt
+++ b/src/gcinfo/CMakeLists.txt
@@ -14,3 +14,6 @@ endif(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(lib)
add_subdirectory(crossgen)
+
+install (FILES gcinfoencoder.cpp
+ DESTINATION gcinfo)
diff --git a/src/gcinfo/gcinfoencoder.cpp b/src/gcinfo/gcinfoencoder.cpp
index f9d6ebb4a1..8f3fe9508e 100644
--- a/src/gcinfo/gcinfoencoder.cpp
+++ b/src/gcinfo/gcinfoencoder.cpp
@@ -20,8 +20,11 @@
#define LOGGING
#endif
#endif
+
+#ifndef STANDALONE_BUILD
#include "log.h"
#include "simplerhash.h"
+#endif
#ifdef MDIL
#define MUST_CALL_JITALLOCATOR_FREE 1
@@ -84,7 +87,7 @@ void GcInfoSize::Log(DWORD level, const char * header)
#endif
-
+#ifndef DISABLE_EH_VECTORS
inline BOOL IsEssential(EE_ILEXCEPTION_CLAUSE *pClause)
{
_ASSERTE(pClause->TryEndPC >= pClause->TryStartPC);
@@ -93,6 +96,7 @@ inline BOOL IsEssential(EE_ILEXCEPTION_CLAUSE *pClause)
return TRUE;
}
+#endif
GcInfoEncoder::GcInfoEncoder(
ICorJitInfo* pCorJitInfo,
diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt
index be7f6d4329..6f4a1880c0 100644
--- a/src/inc/CMakeLists.txt
+++ b/src/inc/CMakeLists.txt
@@ -74,4 +74,6 @@ install (FILES cor.h
corjit.h
opcode.def
openum.h
+ gcinfoencoder.h
+ gcinfotypes.h
DESTINATION inc)
diff --git a/src/inc/gcinfoencoder.h b/src/inc/gcinfoencoder.h
index 9987d67be1..ea9c295df0 100644
--- a/src/inc/gcinfoencoder.h
+++ b/src/inc/gcinfoencoder.h
@@ -41,28 +41,54 @@
7. Chunk pointers
8. Chunk encodings
+
+ STANDALONE_BUILD
+
+ The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library
+ independently by clients outside the CoreClr tree.
+
+ The GcInfo library uses some custom data-structures (ex: ArrayList, SimplerHashTable)
+ and includes some utility libraries (ex: UtilCode) which pull in several other
+ headers with considerable unrelated content. Rather than porting all the
+ utility code to suite other clients, the STANDALONE_BUILD switch can be used
+ to include only the minimal set of headers specific to GcInfo encodings.
+
+ Clients of STANDALONE_BUILD will likely use standard library
+ implementations of data-structures like ArrayList, HashMap etc., in place
+ of the custom implementation currently used by GcInfoEncoder.
+
+ Rather than spew the GcInfoEnoder code with
+ #ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special
+ header GcInfoUtil.h in STANDALONE_BUILD mode. GcInfoUtil.h is expected to
+ supply the interface/implementation for the data-structures and utilities
+ used by GcInfoEncoder. This header should be provided by the clients doing
+ the standalone build in their source tree.
+
*****************************************************************/
#ifndef __GCINFOENCODER_H__
#define __GCINFOENCODER_H__
-
+#ifdef STANDALONE_BUILD
+#include <wchar.h>
+#include <stdio.h>
+#include "GcInfoUtil.h"
+#include "corjit.h"
+#else
#include <windows.h>
-
#include <wchar.h>
#include <stdio.h>
-
#include "utilcode.h"
#include "corjit.h"
#include "slist.h" // for SList
#include "arraylist.h"
#include "iallocator.h"
-
#include "stdmacros.h"
-#include "gcinfotypes.h"
#include "eexcp.h"
+#endif
+#include "gcinfotypes.h"
#ifdef VERIFY_GCINFO
#include "dbggcinfoencoder.h"
diff --git a/src/inc/gcinfotypes.h b/src/inc/gcinfotypes.h
index 7852f8687f..7334edd680 100644
--- a/src/inc/gcinfotypes.h
+++ b/src/inc/gcinfotypes.h
@@ -62,7 +62,6 @@
//--------------------------------------------------------------------------------
__forceinline size_t SAFE_SHIFT_LEFT(size_t x, size_t count)
{
- LIMITED_METHOD_DAC_CONTRACT;
_ASSERTE(count <= BITS_PER_SIZE_T);
return (x << 1) << (count-1);
}