v8/test
Seth Brenith 2507217839 Improve Script reuse in isolate compilation cache, part 1
Once the root SharedFunctionInfo for any Script gets its bytecode
flushed, the Isolate's compilation cache currently evicts that entry, to
reduce memory usage. However, the associated Script is likely still
alive, since scripts often declare functions which outlive the initial
evaluation of the script. If an identical script is loaded later, a
duplicate Script is created for it, which can waste memory.

In this change, I propose that the compilation cache keys can refer
weakly to the Script. When the root SharedFunctionInfo gets old, instead
of deleting the cache entry entirely, we can just drop the strong
reference to the SharedFunctionInfo. A subsequent lookup in the cache
will retrieve the Script instead of the root SharedFunctionInfo,
indicating an opportunity to save some memory by reusing the existing
Script.

Eventually, all callers to CompilationCache::LookupScript should reuse
the Script if possible. This change implements only the easy case of
reusing the Script for synchronous parsing. Follow-up changes will be
required for the TODO comments left by this change.

Bug: v8:12808
Change-Id: Ia8b0389441a682de9a43e73329049fd2e7835d3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3597106
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80472}
2022-05-11 14:27:43 +00:00
..
benchmarks [flags] Rename --opt to --turbofan 2022-05-03 12:10:30 +00:00
bigint [bigint][test] Better random input generation 2021-09-08 15:39:27 +00:00
cctest Improve Script reuse in isolate compilation cache, part 1 2022-05-11 14:27:43 +00:00
common [wasm-simd] Update new relaxed SIMD opcodes 2022-05-09 22:47:24 +00:00
debugger [flags] Rename --opt to --turbofan 2022-05-03 12:10:30 +00:00
debugging [d8][mjsunit][tools] Improve d8 file API 2021-06-01 13:37:57 +00:00
fuzzer [liftoff] Move more options into LiftoffOptions 2022-04-19 16:21:21 +00:00
fuzzilli Fix unhandled promise rejections in REPRL mode 2020-09-30 13:34:23 +00:00
inspector Distinguish untrusted clients in v8 inspector and disable Profiler, HeapProfiler and Schema CDP domains for them. 2022-05-03 12:38:17 +00:00
intl [flags] Rename --opt to --turbofan 2022-05-03 12:10:30 +00:00
js-perf-test [js-perf-test] add microbenchmarks for (Object|Reflect).getOwnPropertyDescriptor 2022-05-05 14:15:55 +00:00
memory [snapshot] Fix the Memory.json benchmark 2021-04-28 07:54:34 +00:00
message [error] Improve error message for array spread 2022-04-15 01:23:54 +00:00
mjsunit [wasm-gc] Experiment: ref.cast_nop_static 2022-05-11 13:19:12 +00:00
mkgrokdump [py3] Bump v8heapconstants.py and related files 2022-04-04 13:27:13 +00:00
mozilla [test] Clean up Py2 code 2022-03-17 09:12:36 +00:00
test262 [Temporal] Sync w/ PR2028 2022-05-09 23:09:34 +00:00
torque Reland "Reland "[Torque] Generalize Torque literals to larger size"" 2022-02-04 09:40:24 +00:00
unittests [wasm-simd] Update new relaxed SIMD opcodes 2022-05-09 22:47:24 +00:00
wasm-api-tests [test] Clean up Py2 code 2022-03-17 09:12:36 +00:00
wasm-js [wasm] Disable limits test on Android 2022-04-28 12:53:38 +00:00
wasm-spec-tests [wasm] Remove SIMD proposal tests 2022-04-28 05:22:59 +00:00
webkit [test] Disable failing MSVC test 2021-12-01 15:51:59 +00:00
BUILD.gn Reland^2 "[bigint] Karatsuba multiplication" 2021-06-07 11:01:14 +00:00
OWNERS Use relative paths to OWNERS files 2019-08-12 13:52:52 +00:00