#ifndef _GC_INFO_DECODER_
#define _GC_INFO_DECODER_
-#include "gcinfotypes.h"
-
#define _max(a, b) (((a) > (b)) ? (a) : (b))
#define _min(a, b) (((a) < (b)) ? (a) : (b))
-#ifndef GCINFODECODER_NO_EE
+#if !defined(_TARGET_X86_)
+#define USE_GC_INFO_DECODER
+#endif
+
+#if !defined(GCINFODECODER_NO_EE)
#include "eetwain.h"
-#else // GCINFODECODER_NO_EE
+#else
+
+#ifdef FEATURE_REDHAWK
+
+typedef ArrayDPTR(const uint8_t) PTR_CBYTE;
+
+#define LIMITED_METHOD_CONTRACT
+#define SUPPORTS_DAC
+
+#define LOG(x)
+#define LOG_PIPTR(pObjRef, gcFlags, hCallBack)
+#define DAC_ARG(x)
+
+#define VALIDATE_ROOT(isInterior, hCallBack, pObjRef)
+
+#define _ASSERTE(x) assert(x)
+
+#define UINT32 UInt32
+#define INT32 Int32
+#define UINT16 UInt16
+#define UINT UInt32
+#define SIZE_T UIntNative
+#define SSIZE_T IntNative
+#define LPVOID void*
+
+typedef void * OBJECTREF;
+
+#define GET_CALLER_SP(pREGDISPLAY) ((TADDR)0)
+
+#else // FEATURE_REDHAWK
// Stuff from cgencpu.h:
uint32_t flags // is this a pinned and/or interior pointer
);
+#endif // !_EETWAIN_H
+
+#include "regdisp.h"
+
+#endif // FEATURE_REDHAWK
+
#ifndef _strike_h
enum ICodeManagerFlags
#endif // !_strike_h
-#if !defined(_TARGET_X86_)
-#define USE_GC_INFO_DECODER
-#endif
-
-#include "regdisp.h"
-
-#endif // !_EETWAIN_H
-
#endif // GCINFODECODER_NO_EE
+
#include "gcinfotypes.h"
#ifdef _DEBUG
{
public:
- // If you are not insterested in interruptibility or gc lifetime information, pass 0 as instructionOffset
+ // If you are not interested in interruptibility or gc lifetime information, pass 0 as instructionOffset
GcInfoDecoder(
GCInfoToken gcInfoToken,
GcInfoDecoderFlags flags = DECODE_EVERYTHING,
UINT32 GetPrologSize();
INT32 GetPSPSymStackSlot();
INT32 GetGenericsInstContextStackSlot();
- INT32 GetReversePInvokeStackSlot();
+ INT32 GetReversePInvokeFrameStackSlot();
bool HasMethodDescGenericsInstContext();
bool HasMethodTableGenericsInstContext();
bool GetIsVarArg();
bool m_WantsReportOnlyLeaf;
INT32 m_SecurityObjectStackSlot;
INT32 m_GSCookieStackSlot;
- INT32 m_ReversePInvokeStackSlot;
+ INT32 m_ReversePInvokeFrameStackSlot;
UINT32 m_ValidRangeStart;
UINT32 m_ValidRangeEnd;
INT32 m_PSPSymStackSlot;
UINT32 m_CodeLength;
UINT32 m_StackBaseRegister;
UINT32 m_SizeOfEditAndContinuePreservedArea;
- INT32 m_ReversePInvokeFrameSlot;
ReturnKind m_ReturnKind;
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
UINT32 m_NumSafePoints;
#include "common.h"
+
#include "gcinfodecoder.h"
#ifdef USE_GC_INFO_DECODER
if (hasReversePInvokeFrame)
{
- m_ReversePInvokeFrameSlot = (INT32)m_Reader.DecodeVarLengthSigned(REVERSE_PINVOKE_FRAME_ENCBASE);
+ m_ReversePInvokeFrameStackSlot = (INT32)m_Reader.DecodeVarLengthSigned(REVERSE_PINVOKE_FRAME_ENCBASE);
}
else
{
- m_ReversePInvokeFrameSlot = NO_REVERSE_PINVOKE_FRAME;
+ m_ReversePInvokeFrameStackSlot = NO_REVERSE_PINVOKE_FRAME;
}
return m_GSCookieStackSlot;
}
-INT32 GcInfoDecoder::GetReversePInvokeStackSlot()
+INT32 GcInfoDecoder::GetReversePInvokeFrameStackSlot()
{
_ASSERTE(m_Flags & DECODE_REVERSE_PINVOKE_VAR);
- return m_ReversePInvokeStackSlot;
+ return m_ReversePInvokeFrameStackSlot;
}
UINT32 GcInfoDecoder::GetGSCookieValidRangeStart()
UINT32 normBreakOffset = NORMALIZE_CODE_OFFSET(m_InstructionOffset);
-#if 0
- // This is currently disabled because sometimes on IA64 we need
- // to make call sites non-interruptible
- // TODO: review this
-#ifdef _DEBUG
- if(!executionAborted)
- {
- GcInfoDecoder _decoder2(
- m_GcInfoAddress,
- DECODE_INTERRUPTIBILITY,
- m_InstructionOffset
- );
-
- _ASSERTE(_decoder2.IsInterruptible());
- }
-#endif
-#endif
-
// Normalized break offset
// Relative to interruptible ranges #if PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
_ASSERTE(regNum >= 0 && regNum <= 16);
_ASSERTE(regNum != 4); // rsp
+#ifdef FEATURE_REDHAWK
+ PTR_UIntNative* ppRax = &pRD->pRax;
+ if (regNum > 4) regNum--; // rsp is skipped in Redhawk RegDisplay
+#else
// The fields of KNONVOLATILE_CONTEXT_POINTERS are in the same order as
// the processor encoding numbers.
- ULONGLONG **ppRax;
- ppRax = &pRD->pCurrentContextPointers->Rax;
+ ULONGLONG **ppRax = &pRD->pCurrentContextPointers->Rax;
+#endif
return (OBJECTREF*)*(ppRax + regNum);
}
// The fields of CONTEXT are in the same order as
// the processor encoding numbers.
- ULONGLONG *pRax;
- pRax = &pRD->pCurrentContext->Rax;
+ ULONGLONG *pRax = &pRD->pCurrentContext->Rax;
return (OBJECTREF*)(pRax + regNum);
}
#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA
_ASSERTE( m_Flags & DECODE_GC_LIFETIMES );
- ULONGLONG pSlot = (ULONGLONG) GetStackSlot(spOffset, spBase, pRD);
+ TADDR pSlot = (TADDR) GetStackSlot(spOffset, spBase, pRD);
_ASSERTE(pSlot >= pRD->SP);
return (pSlot < pRD->SP + m_SizeOfStackOutgoingAndScratchArea);
// The fields of CONTEXT are in the same order as
// the processor encoding numbers.
- ULONG *pR0;
- pR0 = &pRD->pCurrentContext->R0;
+ ULONG *pR0 = &pRD->pCurrentContext->R0;
return (OBJECTREF*)(pR0 + regNum);
}
#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA
_ASSERTE( m_Flags & DECODE_GC_LIFETIMES );
- DWORD pSlot = (DWORD) GetStackSlot(spOffset, spBase, pRD);
+ TADDR pSlot = (TADDR) GetStackSlot(spOffset, spBase, pRD);
_ASSERTE(pSlot >= pRD->SP);
return (pSlot < pRD->SP + m_SizeOfStackOutgoingAndScratchArea);
#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA
_ASSERTE( m_Flags & DECODE_GC_LIFETIMES );
- ULONGLONG pSlot = (ULONGLONG) GetStackSlot(spOffset, spBase, pRD);
+ TADDR pSlot = (TADDR) GetStackSlot(spOffset, spBase, pRD);
_ASSERTE(pSlot >= pRD->SP);
return (pSlot < pRD->SP + m_SizeOfStackOutgoingAndScratchArea);
// The fields of CONTEXT are in the same order as
// the processor encoding numbers.
- DWORD64 *pX0;
- pX0 = &pRD->pCurrentContext->X0;
+ DWORD64 *pX0 = &pRD->pCurrentContext->X0;
return (OBJECTREF*)(pX0 + regNum);
}
if( GC_SP_REL == spBase )
{
- pObjRef = (OBJECTREF*) ((SIZE_T)GetRegdisplaySP(pRD) + spOffset);
+ pObjRef = (OBJECTREF*) ((SIZE_T)pRD->SP + spOffset);
}
else if( GC_CALLER_SP_REL == spBase )
{