Commit b483cc12 authored by Hai Dang's avatar Hai Dang Committed by Commit Bot

Extend Array.from micro-benchmarks.

Bug: v8:7980
Change-Id: Ic4c72b02c196b296105a6ddf9c3af9fb699ef8c5
Reviewed-on: https://chromium-review.googlesource.com/c/1297327Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Hai Dang <dhai@google.com>
Cr-Commit-Position: refs/heads/master@{#56952}
parent d634f7a6
......@@ -4,6 +4,7 @@
(() => {
createSuite('MixedFrom', 1000, MixedFrom, MixedFromSetup);
createSuite('MixedNoMapFrom', 1000, MixedNoMapFrom, MixedNoMapFromSetup);
createSuite('SmiFrom', 1000, SmiFrom, SmiFromSetup);
createSuite('SmallSmiFrom', 1000, SmallSmiFrom, SmallSmiFromSetup);
createSuite('SmiNoMapFrom', 1000, SmiNoMapFrom, SmiNoMapFromSetup);
......@@ -12,6 +13,7 @@
createSuite(
'TransplantedFrom', 1000, TransplantedFrom, TransplantedFromSetup);
createSuite('DoubleFrom', 1000, DoubleFrom, DoubleFromSetup);
createSuite('DoubleNoMapFrom', 1000, DoubleNoMapFrom, DoubleNoMapFromSetup);
createSuite('StringFrom', 1000, StringFrom, StringFromSetup);
createSuite('StringNoMapFrom', 1000, StringNoMapFrom, StringNoMapFromSetup);
......@@ -92,6 +94,10 @@
result = Array.from(arg, func);
}
function DoubleNoMapFrom() {
result = Array.from(arg);
}
function StringFrom() {
result = Array.from(arg, func);
}
......@@ -104,6 +110,10 @@
result = Array.from(arg, func);
}
function MixedNoMapFrom() {
result = Array.from(arg);
}
function SmallSmiFromSetup() {
func = (v, i) => v + i;
arg = [1, 2, 3];
......@@ -136,6 +146,11 @@
arg = double_array;
}
function DoubleNoMapFromSetup() {
func = undefined;
arg = double_array;
}
function StringFromSetup() {
func = (v, i) => v + i;
arg = string_array;
......@@ -151,4 +166,8 @@
arg = mixed_array;
}
function MixedNoMapFromSetup() {
func = undefined;
arg = mixed_array;
}
})();
......@@ -891,9 +891,11 @@
{"name": "SmiNoIteratorFrom"},
{"name": "TransplantedFrom"},
{"name": "DoubleFrom"},
{"name": "DoubleNoMapFrom"},
{"name": "StringFrom"},
{"name": "StringNoMapFrom"},
{"name": "MixedFrom"},
{"name": "MixedNoMapFrom"},
{"name": "Array.slice(500)"},
{"name": "Array.slice(500,999)"},
{"name": "Array.slice(-500)"},
......
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