-
Seth Brenith authored
The GC already treats some embedded object pointers in Code as weak, based on Code::IsWeakObject. If one of those embedded objects ends up unmarked during a full mark-collect GC, then the Code is marked for lazy deoptimization and the embedded objects are cleared. However, many of those same objects are often held strongly by the deoptimization literal array for the Code, which causes memory leaks. This change updates the deoptimization literals array to store those objects weakly. Any Code currently executing on the stack might need those deoptimization literals in order to deoptimize, so the deoptimization literal array is marked strongly in that case. Design document: https://docs.google.com/document/d/1gFRBYCeqz9Mysx8CVYQkldBbk3AZLo8UX0DMLZV_7qw/edit?usp=sharing Bug: v8:4578 Change-Id: I02e86683c59371e9f88ecf523750c9c6afebdb39 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160299Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Cr-Commit-Position: refs/heads/main@{#77805}
6366f334