Commit 57ac80c7 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Account for the lazy compilation jump table

If dynamic tiering or lazy compilation is enabled (which is the
default), the initial code space needs to be big enough to also hold the
lazy compilation jump table.
Otherwise a CHECK will fail later when trying to allocate that table (in
UseLazyStub).

R=ahaas@chromium.org

Bug: chromium:1348472, chromium:1348214
Change-Id: If7a091a5782f1b2099d35d1a06292dddbaeb0598
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3793389
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82067}
parent 5c261ebc
......@@ -609,6 +609,13 @@ size_t OverheadPerCodeSpace(uint32_t num_declared_functions) {
size_t ReservationSize(size_t code_size_estimate, int num_declared_functions,
size_t total_reserved) {
size_t overhead = OverheadPerCodeSpace(num_declared_functions);
// If this is the first code space, we also need space for the lazy
// compilation jump table (except if both dynamic tiering and lazy compilation
// are disabled via flags, which we chose to ignore here).
if (total_reserved == 0) {
overhead += JumpTableAssembler::SizeForNumberOfLazyFunctions(
num_declared_functions);
}
// Reserve the maximum of
// a) needed size + overhead (this is the minimum needed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment