Skip to content

Docs: the interpreter file describes a TypeReference member cache that no longer exists - #3440

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:docs/agents-typereference-static-cache
Aug 27, 2026
Merged

lahma merged 1 commit into
sebastienros:mainfrom
lahma:docs/agents-typereference-static-cache

Conversation

@lahma

@lahma lahma commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Jint/Runtime/Interpreter/AGENTS.md tells anyone touching a shared interop cache that TypeReference keeps a process-wide static member cache "on a weaker key — just (Type, member name), with no requirement or profile — so it is shared even between engines whose interop configuration differs".

That described TypeReference._memberAccessors, which #3052 removed. Static-member resolution now goes through TypeResolver.GetStaticAccessor, whose key is StaticAccessorCacheKey(Type, member name, InteropResolutionProfile) and which runs the same IsShareable / IsConverterNeutral exclusions as the instance lane.

The one real opt-out left is an enum reference, which resolves per instance because the engine's EnumConversion mode decides whether a constant is a JsString or a JsNumber and the key cannot express it. TypeReference.CreatePropertyDescriptor says so in a comment; the instruction file did not.

Found while auditing every process-wide cache for #3426. The paragraph as written makes an agent record a defect that is not there, and miss the exception that is — which is exactly what it cost during that audit.

Docs only. AgentInstructionFileTests green (the file gets shorter).

🤖 Generated with Claude Code

https://claude.ai/code/session_014W5mbjGhyvgAS4pivXoc4S

…t no longer exists

`Jint/Runtime/Interpreter/AGENTS.md` told anyone touching a shared interop cache that
`TypeReference` keeps a process-wide static member cache "on a *weaker* key -- just
`(Type, member name)`, with no requirement or profile -- so it is shared even between
engines whose interop configuration differs".

That described `TypeReference._memberAccessors`, which sebastienros#3052 removed. Static-member
resolution now goes through `TypeResolver.GetStaticAccessor`, whose key is
`StaticAccessorCacheKey(Type, member name, InteropResolutionProfile)` and which runs the
same `IsShareable` / `IsConverterNeutral` exclusions as the instance lane. The one real
opt-out left is an enum reference, which resolves per instance because `EnumConversion`
decides whether a constant is a `JsString` or a `JsNumber` and the key cannot express it --
which the code says in a comment and the instruction file did not.

Found while auditing every process-wide cache for sebastienros#3426: the paragraph as written makes an
agent record a defect that is not there, and miss the enum exception that is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014W5mbjGhyvgAS4pivXoc4S
@lahma
lahma merged commit 23632a2 into sebastienros:main Aug 27, 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