Skip to content

refactor: three more backlog consolidations (streams, ++/-- arms, CallV2 routing)#1269

Merged
nickna merged 3 commits into
mainfrom
worktree-backlog-dedups-2
Jul 11, 2026
Merged

refactor: three more backlog consolidations (streams, ++/-- arms, CallV2 routing)#1269
nickna merged 3 commits into
mainfrom
worktree-backlog-dedups-2

Conversation

@nickna

@nickna nickna commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Continues the audit backlog after #1268. Three consolidations, one commit each:

  • Writable/Duplex member dispatchEpic: De-duplicate interpreter runtime value-type wrappers #1093/Extract a WritableCore shared by SharpTSWritable and SharpTSDuplex #1138 centralized the writable behavior into WritableCore but left the GetMember layer duplicated. WritableCore.GetWritableMember now serves the write/end/cork/uncork methods and all seven writable* property arms (high-water-mark/object-mode via the live accessors each owner already supplies); the classes keep only their genuinely-different arms (Writable's destroy/destroyed/setDefaultEncoding; Duplex's both-sides destroy, with destroyed still falling through to the Readable base).
  • ++/-- property/index arms — the four near-identical read→unbox→±1→box→store copies in ILEmitter.Operators.cs collapsed into EmitIncrementProperty/EmitIncrementIndex with an isPrefix seam. Local declaration order and box points preserved → IL unchanged. (The variable-target case was already unified in Extract a ResolveVariableStorage helper (the 8-rung ladder + increment god-methods) #1127; the static-field fast paths stay.)
  • Legacy .Call sweep — the 34 remaining \.Call(this, …) sites in Interpreter.Properties.cs (accessor getters/setters, class calls, method dispatch) now route through CallableInterop.CallBoxed, the sanctioned CallV2 bridge — migrated implementors run boxing-free on these paths; unmigrated ones hit the default bridge, unchanged.

Verification

  • Full unit suite: 15,452/15,452 pass
  • Test262 interpreter baseline diff clean (relevant to the .Call sweep, which touches property reads broadly)
  • Per-item slices ran green before each commit: streams 320, operators 397, property/accessor/class 1,506

nickna added 3 commits July 10, 2026 20:16
…eCore

Epic #1093/#1138 centralized the writable behavior but left the
GetMember layer duplicated: SharpTSWritable and SharpTSDuplex both
carried the write/end/cork/uncork arms, four identical wrapper methods,
and the seven writable* property arms. WritableCore.GetWritableMember
now serves all of them (high-water-mark/object-mode via the live
accessors each owner already supplies at construction); the classes
keep only their genuinely-different arms — Writable's destroy/destroyed/
setDefaultEncoding, Duplex's both-sides destroy (destroyed still falls
through to the Readable base). 320 stream tests pass.
…arms

EmitPrefixIncrement and EmitPostfixIncrement each carried a property arm
and an index arm emitting the same read→unbox→±1→box→store sequence —
four near-identical copies differing only in the postfix old-value stash
and which value reloads as the result. Now EmitIncrementProperty /
EmitIncrementIndex gate that seam on isPrefix; local declaration order
(postfix: old before new) and box points are preserved, so the IL is
unchanged. The variable-target case was already unified (#1127); the
TryResolveStaticThisField / TryEmitStaticFieldIncrement fast paths stay
as-is. 397 operator tests pass.
…erties.cs through CallBoxed

Accessor getter/setter invocations, class/function-expression calls, and
method dispatch in the property layer still invoked the legacy boxed
ISharpTSCallable.Call directly. CallableInterop.CallBoxed is the
sanctioned bridge: it dispatches through CallV2, so migrated
implementors now run boxing-free on these paths while unmigrated ones
fall back to Call via the default bridge, unchanged. 1,506 property/
accessor/class tests pass.
@nickna
nickna merged commit a5a0205 into main Jul 11, 2026
2 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