Commit c91284ee authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Avoid overallocation of far jump table

On platforms that do not require the far jump table for wasm calls (32
bit platforms currently), we do not need to include a far jump table
slot per wasm function. Other places already used the
{NumWasmFunctionsInFarJumpTable} helper function, but in the actual
allocation of the far jump table, it was missing.

R=jkummerow@chromium.org

Change-Id: I30734a1a25cc80e38c47abfd39059d56c9e5de57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1910101Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64911}
parent 14314ab3
...@@ -1254,7 +1254,8 @@ void NativeModule::AddCodeSpace( ...@@ -1254,7 +1254,8 @@ void NativeModule::AddCodeSpace(
int num_function_slots = NumWasmFunctionsInFarJumpTable(num_wasm_functions); int num_function_slots = NumWasmFunctionsInFarJumpTable(num_wasm_functions);
far_jump_table = CreateEmptyJumpTableInRegion( far_jump_table = CreateEmptyJumpTableInRegion(
JumpTableAssembler::SizeForNumberOfFarJumpSlots( JumpTableAssembler::SizeForNumberOfFarJumpSlots(
WasmCode::kRuntimeStubCount, num_function_slots), WasmCode::kRuntimeStubCount,
NumWasmFunctionsInFarJumpTable(num_function_slots)),
region, allocator_lock); region, allocator_lock);
CHECK(region.contains(far_jump_table->instruction_start())); CHECK(region.contains(far_jump_table->instruction_start()));
EmbeddedData embedded_data = EmbeddedData::FromBlob(); EmbeddedData embedded_data = EmbeddedData::FromBlob();
......
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