Skip to content
2 changes: 1 addition & 1 deletion src/coreclr/debug/inc/wasm/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

inline CORDB_ADDRESS GetPatchEndAddr(CORDB_ADDRESS patchAddr)
{
_ASSERTE("The function is not implemented on wasm");
PORTABILITY_ASSERT("The function is not implemented on wasm");
return patchAddr;
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/amd64/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ inline TADDR GetSecondArgReg(CONTEXT *context)
#endif
}

extern "C" TADDR GetCurrentSP();
extern "C" void* GetCurrentSP();

// Emits:
// mov r10, pv1
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/appdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@ void SystemDomain::Attach()
#ifndef FEATURE_PORTABLE_ENTRYPOINTS
PrecodeStubManager::Init();
#endif // !FEATURE_PORTABLE_ENTRYPOINTS
#ifdef FEATURE_JIT
JumpStubStubManager::Init();
#endif // FEATURE_JIT
RangeSectionStubManager::Init();
ILStubManager::Init();
InteropDispatchStubManager::Init();
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/arm/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
.syntax unified
.thumb

// LPVOID __stdcall GetCurrentIP(void)//
// void* GetCurrentIP(void)//
LEAF_ENTRY GetCurrentIP, _TEXT
mov r0, lr
bx lr
LEAF_END GetCurrentIP, _TEXT

// LPVOID __stdcall GetCurrentSP(void)//
// void* GetCurrentSP(void)//
LEAF_ENTRY GetCurrentSP, _TEXT
mov r0, sp
bx lr
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ inline PCODE GetLR(const T_CONTEXT * context) {
return PCODE(context->Lr);
}

extern "C" LPVOID __stdcall GetCurrentSP();
extern "C" void* GetCurrentSP();

inline void SetSP(T_CONTEXT *context, TADDR esp) {
LIMITED_METHOD_DAC_CONTRACT;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/arm64/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#include "asmconstants.h"
#include "unixasmmacros.inc"

// LPVOID __stdcall GetCurrentIP(void)//
// void* GetCurrentIP(void)//
LEAF_ENTRY GetCurrentIP, _TEXT
mov x0, lr
ret lr
LEAF_END GetCurrentIP, _TEXT

// LPVOID __stdcall GetCurrentSP(void)//
// void* GetCurrentSP(void)//
LEAF_ENTRY GetCurrentSP, _TEXT
mov x0, sp
ret lr
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/arm64/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
;;like TEXTAREA, but with 64 byte alignment so that we can align the patchable pool below to 64 without warning
AREA |.text|,ALIGN=6,CODE,READONLY

;; LPVOID __stdcall GetCurrentIP(void);
;; void* GetCurrentIP(void);
LEAF_ENTRY GetCurrentIP
mov x0, lr
ret lr
LEAF_END

;; LPVOID __stdcall GetCurrentSP(void);
;; void* GetCurrentSP(void);
LEAF_ENTRY GetCurrentSP
mov x0, sp
ret lr
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm64/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ inline void SetSimdReg(T_CONTEXT * context, int Regnum, NEON128 RegContent)
context->V[Regnum] = RegContent;
}

extern "C" LPVOID __stdcall GetCurrentSP();
extern "C" void* GetCurrentSP();

inline void SetSP(T_CONTEXT *context, TADDR sp) {
LIMITED_METHOD_DAC_CONTRACT;
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5613,6 +5613,7 @@ void ExecutionManager::Unload(LoaderAllocator *pLoaderAllocator)
#endif // FEATURE_INTERPRETER
}

#ifdef HOST_64BIT
// This method is used by the JIT and the runtime for PreStubs. It will return
// the address of a short jump thunk that will jump to the 'target' address.
// It is only needed when the target architecture has a perferred call instruction
Expand Down Expand Up @@ -5924,6 +5925,7 @@ PCODE ExecutionManager::getNextJumpStub(MethodDesc* pMD, PCODE target,

RETURN((PCODE)jumpStub);
}
#endif // HOST_64BIT
#endif // !DACCESS_COMPILE

static void GetFuncletStartOffsetsHelper(PCODE pCodeStart, SIZE_T size, SIZE_T ofsAdj,
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/vm/codeman.h
Original file line number Diff line number Diff line change
Expand Up @@ -2388,14 +2388,14 @@ class ExecutionManager
static void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
#endif

#ifndef DACCESS_COMPILE
#if !defined(DACCESS_COMPILE) && defined(HOST_64BIT)
static PCODE jumpStub(MethodDesc* pMD,
PCODE target,
BYTE * loAddr,
BYTE * hiAddr,
LoaderAllocator *pLoaderAllocator = NULL,
bool throwOnOutOfMemoryWithinRange = true);
#endif
#endif // !defined(DACCESS_COMPILE) && defined(HOST_64BIT)

private:
static RangeSection * FindCodeRangeWithLock(PCODE currentPC);
Expand Down Expand Up @@ -2459,13 +2459,13 @@ class ExecutionManager
}
#endif // defined(_DEBUG)

#ifndef DACCESS_COMPILE
#if !defined(DACCESS_COMPILE) && defined(HOST_64BIT)
static PCODE getNextJumpStub(MethodDesc* pMD,
PCODE target,
BYTE * loAddr, BYTE * hiAddr,
LoaderAllocator *pLoaderAllocator,
bool throwOnOutOfMemoryWithinRange);
#endif
#endif // !defined(DACCESS_COMPILE) && defined(HOST_64BIT)

private:
// ***************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/dllimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5930,7 +5930,7 @@ void MarshalStructViaILStubCode(PCODE pStubCode, void* pManagedData, void* pNati
// it can reenter managed mode and throw a CLR exception if the DLL linking
// fails.
//==========================================================================
EXTERN_C LPVOID STDCALL PInvokeImportWorker(PInvokeMethodDesc* pMD)
EXTERN_C void* PInvokeImportWorker(PInvokeMethodDesc* pMD)
{
LPVOID ret = NULL;

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/frames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ void Frame::PopIfChained()
}
#endif // TARGET_UNIX && !DACCESS_COMPILE

#if !defined(TARGET_X86) || defined(TARGET_UNIX)
#if (!defined(TARGET_X86) || defined(TARGET_UNIX)) && !defined(TARGET_WASM)
/* static */
void Frame::UpdateFloatingPointRegisters(const PREGDISPLAY pRD, TADDR targetSP)
{
Expand Down Expand Up @@ -676,7 +676,7 @@ void InlinedCallFrame::UpdateFloatingPointRegisters(const PREGDISPLAY pRD)
}
}
}
#endif // !TARGET_X86 || TARGET_UNIX
#endif // (!TARGET_X86 || TARGET_UNIX) && !TARGET_WASM

//-----------------------------------------------------------------------
#endif // #ifndef DACCESS_COMPILE
Expand Down
12 changes: 8 additions & 4 deletions src/coreclr/vm/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ class Frame
#endif // DACCESS_COMPILE

#ifndef DACCESS_COMPILE
#if !defined(TARGET_X86) || defined(TARGET_UNIX)
#if (!defined(TARGET_X86) || defined(TARGET_UNIX)) && !defined(TARGET_WASM)
static void UpdateFloatingPointRegisters(const PREGDISPLAY pRD, TADDR targetSP);
#endif // !TARGET_X86 || TARGET_UNIX
#endif // (!TARGET_X86 || TARGET_UNIX) && !TARGET_WASM
#endif // DACCESS_COMPILE

#if defined(TARGET_UNIX) && !defined(DACCESS_COMPILE)
Expand Down Expand Up @@ -2232,9 +2232,9 @@ class InlinedCallFrame : public Frame
}

#ifndef DACCESS_COMPILE
#if !defined(TARGET_X86) || defined(TARGET_UNIX)
#if (!defined(TARGET_X86) || defined(TARGET_UNIX)) && !defined(TARGET_WASM)
void UpdateFloatingPointRegisters(const PREGDISPLAY pRD);
#endif // !TARGET_X86 || TARGET_UNIX
#endif // (!TARGET_X86 || TARGET_UNIX) && !TARGET_WASM
#endif // DACCESS_COMPILE

#ifdef FEATURE_INTERPRETER
Expand Down Expand Up @@ -2528,6 +2528,7 @@ class InterpreterFrame : public FramedMethodFrame
}
#endif // HOST_AMD64 && HOST_WINDOWS

#ifndef TARGET_WASM
void SetInterpExecMethodSP(TADDR sp)
{
LIMITED_METHOD_CONTRACT;
Expand All @@ -2539,6 +2540,7 @@ class InterpreterFrame : public FramedMethodFrame
LIMITED_METHOD_CONTRACT;
return m_SP;
}
#endif // TARGET_WASM

void SetIsFaulting(bool isFaulting)
{
Expand All @@ -2556,7 +2558,9 @@ class InterpreterFrame : public FramedMethodFrame
// Saved SSP of the InterpExecMethod for resuming after catch into interpreter frames.
TADDR m_SSP;
#endif // HOST_AMD64 && HOST_WINDOWS
#ifndef TARGET_WASM
TADDR m_SP;
#endif // TARGET_WASM
};

#endif // FEATURE_INTERPRETER
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ LEAF_ENTRY GetCurrentIP, _TEXT
ret
LEAF_END GetCurrentIP, _TEXT

// LPVOID __stdcall GetCurrentSP(void);
// void* GetCurrentSP(void);
LEAF_ENTRY GetCurrentSP, _TEXT
mov eax, esp
add eax, 4
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ _GetCurrentIP@0 proc public
retn
_GetCurrentIP@0 endp

; LPVOID __stdcall GetCurrentSP(void);
; void* GetCurrentSP(void);
_GetCurrentSP@0 proc public
mov eax, esp
retn
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ inline TADDR GetSP(const CONTEXT * context) {
return (TADDR)(context->Esp);
}

EXTERN_C LPVOID STDCALL GetCurrentSP();
EXTERN_C void* GetCurrentSP();

inline void SetSP(CONTEXT *context, TADDR esp) {
LIMITED_METHOD_DAC_CONTRACT;
Expand Down
20 changes: 12 additions & 8 deletions src/coreclr/vm/interpexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
// for numeric_limits
#include <limits>

#ifdef TARGET_WASM
// Unused on WASM
#define SAVE_THE_LOWEST_SP do {} while (0)
#else
// Save the lowest SP in the current method so that we can identify it by that during stackwalk
#define SAVE_THE_LOWEST_SP pInterpreterFrame->SetInterpExecMethodSP((TADDR)GetCurrentSP())
#endif // !TARGET_WASM

// Call invoker helpers provided by platform.
void InvokeManagedMethod(MethodDesc *pMD, int8_t *pArgs, int8_t *pRet, PCODE target);
void InvokeUnmanagedMethod(MethodDesc *targetMethod, int8_t *pArgs, int8_t *pRet, PCODE callTarget);
Expand Down Expand Up @@ -809,8 +817,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
bool isTailcall = false;
MethodDesc* targetMethod;

// Save the lowest SP in the current method so that we can identify it by that during stackwalk
pInterpreterFrame->SetInterpExecMethodSP((TADDR)GetCurrentSP());
SAVE_THE_LOWEST_SP;

MAIN_LOOP:
try
Expand Down Expand Up @@ -2629,8 +2636,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
pChildFrame = (InterpMethodContextFrame*)alloca(sizeof(InterpMethodContextFrame));
pChildFrame->pNext = NULL;
pFrame->pNext = pChildFrame;
// Save the lowest SP in the current method so that we can identify it by that during stackwalk
pInterpreterFrame->SetInterpExecMethodSP((TADDR)GetCurrentSP());
SAVE_THE_LOWEST_SP;
}
pChildFrame->ReInit(pFrame, targetIp, returnValueAddress, LOCAL_VAR_ADDR(callArgsOffset, int8_t));
pFrame = pChildFrame;
Expand Down Expand Up @@ -2747,8 +2753,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
pChildFrame = (InterpMethodContextFrame*)alloca(sizeof(InterpMethodContextFrame));
pChildFrame->pNext = NULL;
pFrame->pNext = pChildFrame;
// Save the lowest SP in the current method so that we can identify it by that during stackwalk
pInterpreterFrame->SetInterpExecMethodSP((TADDR)GetCurrentSP());
SAVE_THE_LOWEST_SP;
}
pChildFrame->ReInit(pFrame, targetIp, returnValueAddress, callArgsAddress);
pFrame = pChildFrame;
Expand Down Expand Up @@ -3564,8 +3569,7 @@ do \
pChildFrame = (InterpMethodContextFrame*)alloca(sizeof(InterpMethodContextFrame));
pChildFrame->pNext = NULL;
pFrame->pNext = pChildFrame;
// Save the lowest SP in the current method so that we can identify it by that during stackwalk
pInterpreterFrame->SetInterpExecMethodSP((TADDR)GetCurrentSP());
SAVE_THE_LOWEST_SP;
}
// Set the frame to the same values as the caller frame.
pChildFrame->ReInit(pFrame, pFrame->startIp, pFrame->pRetVal, pFrame->pStack);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/loongarch64/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LEAF_ENTRY GetCurrentIP, _TEXT
jirl $r0, $ra, 0
LEAF_END GetCurrentIP, _TEXT

// LPVOID __stdcall GetCurrentSP(void)//
// void* GetCurrentSP(void)//
LEAF_ENTRY GetCurrentSP, _TEXT
ori $a0, $sp, 0
jirl $r0, $ra, 0
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/loongarch64/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ inline TADDR GetReg(T_CONTEXT * context, int Regnum)
return (TADDR)(&context->R0 + Regnum);
}

extern "C" LPVOID __stdcall GetCurrentSP();
extern "C" void* GetCurrentSP();

inline void SetSP(T_CONTEXT *context, TADDR sp) {
LIMITED_METHOD_DAC_CONTRACT;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/riscv64/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LEAF_ENTRY GetCurrentIP, _TEXT
ret
LEAF_END GetCurrentIP, _TEXT

// LPVOID __stdcall GetCurrentSP(void)//
// void* GetCurrentSP(void)//
LEAF_ENTRY GetCurrentSP, _TEXT
addi a0, sp, 0
ret
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/riscv64/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ inline void SetReg(T_CONTEXT * context, int Regnum, PCODE RegContent)
*(&context->R0 + Regnum) = RegContent;
}

extern "C" LPVOID __stdcall GetCurrentSP();
extern "C" void* GetCurrentSP();

inline void SetSP(T_CONTEXT *context, TADDR sp) {
LIMITED_METHOD_DAC_CONTRACT;
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/stubmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ BOOL StubLinkStubManager::TraceManager(Thread *thread,

#endif // #ifndef DACCESS_COMPILE

#ifdef FEATURE_JIT
// -------------------------------------------------------
// JumpStub stubs
//
Expand Down Expand Up @@ -1472,6 +1473,7 @@ BOOL JumpStubStubManager::DoTraceStub(PCODE stubStartAddress,

return TRUE;
}
#endif // FEATURE_JIT

//
// Stub manager for code sections. It forwards the query to the more appropriate
Expand Down Expand Up @@ -1535,8 +1537,10 @@ BOOL RangeSectionStubManager::DoTraceStub(PCODE stubStartAddress, TraceDestinati

switch (GetStubKind(stubStartAddress))
{
#ifdef FEATURE_JIT
case STUB_CODE_BLOCK_JUMPSTUB:
return JumpStubStubManager::g_pManager->DoTraceStub(stubStartAddress, trace);
#endif // FEATURE_JIT

case STUB_CODE_BLOCK_STUBLINK:
return StubLinkStubManager::g_pManager->DoTraceStub(stubStartAddress, trace);
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/vm/stubmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,9 @@ class StubLinkStubManager : public StubManager
#endif
} ;

#ifdef FEATURE_JIT
//
// Stub manager for jump stubs created by ExecutionManager::jumpStub()
// These are currently used only on the 64-bit targets IA64 and AMD64
//
typedef VPTR(class JumpStubStubManager) PTR_JumpStubStubManager;

Expand Down Expand Up @@ -542,6 +542,7 @@ class JumpStubStubManager : public StubManager
{ LIMITED_METHOD_CONTRACT; return W("JumpStub"); }
#endif
};
#endif // FEATURE_JIT

//
// Stub manager for code sections. It forwards the query to the more appropriate
Expand Down
Loading
Loading