-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(exo): shorten exo-call fastpath (#2247)
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](https://github.com/endojs/endo/assets/273868/18920693-a9dc-4c07-af29-1bbe8a77b8a7) vs ![image](https://github.com/endojs/endo/assets/273868/0cb7bbd3-51b3-4187-874c-68dff170f1fe) 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.~
- Loading branch information
Showing
2 changed files
with
111 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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