Skip to content

Two of the four caches cited as precedent no longer make the point - #3570

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:docs/methoddescriptor-precedent-list
Sep 1, 2026
Merged

Two of the four caches cited as precedent no longer make the point#3570
lahma merged 1 commit into
sebastienros:mainfrom
lahma:docs/methoddescriptor-precedent-list

Conversation

@lahma

@lahma lahma commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

The comment above MethodDescriptor's shared invoker tables justifies pinning a MethodBase for the life of the process by naming four caches that already do it. Two of the four no longer say what it needs.

TypeReference._memberAccessors does not exist. TypeReference's only static is its JsString name; its static members go through TypeResolver.GetStaticAccessor, whose StaticAccessorCacheKey carries the InteropResolutionProfile and which passes the same IsShareable / IsConverterNeutral gates as the instance lane. A reader following the citation finds nothing at all.

JintBinaryExpression._knownOperators is still there but is now the wrong example. Since #3526 it is the process-wide half of a pair: an engine with its own ClrTypeConverter gets a table of its own, precisely so that a process-lived static does not pin that converter and whatever engine it captured. Citing it as precedent for "pin it for the process" points at the case that decided not to.

Replaced with two that hold today and are the same shape as the tables being justified — CompiledMemberAccessor's four MemberInfo-keyed delegate tables, and ReflectionExtensions._operatorOverloadMethodCache, a Type-keyed method list which is the pure-metadata part _knownOperators sits on top of.

Comment-only; no code change. dotnet build -c Release Jint/Jint.csproj clean, 0 warnings.

Found while auditing process-wide caches for #3426. The same dead name was in Jint/Runtime/Interpreter/AGENTS.md; #3522/#3563 already rewrote that paragraph, and this comment is the last place it survived.

🤖 Generated with Claude Code

https://claude.ai/code/session_014W5mbjGhyvgAS4pivXoc4S

…no longer fits

The comment above `MethodDescriptor`'s shared invoker tables justifies pinning a `MethodBase` for the life
of the process by naming four caches that already do it. Two of the four no longer say what it needs.

`TypeReference._memberAccessors` does not exist and has not for some time — `TypeReference`'s only static is
its `JsString` name, and its static members go through `TypeResolver.GetStaticAccessor`, whose
`StaticAccessorCacheKey` carries the `InteropResolutionProfile` and passes the same `IsShareable` /
`IsConverterNeutral` gates as the instance lane. A reader following the citation finds nothing.

`JintBinaryExpression._knownOperators` is still there but is now the wrong example: since sebastienros#3526 it is the
process-wide half of a pair, and an engine with its own `ClrTypeConverter` gets a table of its own precisely
so that a process-lived static does not pin that converter and whatever engine it captured. Citing it as
precedent for "pin it for the process" points at the case that decided not to.

Replaced with two that hold today and are the same shape as the tables being justified —
`CompiledMemberAccessor`'s four `MemberInfo`-keyed delegate tables, and
`ReflectionExtensions._operatorOverloadMethodCache`, a `Type`-keyed method list that is the pure-metadata
part `_knownOperators` sits on top of.

Comment-only; no code change.

Found while auditing process-wide caches for sebastienros#3426.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014W5mbjGhyvgAS4pivXoc4S
@lahma
lahma merged commit a0292fd into sebastienros:main Sep 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant