Repository navigation
refactor(interp): share the heap payload read and the overwrite release - #199
Conversation
|
Warning Review limit reached
Next review available in: 21 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2232dc0 to
550ff75
Compare
errorGet and coroValue were the same 66 lines twice, differing only in which itab they guard and which payload word they read: the same guard sequence, the same four-way kind switch, the same exclusive-owner check on the ref case, the same three stack rewrites. They now call one payloadGet. The overwrite release appeared verbatim at five sites - localSet, globalSet, upvalSet, arraySet, structSet - as a five-line branch choosing between releaseBox and releaseBoxExcept. releaseOverwritten names the rule instead: the outgoing and incoming values may be the same address, and only an owned incoming value can alias that way, because a deferred one still borrows its own backing slot's retain. That is why the aliasing check is needed exactly when the incoming value is not deferred - a fact that was previously implicit in five copies of an unexplained condition. No behavior change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
daa922c to
08bb211
Compare
Stage 3 (first half) of the JIT lowering rework. Stacked on #198.
Net -60 lines in
interp/jit_arm64.go, no behavior change.errorGet/coroValue→payloadGetThese were the same 66 lines twice, differing only in which itab they guard and which payload word they read — same guard sequence, same four-way kind switch, same exclusive-owner check on the ref case, same three stack rewrites. Both are now one-line wrappers over
payloadGet.The merged version also documents why the exclusive-owner guard exists: it protects a release-triggered free, so a borrowed handle — which has no release to follow — skips it. That was a comment in one copy and absent from the other.
releaseOverwrittenThe overwrite release appeared verbatim at five sites —
localSet,globalSet,upvalSet,arraySet,structSet— as a five-line branch choosing betweenreleaseBoxandreleaseBoxExcepton an unexplained condition.The helper names the rule: the outgoing and incoming values may be the same address, and releasing first would free a value the store is about to publish — but only an owned incoming value can alias that way, because a deferred one still borrows its own backing slot's retain. So the aliasing check is needed exactly when the incoming value is not deferred. That invariant was previously implicit in five copies.
Still outstanding in this area
Not done here, and worth its own change: the
kind → (itab, base, scale, raw)element-shape mapping is still written out longhand in six places (arrayGet,arraySet,arrayLen,arrayGetKnown,hoistable,arrayKind), andarrayGet/arraySetplusstructGet/structSetstill each carry their own copy of the guard preamble.Test plan
go test -race ./...make lint,make check-generatedRefs #164
🤖 Generated with Claude Code