[stack-traces] Don't hold on to code objects from StackFrameInfos.
Previously every `StackFrameInfo` instance would maintain a reference to an AbstractCode object, which was used to resolve the `code_offset` on that stack frame. However, it turns out that nowadays this is not necessary anymore, since all `code_offset`s reported for JavaScript frames are already bytecode offsets and thus can be resolved by just looking at the functions' bytecode. For WebAssembly frames we will also eagerly resolve the `code_offset` (which is different depending on whether we're looking at Liftoff or TurboFan code) to the byte offset (relative to the function start) and stash that away in the `StackFrameInfo`. For builtin exit frames, the `abstract_code` on the function always refers to the builtin code object and thus, there's no point in keeping an extra pointer to it around on the `StackFrameInfo`. This way the `StackFrameInfo` representation is somewhat uniform, and more importantly, the `StackFrameInfo` instances will no longer need to hold to concrete code objects. Drive-by-fix: Use `FixedArray::SetAndGrow()` when adding to the elements in the `StackTraceBuilder`. Also-By: szuend@chromium.org, jarin@chromium.org Bug: chromium:1258599, chromium:1077657, v8:8742, chromium:1069425 Change-Id: I650e400e0e1acd920281669bdc7b5e1199683ae8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3323073Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/main@{#78320}
Showing
Please
register
or
sign in
to comment