Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
5 changes: 2 additions & 3 deletions 5 src/coreclr/vm/callhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,8 @@ void CallDefaultConstructor(OBJECTREF ref)

PCODE ctorCode = pMD->GetSingleCallableAddrOfCode();
#ifdef FEATURE_PORTABLE_ENTRYPOINTS
// CallDefaultConstructor invokes the ctor via a typed call_indirect, so its portable
// entry point must resolve to real code (native R2R or a correctly-typed interpreter
// thunk) rather than a temporary precode.
// CallDefaultConstructor invokes the ctor via the function pointer, so its portable entrypoint
// must resolve to real code if possible.
Comment thread
lewing marked this conversation as resolved.
MethodDesc::EnsurePortableEntryPointIsCallableFromR2R(ctorCode);
#endif // FEATURE_PORTABLE_ENTRYPOINTS

Expand Down
6 changes: 6 additions & 0 deletions 6 src/coreclr/vm/comutilnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,12 @@ extern "C" void* QCALLTYPE GCInterface_GetNextFinalizableObject(QCall::ObjectHan
MethodTable* pMT = target->GetMethodTable();

funcPtr = pMT->GetRestoredSlot(g_pObjectFinalizerMD->GetSlot());

#ifdef FEATURE_PORTABLE_ENTRYPOINTS
// RunFinalizers invokes the finalizer via the function pointer, so its portable entrypoint must
// resolve to real code if possible.
Comment thread
lewing marked this conversation as resolved.
MethodDesc::EnsurePortableEntryPointIsCallableFromR2R(funcPtr);
#endif // FEATURE_PORTABLE_ENTRYPOINTS
}

END_QCALL;
Expand Down
7 changes: 2 additions & 5 deletions 7 src/coreclr/vm/methodtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3571,11 +3571,8 @@ BOOL MethodTable::RunClassInitEx(OBJECTREF *pThrowable)
MethodTable* instantiatingArg = pCanonMT->IsSharedByGenericInstantiations() ? this : nullptr;

#ifdef FEATURE_PORTABLE_ENTRYPOINTS
// On portable-entrypoint (wasm) targets, CallClassConstructor invokes the cctor via a
// typed call_indirect, so the slot's portable entry point must resolve to real code
// (native R2R code or a correctly-typed interpreter thunk) rather than the temporary
// precode. The normal R2R method-entry fixups perform this for direct calls, but the
// cctor slot is fetched directly here and so must be made callable explicitly.
// CallClassConstructor invokes the cctor via the function pointer, so its portable entrypoint
// must resolve to real code if possible.
Comment thread
lewing marked this conversation as resolved.
MethodDesc::EnsurePortableEntryPointIsCallableFromR2R(pCctorCode);
#endif // FEATURE_PORTABLE_ENTRYPOINTS

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.