Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/coreclr/vm/precode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "common.h"
#include "dllimportcallback.h"
#include "../interpreter/interpretershared.h"

#ifdef FEATURE_PERFMAP
#include "perfmap.h"
Expand Down Expand Up @@ -158,7 +159,7 @@ MethodDesc* Precode::GetMethodDesc(BOOL fSpeculative /*= FALSE*/)
break;
#ifdef FEATURE_INTERPRETER
case PRECODE_INTERPRETER:
return NULL;
pMD = AsInterpreterPrecode()->GetMethodDesc();
break;
#endif // FEATURE_INTERPRETER

Expand All @@ -180,6 +181,16 @@ MethodDesc* Precode::GetMethodDesc(BOOL fSpeculative /*= FALSE*/)
return (PTR_MethodDesc)pMD;
}

#ifdef FEATURE_INTERPRETER
TADDR InterpreterPrecode::GetMethodDesc()
{
LIMITED_METHOD_DAC_CONTRACT;

InterpByteCodeStart* pInterpreterCode = dac_cast<PTR_InterpByteCodeStart>(GetData()->ByteCodeAddr);
return (TADDR)pInterpreterCode->Method->methodHnd;
}
#endif // FEATURE_INTERPRETER

BOOL Precode::IsPointingToPrestub(PCODE target)
{
CONTRACTL
Expand Down
15 changes: 15 additions & 0 deletions src/coreclr/vm/precode.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ struct InterpreterPrecode
LIMITED_METHOD_CONTRACT;
return (InterpreterPrecode*)PCODEToPINSTR(entryPoint);
}

TADDR GetMethodDesc();
};

typedef DPTR(InterpreterPrecode) PTR_InterpreterPrecode;

#endif // FEATURE_INTERPRETER

#ifdef HAS_FIXUP_PRECODE
Expand Down Expand Up @@ -593,6 +598,16 @@ class Precode {
}
#endif // HAS_THISPTR_RETBUF_PRECODE

#ifdef FEATURE_INTERPRETER
InterpreterPrecode* AsInterpreterPrecode()
{
LIMITED_METHOD_CONTRACT;
SUPPORTS_DAC;

return dac_cast<PTR_InterpreterPrecode>(this);
}
#endif // FEATURE_INTERPRETER

TADDR GetStart()
{
SUPPORTS_DAC;
Expand Down
Loading