[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/+/1605357 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Reviewed-by: Martyn Capewell <martyn.capewell@arm.com> Commit-Queue: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#61954}
This commit is contained in:
parent
48483df07d
commit
777bed9697
@ -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() &&
|
||||
|
Loading…
Reference in New Issue
Block a user