Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(exo): shorten exo-call fastpath #2247

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

erights
Copy link
Contributor

@erights erights commented Apr 28, 2024

closes: #XXXX
refs: #XXXX

Description

Should be a pure refactor without any[1] observable differences. Shorten the exo-call fastpath for the normal thisful case

  • primarily to make stepping into an exo method more pleasant with fewer clicks and visual context switches
  • probably also has a performance advantage for the normal thisful case.

By "thisful", I mean the exo objects defined with the normal exo-making, exo-class-making, and exo-class-kit-making APIs, whether directly or via zones. The non-thisful case is only the deprecated virtual and durable kinds, which are not yet gone and so must still be supported. But have only the non-thisful case pay for the arg shifting, rather than making all calls pay for that.

The previous debug experience involved two layers of wrapping function to get from the external call to a method of an exo into the exo's own behavior method. This PR reduces that to one level of wrapper. The effectively step into from the call into the actual behavior method before and after this PR

  • "step into" (new page) "step over", "step into" (new page) "step over" "step over" "step into" (new page)
  • "step into" (new page) "step over" "step over" "step into" (new page)

There is also one less exo infrastructure frame on the call stack. In the debugger, the remaining stack frame is labeled

image

vs

image

Also less noise in verbose error stacks.

Security Considerations

none. The safety checks should be exactly the same.

Scaling Considerations

Probably has a performance advantage for the normal thisful case. But we won't know until we measure. We're putting this into review before measuring though, since the main motivation is the better debugging experience.

Documentation Considerations

none

Testing Considerations

[1] The refactoring did result in an error message changing, requiring a corresponding change in a golden error message test.

The tests in endo only test the normal thisful case. We depend on integration testing with agoric-sdk to test the non-thisful case.

Compatibility Considerations

none, given that the integration test with agoric-sdk confirms we did not break the non-thisful case.

Upgrade Considerations

none.

  • [ ] Includes *BREAKING*: in the commit message with migration instructions for any breaking change.
  • [ ] Updates NEWS.md for user-facing changes.

@erights
Copy link
Contributor Author

erights commented Apr 28, 2024

Integration test via pount-endo-branch at Agoric/agoric-sdk#9298

patch for debugging use until then Agoric/agoric-sdk#9297

@erights erights requested a review from kriskowal April 28, 2024 02:57
@erights
Copy link
Contributor Author

erights commented Apr 28, 2024

Both agoric-sdk integration test PRs are green.

@erights erights force-pushed the markm-friendlier-debugger-stepping branch from 06e3571 to 1a2c0bf Compare April 29, 2024 20:25
packages/exo/src/exo-tools.js Show resolved Hide resolved
@erights erights force-pushed the markm-friendlier-debugger-stepping branch from 1a2c0bf to 0a1ce76 Compare April 29, 2024 20:43
@erights erights enabled auto-merge (squash) April 29, 2024 20:45
@erights erights merged commit f48d376 into master Apr 29, 2024
17 checks passed
@erights erights deleted the markm-friendlier-debugger-stepping branch April 29, 2024 20:51
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.

2 participants