Repository navigation
Conversation
Contributor
Contributor
|
To be precise: the fix we want lambda-lifts every JS continuation to a top-level function, as the C lane's seg_clo does. Lifting every 33rd one works, but the period is a magic number, not a cause. |
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.
Closes #1086.
A single long
doemitted hundreds of nestedrun_cloarrows; Node 22 raisesRangeError: Maximum call stack size exceededwhile loading a 400-step program, and Bun also hits its parser stack. The JS compiler now lifts every 33rd nested continuation into a top-level function and explicitly passes its captured local values. Ordinary shallow closures keep their existing shape. Hoisted function bodies undergo the same non-tail-call/trampoline substitution as other emitted functions.tests/io/do_long_js.bendhas 400 sequential effects, carries a string across them and calls a pure def in the final effect; expected output is[value]. Interpreted checkup, emitted Node, emitted Bun and native C complete. A separate 1000-step program also completes on Node, and a longmatchbranch retaining a constructor field completes.bun gates/repo.ts: PASS 46/46. Cluster gate and macOS not run.