Repository navigation
Conversation
Clear callee-save scratch and trailing alignment words when creating a 64-bit VM entry record, preventing stale pointers from becoming conservative GC roots. Cover generic and fixed-arity entry with native poison, nested-record, and unwind checks.
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25. Or wait 47 minutes for your next included review. View limit details
Comment |
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.
What does this PR do?
An otherwise dead JavaScript value can remain alive when a fresh VM-entry frame reuses native stack bytes containing its address. LLInt writes the entry record's header but leaves its callee-save scratch and trailing alignment storage untouched; conservative stack scanning can treat those stale words as roots.
Clear that storage when creating the 64-bit generic and fixed-arity entry records. The address lookup helper stays side-effect free, and later unwind/OSR writers retain ownership of active records. The native regression poisons the future record immediately before calling the real entry stub and captures its contents at the callee's first instruction. It covers all seven fixed arities, generic JavaScript and native entry, header preservation, pure lookup, nested/outer-record preservation and an ordinary JavaScript exception.
Ported from the entry-record portion of openclaw/WebKit#24 and #26. Related #694 covers deferred
VMEntryScopeoptional storage, a separate retaining owner; this PR makes no change to that representation. The same entry allocation is present in canonical WebKit's JavaScriptCore.How did you verify your code works?
Built the same native regression on upstream main at
5d2ceba2921d29312827883b1fafa5c7cd5cba7e, then rebuilt with only the two LLInt assembly files changed. The Linux x86-64 build used LLVM 23.1.2, Release (-O2 -g1), static JSC, Bun additions/event loop, FTL and external mimalloc.The control and candidate each ran once; a completed failing test was not retried.
check-webkit-stylereports zero errors in the five changed files, andgit diff --checkpasses.The standalone
testVMEntryRecordtarget uses Linux x86-64 SysV assembly and the native LLInt. Runtime coverage of other architectures is not claimed. Historical downstream catalog rates involved both entry-record and deferred-scope changes and are not used as proof for this isolated change.