Commit 777bed96 authored by Jun Lim's avatar Jun Lim Committed by Commit Bot

[arm64] Set min jumpable size to 4 for Switch

This CL avoid lowering Switch to jumptable if the case count is small enough(4).

Change-Id: Ida632807558c7403171e803947e7484908e0e028
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605357Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarMartyn Capewell <martyn.capewell@arm.com>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61954}
parent 48483df0
......@@ -2451,7 +2451,7 @@ void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
size_t table_time_cost = 3;
size_t lookup_space_cost = 3 + 2 * sw.case_count();
size_t lookup_time_cost = sw.case_count();
if (sw.case_count() > 0 &&
if (sw.case_count() > 4 &&
table_space_cost + 3 * table_time_cost <=
lookup_space_cost + 3 * lookup_time_cost &&
sw.min_value() > std::numeric_limits<int32_t>::min() &&
......
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