Skip to content

Revert "Implement register-based closure ctx"#1614

Merged
xushiwei merged 1 commit intomainfrom
revert-1599-closure-ctxreg-v2
Feb 5, 2026
Merged

Revert "Implement register-based closure ctx"#1614
xushiwei merged 1 commit intomainfrom
revert-1599-closure-ctxreg-v2

Conversation

@xushiwei
Copy link
Member

@xushiwei xushiwei commented Feb 5, 2026

Reverts #1599

@gemini-code-assist
Copy link

Note

The number of changes in this pull request is too large for Gemini Code Assist to generate a summary.

@xgopilot
Copy link
Contributor

xgopilot bot commented Feb 5, 2026

Code Review Summary

This revert of PR #1599 is clean and complete. The PR properly removes the register-based closure context passing and returns to the parameter-based approach. The documentation in doc/closure.md is accurate and well-written, clearly describing the explicit __llgo_ctx parameter convention.

No critical issues found. The code quality is good, and the changes are consistent throughout.

Minor Suggestions

Two potential improvements in the newly added runtime functions:

  1. structequal - Consider adding a check to skip blank-named fields (_) for consistency with Go runtime semantics.

  2. arrayequal - A pointer equality early-exit (if p == q { return true }) could optimize the self-comparison case.

These are minor optimizations and don't block the revert.

return true
}

func arrayequal(t, p, q unsafe.Pointer) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a pointer equality fast path for the common case where the same array is compared to itself:

Suggested change
func arrayequal(t, p, q unsafe.Pointer) bool {
func arrayequal(t, p, q unsafe.Pointer) bool {
if p == q {
return true
}
x := (*arraytype)(t)

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.06%. Comparing base (d3861ee) to head (1febf44).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1614      +/-   ##
==========================================
+ Coverage   90.51%   91.06%   +0.55%     
==========================================
  Files          48       45       -3     
  Lines       12077    11938     -139     
==========================================
- Hits        10931    10871      -60     
+ Misses        956      892      -64     
+ Partials      190      175      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xushiwei xushiwei merged commit 556d4e9 into main Feb 5, 2026
72 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