summaryrefslogtreecommitdiff
path: root/src/gcdump
diff options
context:
space:
mode:
authorSwaroop Sridhar <swaroops@microsoft.com>2016-08-22 15:06:44 -0700
committerSwaroop Sridhar <swaroops@microsoft.com>2016-09-14 10:16:00 -0700
commit4871121dbb7d1ee3282f9beb950cd73fb4f8a95b (patch)
treee45e0025e4c54366cedd61d402fd9b62ef324c6a /src/gcdump
parent21e4eb9cd224c6fa257c810d270e3ff45b12a63e (diff)
downloadcoreclr-4871121dbb7d1ee3282f9beb950cd73fb4f8a95b.tar.gz
coreclr-4871121dbb7d1ee3282f9beb950cd73fb4f8a95b.tar.bz2
coreclr-4871121dbb7d1ee3282f9beb950cd73fb4f8a95b.zip
Implement GcInfo v2 for X86
This commit includes the following changes: 1) Thread GcInfo version through X86 specific APIs 2) Add ReturnKind and ReversePinvokeOffset fields to InfoHdr structure GcInfo v1 and v2 use the same InfoHdr structures, because: InfoHdrSmall: ReturnKind is encoded within previously unused bits. InfoHdr: revPInvokeOffset will never be written to the image, since ReversePinvokeOffset==INVALID_REV_PINVOKE_OFFSET for V1. 3) Update the Pre-computed header table to include bits for the above [The default setting of ReturnKind=RT_Scalar is used for all entries in the table. Optimizing this table based in most frequent usage scenarios is to be done separately] 4) Change the GC encoder/decoder to handle the above two fields 5) Use the ReturnKind in the GCInfo from thread-suspension code. GcInfo version is changed for CoreCLR X86 only, not for Desktop JIT Fixes #4379
Diffstat (limited to 'src/gcdump')
-rw-r--r--src/gcdump/gcdumpnonx86.cpp2
-rw-r--r--src/gcdump/i386/gcdumpx86.cpp24
2 files changed, 20 insertions, 6 deletions
diff --git a/src/gcdump/gcdumpnonx86.cpp b/src/gcdump/gcdumpnonx86.cpp
index 7343ac9771..c2f41c933a 100644
--- a/src/gcdump/gcdumpnonx86.cpp
+++ b/src/gcdump/gcdumpnonx86.cpp
@@ -505,7 +505,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE gcInfoBlock,
/*****************************************************************************/
-void GCDump::DumpPtrsInFrame(PTR_CBYTE infoBlock,
+void GCDump::DumpPtrsInFrame(PTR_CBYTE gcInfoBlock,
PTR_CBYTE codeBlock,
unsigned offs,
bool verifyGCTables)
diff --git a/src/gcdump/i386/gcdumpx86.cpp b/src/gcdump/i386/gcdumpx86.cpp
index 70334dee65..0c903970e1 100644
--- a/src/gcdump/i386/gcdumpx86.cpp
+++ b/src/gcdump/i386/gcdumpx86.cpp
@@ -60,12 +60,13 @@ const char * CalleeSavedRegName(unsigned reg)
/*****************************************************************************/
-unsigned GCDump::DumpInfoHdr (PTR_CBYTE table,
+unsigned GCDump::DumpInfoHdr (PTR_CBYTE gcInfoBlock,
InfoHdr* header,
unsigned * methodSize,
bool verifyGCTables)
{
unsigned count;
+ PTR_CBYTE table = gcInfoBlock;
PTR_CBYTE tableStart = table;
PTR_CBYTE bp = table;
@@ -76,7 +77,7 @@ unsigned GCDump::DumpInfoHdr (PTR_CBYTE table,
table += decodeUnsigned(table, methodSize);
- table = decodeHeader(table, header);
+ table = decodeHeader(table, gcInfoVersion, header);
BOOL hasArgTabOffset = FALSE;
if (header->untrackedCnt == HAS_UNTRACKED)
@@ -107,6 +108,12 @@ unsigned GCDump::DumpInfoHdr (PTR_CBYTE table,
header->syncEndOffset = count;
}
+ if (header->revPInvokeOffset == HAS_REV_PINVOKE_FRAME_OFFSET)
+ {
+ table += decodeUnsigned(table, &count);
+ header->revPInvokeOffset = count;
+ }
+
//
// First print out all the basic information
//
@@ -931,12 +938,12 @@ DONE_REGTAB:
/*****************************************************************************/
-void GCDump::DumpPtrsInFrame(PTR_CBYTE infoBlock,
+void GCDump::DumpPtrsInFrame(PTR_CBYTE gcInfoBlock,
PTR_CBYTE codeBlock,
unsigned offs,
bool verifyGCTables)
{
- PTR_CBYTE table = infoBlock;
+ PTR_CBYTE table = gcInfoBlock;
size_t methodSize;
size_t stackSize;
@@ -963,7 +970,7 @@ void GCDump::DumpPtrsInFrame(PTR_CBYTE infoBlock,
// Typically only uses one-byte to store everything.
//
InfoHdr header;
- table = decodeHeader(table, &header);
+ table = decodeHeader(table, gcInfoVersion, &header);
if (header.untrackedCnt == HAS_UNTRACKED)
{
@@ -994,6 +1001,13 @@ void GCDump::DumpPtrsInFrame(PTR_CBYTE infoBlock,
header.syncEndOffset = offset;
_ASSERTE(offset != INVALID_SYNC_OFFSET);
}
+ if (header.revPInvokeOffset == HAS_REV_PINVOKE_FRAME_OFFSET)
+ {
+ unsigned offset;
+ table += decodeUnsigned(table, &offset);
+ header.revPInvokeOffset = offset;
+ _ASSERTE(offset != INVALID_REV_PINVOKE_OFFSET);
+ }
prologSize = header.prologSize;
epilogSize = header.epilogSize;