refactor: three more backlog consolidations (streams, ++/-- arms, CallV2 routing)#1269
Merged
Conversation
…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.
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.
Continues the audit backlog after #1268. Three consolidations, one commit each:
WritableCorebut left theGetMemberlayer duplicated.WritableCore.GetWritableMembernow serves the write/end/cork/uncork methods and all sevenwritable*property arms (high-water-mark/object-mode via the live accessors each owner already supplies); the classes keep only their genuinely-different arms (Writable'sdestroy/destroyed/setDefaultEncoding; Duplex's both-sides destroy, withdestroyedstill falling through to the Readable base).++/--property/index arms — the four near-identical read→unbox→±1→box→store copies inILEmitter.Operators.cscollapsed intoEmitIncrementProperty/EmitIncrementIndexwith anisPrefixseam. 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.).Callsweep — the 34 remaining\.Call(this, …)sites inInterpreter.Properties.cs(accessor getters/setters, class calls, method dispatch) now route throughCallableInterop.CallBoxed, the sanctioned CallV2 bridge — migrated implementors run boxing-free on these paths; unmigrated ones hit the default bridge, unchanged.Verification
.Callsweep, which touches property reads broadly)