From 6b9efccc55654928225829b853267f1062fa42fa Mon Sep 17 00:00:00 2001 From: Zhicheng Zhu Date: Mon, 11 Apr 2016 11:01:21 -0700 Subject: [PATCH] fix GCInfo build problem, tested a few simple "HelloWorld" program works good! --- src/ToolBox/SOS/Strike/disasm.cpp | 6 ------ src/inc/gcdump.h | 4 ++++ src/inc/gcinfodecoder.h | 7 +++++++ src/vm/gcinfodecoder.cpp | 11 +++++------ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/ToolBox/SOS/Strike/disasm.cpp b/src/ToolBox/SOS/Strike/disasm.cpp index 701c6be..c614fbb 100644 --- a/src/ToolBox/SOS/Strike/disasm.cpp +++ b/src/ToolBox/SOS/Strike/disasm.cpp @@ -44,7 +44,6 @@ namespace X86GCDump #endif // SOS_TARGET_X86 #ifdef SOS_TARGET_AMD64 -#ifndef FEATURE_PAL #include "gcdump.h" #define DAC_ARG(x) #define SUPPORTS_DAC @@ -60,7 +59,6 @@ namespace X86GCDump #endif #define LOG_PIPTR(pObjRef, gcFlags, hCallBack) ((void)0) #include "gcdumpnonx86.cpp" -#endif // FEATURE_PAL #endif // SOS_TARGET_AMD64 #include "disasm.h" @@ -1111,9 +1109,6 @@ LPCSTR AMD64Machine::s_SPName = "RSP"; /// void AMD64Machine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPrintf, bool encBytes, bool bPrintHeader) const { -#ifdef FEATURE_PAL - ExtErr("AMD64Machine::DumpGCInfo not implemented\n"); -#else if (bPrintHeader) { ExtOut("Pointer table:\n"); @@ -1123,7 +1118,6 @@ void AMD64Machine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPri gcDump.gcPrintf = gcPrintf; gcDump.DumpGCTable(pTable, methodSize, 0); -#endif // FEATURE_PAL } #endif // SOS_TARGET_AMD64 diff --git a/src/inc/gcdump.h b/src/inc/gcdump.h index 7aec159..aded6bb 100644 --- a/src/inc/gcdump.h +++ b/src/inc/gcdump.h @@ -20,7 +20,11 @@ #include "gcinfo.h" // For InfoHdr #ifndef FASTCALL +#ifndef FEATURE_PAL #define FASTCALL __fastcall +#else +#define FASTCALL +#endif #endif diff --git a/src/inc/gcinfodecoder.h b/src/inc/gcinfodecoder.h index bd802fe..52e8ed8 100644 --- a/src/inc/gcinfodecoder.h +++ b/src/inc/gcinfodecoder.h @@ -13,6 +13,9 @@ #include "daccess.h" +#define _max(a, b) (((a) > (b)) ? (a) : (b)) +#define _min(a, b) (((a) < (b)) ? (a) : (b)) + #ifndef GCINFODECODER_NO_EE #include "eetwain.h" @@ -150,6 +153,10 @@ enum ICodeManagerFlags #define MAX_PREDECODED_SLOTS 64 #endif +#if defined(FEATURE_PAL) && !defined(STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY) +#define STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY +#endif + enum GcInfoDecoderFlags diff --git a/src/vm/gcinfodecoder.cpp b/src/vm/gcinfodecoder.cpp index 674dce0..0a0a958 100644 --- a/src/vm/gcinfodecoder.cpp +++ b/src/vm/gcinfodecoder.cpp @@ -1169,7 +1169,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader) m_SlotArray[0].Slot.RegisterNumber = regNum; m_SlotArray[0].Flags = flags; - UINT32 loopEnd = min(m_NumRegisters, MAX_PREDECODED_SLOTS); + UINT32 loopEnd = _min(m_NumRegisters, MAX_PREDECODED_SLOTS); for(i++; i < loopEnd; i++) { if(flags) @@ -1203,7 +1203,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader) m_SlotArray[i].Slot.Stack.Base = spBase; m_SlotArray[i].Flags = flags; - UINT32 loopEnd = min(m_NumRegisters + numStackSlots, MAX_PREDECODED_SLOTS); + UINT32 loopEnd = _min(m_NumRegisters + numStackSlots, MAX_PREDECODED_SLOTS); for(i++; i < loopEnd; i++) { spBase = (GcStackSlotBase) reader.Read(2); @@ -1240,7 +1240,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader) m_SlotArray[i].Slot.Stack.Base = spBase; m_SlotArray[i].Flags = flags; - UINT32 loopEnd = min(m_NumSlots, MAX_PREDECODED_SLOTS); + UINT32 loopEnd = _min(m_NumSlots, MAX_PREDECODED_SLOTS); for(i++; i < loopEnd; i++) { spBase = (GcStackSlotBase) reader.Read(2); @@ -1539,8 +1539,7 @@ void GcInfoDecoder::ReportRegisterToGC( // AMD64 LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum )); OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD ); - -#ifdef FEATURE_PAL +#if defined(FEATURE_PAL) && !defined(SOS_TARGET_AMD64) // On PAL, we don't always have the context pointers available due to // a limitation of an unwinding library. In such case, the context // pointers for some nonvolatile registers are NULL. @@ -1560,7 +1559,7 @@ void GcInfoDecoder::ReportRegisterToGC( // AMD64 gcFlags |= GC_CALL_PINNED; } -#endif // FEATURE_PAL +#endif // FEATURE_PAL && !SOS_TARGET_AMD64 #ifdef _DEBUG if(IsScratchRegister(regNum, pRD)) -- 2.7.4