Repository navigation
AOT: large programs that run in several realms, and smaller runtime fixes - #1066
Jarred-Sumner wants to merge 15 commits into
Conversation
…ixes Changes needed by Bun's experimental desktop programs. Compiler - Visit each container once when exported built-ins escape; the walk was quadratic. - Order files record the regular expressions a run compiles, which then get native code. - New opt-in assumptions: separate-realms, locked-builtins, complete-order. Work in progress. Run time - relaxTimingOfModuleLoads(): link and run a graph that is all in the image without the loader. - Remember the last extra key found, instead of walking the table for each new field. - Clear per-collection caches without reading untouched pages. - Read methods of String.prototype directly where realms share property caches. JavaScriptCore - drainMicrotasks() no longer spins while only suspended tasks are queued. - Set operations on character classes work on ranges instead of code points. - Build the lists of available locales with fewer calls into ICU.
|
Preview build of 192a25b: |
…ions - HeapCompaction: after a full collection, move cells out of sparse blocks. Off unless the embedder asks. - separate-realms keeps the realm check for inlined foreign code and for files outside the project. - locked-builtins respects spelled writes, unseen code and the debugger. - complete-order is ignored unless the order file lists a regular expression. - Patterns built at run time are only recorded on request; targets of import() and require() are recorded.
|
The guard is written but not pushed: the branch conflicts with
Generated by Claude Code |
It was off by default and is not ready: it can hang without helper markers, pauses for seconds on arrays with many equal references, and can miss references.
With relaxed timing of module loads, imported CommonJS files keep running in the order of their requests: filesInOrderOfSynchronousLoad() returns them as given.
main visits each container of the link flow once, so its version of AOTLinkFlow and AOTLinkReach replaces the one on this branch. Adds a test of set operations on wide ranges under the v flag.
|
Generated by Claude Code |
|
On the second attempt Generated by Claude Code |
…ArrayBuffer and ShadowRealm
… a budget for Yarr With more names than columns, the names that listed functions look up and the fields of what they allocate get the columns. Argument thunks are placed by the start rank of their first caller. Reads through the global proxy cache custom accessors of the global object, and pass an object that announces the names it makes up. Members of platform objects with named properties are cached. With several realms, the stub finds the methods of strings. An inline cache no longer takes a name as absent below an object that may make it up. A runtime flag hides callers of other realms from Function.prototype.caller. Yarr can limit how far a pattern expands and how many steps a match takes.
… dispatch records An embedder can publish the items of a list, with a clock that says how long they hold. Inline caches, the slow path and the stubs of compiled programs read them without asking the object. A DOMJIT signature can take any value, and a DOMJIT getter needs no code of its own. A function that can do anything is called directly only from its own realm. Sites of compiled programs answer reads of a custom getter from its cached value. TypedArray.prototype.set converts from left to right in a loop that can be vectorized. The table of built-ins has no dispatch record for a mode with one overload.
A host can mark an entry as optional. A build that the host says never comes by those entries is compiled as if the table did not have them: their names are not taken for names that a built-in answers, and nothing is kept on their account.
pauseIfNeeded never throws, but its ThrowScope simulated a throw when it ended. Interpreter::debug checks for one. The way through VM::throwException does not, so the code that threw failed the validation. No change without ENABLE(EXCEPTION_SCOPE_VERIFICATION).
|
Generated by Claude Code |
…skip size check] The UI library and `bun compile --desktop` support Windows. The DevTools protocol is served for pages and for the main process. WebGL 1 and 2 run on Linux. Pages in processes of their own have service workers, shared workers, WebGL and crash reports. Canvases on the CPU paint in batches on all cores. `--desktop --trim` keeps what markup alone can reach. Fixes in text layout, painting and context isolation. The pin of WebKit follows oven-sh/WebKit#1066.
…d; cheaper bind, join and rope resolution A realm without a module host runs in the interpreter and borrows the property tables of another realm's instance. Only own properties were filed there, so each inherited method, accessor and absent name took the slow path, and so did stores that add a property. They are filed now, by the interpreter and by the lender's compiled code. The lender keeps the records that drop them when a chain changes, so the tables are cleared when a borrower outlives its lender. The global proxy of such a realm is left out: the tables answer past the lookup of its host. What is filed does not depend on the realm that asks first: Array.prototype and the accessor of __proto__ are recognized in every realm. With several realms, a read by name that met an object with a static table that is not reified always called out. The stub now asks the hashed table whether the name is absent from there on. For strings the absence is filed under the structure of String.prototype. keepChainDependent() hashed the name of a record whose entry, the only owner of the name, could be gone. Compiled stores to a var or let of a script, and to properties of a global object that is somebody's prototype, called out each time. Their location is filed now. The global object visits the variables of its lexical environment, because such a store runs its barrier, and the locations are dropped when a var becomes read-only. A host whose put() has to see each store disables caching on the slot. bind() of a bound function no longer reads its name and length while the target has the Structure it was made with. join() counts a repeated string before it asks for its characters. Resolving a rope no longer takes the lock of the directory's bits, neither to see that the block is destructible nor to mark it: the thread has access to the heap, and the write is atomic. embedder-list.js counts calls of the slow path, so it runs without failing allocations of executable memory at random.
On x86-64 a type test in front of a nullish check loads through the value and leaves everything that is no cell to the fault handler. With four levels of page tables the address behind a boxed number is not canonical, and Linux reports the fault at 0. With five levels it can be canonical, and the fault comes with the address. The handler refused it, so the process died with SIGSEGV where it reports the failed check.
|
The three loops that One question about the helper. User instructions over an empty script (
With #1087 the last column is 0.46 million in each row. The third row is 15206c7 (+70/-6 in It takes ICU's answer for granted for 905 of the 906 IDs.
Which of the two do you want in these loops? If it is the memo, nothing changes. If it is the rule, I open that commit as a pull request on top of #1087. |
Changes needed by Bun's experimental desktop programs.
Compiler
Run time
JavaScriptCore
Draft. After the merge with
main,testaotand the stress, modules, es6 and complex collections (--quick) pass locally on a Linux x64 release build. For the latest commit,testaotand a subset of the stress and modules tests were run. Bun builds against it on Linux x64.Known gaps
complete-ordercan leave them without native code.Generated by Claude Code