Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ static MemberAccessor Initialize()
{
MemberAccessor value =
#if NET
// On platforms where dynamic code is supported but not compiled to native code
// (e.g. the Mono interpreter, WASM and iOS), the IL emitted by the Reflection.Emit
// based accessor is only interpreted, offering no throughput benefit over plain
// reflection while still pulling in the Reflection.Emit stack. Gating on
// IsDynamicCodeCompiled (rather than IsDynamicCodeSupported) keeps Reflection.Emit
// on JIT-backed runtimes but lets the trimmer remove it everywhere else.
RuntimeFeature.IsDynamicCodeCompiled ?
// if dynamic code isn't supported, fallback to reflection
Comment thread
eiriktsarpalis marked this conversation as resolved.
RuntimeFeature.IsDynamicCodeSupported ?
new ReflectionEmitCachingMemberAccessor() :
new ReflectionMemberAccessor();
#elif NETFRAMEWORK
Expand Down
Loading