diff --git a/src/coreclr/interpreter/compiler.cpp b/src/coreclr/interpreter/compiler.cpp index b5924423564ee6..c48bc08ac7d2fb 100644 --- a/src/coreclr/interpreter/compiler.cpp +++ b/src/coreclr/interpreter/compiler.cpp @@ -4097,8 +4097,6 @@ void InterpCompiler::EmitCanAccessCallout(CORINFO_RESOLVED_TOKEN *pResolvedToken void InterpCompiler::EmitCallsiteCallout(CorInfoIsAccessAllowedResult accessAllowed, CORINFO_HELPER_DESC* calloutDesc) { -// WASM-TODO: https://github.com/dotnet/runtime/issues/121955 -#ifndef TARGET_WASM if (accessAllowed == CORINFO_ACCESS_ILLEGAL) { int32_t svars[CORINFO_ACCESS_ALLOWED_MAX_ARGS]; @@ -4169,7 +4167,6 @@ void InterpCompiler::EmitCallsiteCallout(CorInfoIsAccessAllowedResult accessAllo } m_pLastNewIns->data[0] = GetDataForHelperFtn(calloutDesc->helperNum); } -#endif // !TARGET_WASM } static OpcodePeepElement peepRuntimeAsyncCall[] = { diff --git a/src/coreclr/vm/prestub.cpp b/src/coreclr/vm/prestub.cpp index 9b4b886981a82c..4ee558fa1bee08 100644 --- a/src/coreclr/vm/prestub.cpp +++ b/src/coreclr/vm/prestub.cpp @@ -2314,7 +2314,15 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo if (helperMD->ShouldCallPrestub()) (void)helperMD->DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); void* ilStubInterpData = helperMD->GetInterpreterCode(); + // WASM-TODO: update this when we will have codegen + _ASSERTE(ilStubInterpData != NULL); SetInterpreterCode((InterpByteCodeStart*)ilStubInterpData); + + // Use this method's own PortableEntryPoint rather than the helper's. + // It is required to maintain 1:1 mapping between MethodDesc and its entrypoint. + PCODE entryPoint = GetPortableEntryPoint(); + PortableEntryPoint::SetInterpreterData(entryPoint, (PCODE)(TADDR)ilStubInterpData); + pCode = entryPoint; } #else // !FEATURE_PORTABLE_ENTRYPOINTS // FCalls are always wrapped in a precode to enable mapping of the entrypoint back to MethodDesc