Built-in shapes default-on via base class (opt-out); shape Temporal.Now#2556
Merged
Conversation
Make built-in shape storage the default for any [JsObject] host that derives from
BuiltinShapeObject — deriving from the base is now the opt-in, so a built-in adopts
shapes with a one-line base change and no attribute flag. UseShape = false is the
explicit opt-out; hosts that don't derive from BuiltinShapeObject keep the dictionary
path regardless.
- Generator auto-detects the base (walks the base-type chain) and uses the shape path
by default for derived hosts. The UseShape attribute property now defaults to true and
only means "opt this derived host back out" when set false.
- New diagnostic JINT022: a BuiltinShapeObject-derived host that declares an unsupported
member (accessor / intrinsic reference / thrower / instance-or-mutable property) fails
the build instead of silently dropping it.
- Math, JSON, Reflect, Atomics drop the now-redundant UseShape = true (auto-detected).
- Temporal.Now (9 functions + Symbol.toStringTag, no properties) adopts shapes by simply
deriving from BuiltinShapeObject — demonstrating the one-line adoption and adding a win.
Benchmarks (BuiltinShapeBenchmark, default job, vs main; EngineOnly control identical at
13.69 KB):
EngineInitMath / EngineInitBuiltins 15.51 / 20.20 KB == 15.51 / 20.20 KB (byte-identical;
the default change is neutral)
EngineInitTemporalNow 20.43 → 19.45 KB (−4.8%; time −5.6%)
Conformance: Math 662/662, JSON 502/502, Reflect 306/306, Atomics 779/779, Temporal.Now
138/138; full Test262 0 new failures (the annexB RegExp-*-escape-BMP and Atomics.waitAsync
tests are pre-existing timing flakes under concurrent load — they flake identically on
main and pass in isolation). Jint.Tests 3138/3076; Jint.Tests.PublicInterface 79/79;
Jint.Tests.SourceGenerators 30/30 (snapshots updated for the attribute default).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDS23QeSSNRkaUB2KL74U9
lahma
enabled auto-merge (squash)
June 29, 2026 18:37
This was referenced Jul 6, 2026
This was referenced Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make built-in shape storage the default for any
[JsObject]host that derives fromBuiltinShapeObject— deriving from the base is now the opt-in, so a built-in adopts shapes with a one-line base change and no attribute flag.UseShape = falseis the explicit opt-out; hosts that don't derive fromBuiltinShapeObjectkeep the dictionary path regardless.This was suggested on #2555: rather than an explicit
[JsObject(UseShape = true)], shapes are on by default and you opt out.What changed
BuiltinShapeObjectuses the shape path by default. TheUseShapeattribute property now defaults totrueand only means "opt this derived host back out" when setfalse.JINT022: aBuiltinShapeObject-derived host that declares an unsupported member (accessor / intrinsic reference / thrower / instance-or-mutable property) fails the build instead of silently dropping it.UseShape = true(auto-detected from the base).Temporal.Now(9 functions +Symbol.toStringTag, no properties) adopts shapes by simply deriving fromBuiltinShapeObject— demonstrating the one-line adoption and adding a win.Benchmarks (
BuiltinShapeBenchmark, default job, vs main)EngineOnlycontrol is identical (13.69 KB) on both.EngineInitMath/EngineInitBuiltinsEngineInitTemporalNowConformance & tests
annexB/RegExp-*-escape-BMPslow-eval timeout tests and theAtomics.waitAsyncno-spurious-wakeup test are pre-existing timing flakes under concurrent load — they flake identically onmainand pass in isolation).Jint.Tests3138/3076;Jint.Tests.PublicInterface79/79;Jint.Tests.SourceGenerators30/30 (snapshots updated for the attribute default value).🤖 Generated with Claude Code
https://claude.ai/code/session_01RDS23QeSSNRkaUB2KL74U9