Commit 4557c3f4 authored by 王澳's avatar 王澳 Committed by V8 LUCI CQ

Revert "[call reducer] inline Array.prototype.indexOf/includes in js-call-reducer."

This reverts commit 9f9f36f8.

Reason for revert: regressed ai-astar on the M1

Original change's description:
> [call reducer] inline Array.prototype.indexOf/includes in js-call-reducer.
>
> - inline Array.prototype.indexOf in js-call-reducer
> - inline Array.prototype.includes in js-call-reducer
>
> Bug: v8:12390
> Change-Id: Idb5669da3019f0f56af0084fccd1d616d4c5098e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3473994
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79461}

Bug: v8:12390, chromium:1306250
Change-Id: I91c666c2f56c30db4f43bb009ee6206ad219f51a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532399
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79511}
parent a0204ff9
This diff is collapsed.
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(() => {
function make_includes() {
return new Function('result = array.includes(target)');
}
createSuite('SmiIncludes', 1000, make_includes(), SmiIncludesSetup);
createSuite('SparseSmiIncludes', 1000, make_includes(), SparseSmiIncludesSetup);
createSuite('DoubleIncludes', 1000, make_includes(), SmiIncludesSetup);
createSuite('SparseDoubleIncludes', 1000, make_includes(), SparseSmiIncludesSetup);
createSuite('ObjectIncludes', 1000, make_includes(), SmiIncludesSetup);
createSuite('SparseObjectIncludes', 1000, make_includes(), SparseSmiIncludesSetup);
createSuite('StringIncludes', 1000, make_includes(), StringIncludesSetup);
createSuite('SparseStringIncludes', 1000, make_includes(), SparseStringIncludesSetup);
function SmiIncludesSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = i;
target = array[array_size-1];
}
function SparseSmiIncludesSetup() {
SmiIncludesSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function StringIncludesSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = `Item no. ${i}`;
target = array[array_size-1];
}
function SparseStringIncludesSetup() {
StringIncludesSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function DoubleIncludesSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = i;
target = array[array_size-1];
}
function SparseDoubleIncludesSetup() {
DoubleIncludesSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function ObjectIncludesSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = {i};
target = array[array_size-1];
}
function SparseObjectIncludesSetup() {
ObjectIncludesSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
})();
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(() => {
function make_indexOf() {
return new Function('result = array.indexOf(target)');
}
createSuite('SmiIndexOf', 1000, make_indexOf(), SmiIndexOfSetup);
createSuite('SparseSmiIndexOf', 1000, make_indexOf(), SparseSmiIndexOfSetup);
createSuite('DoubleIndexOf', 1000, make_indexOf(), SmiIndexOfSetup);
createSuite('SparseDoubleIndexOf', 1000, make_indexOf(), SparseSmiIndexOfSetup);
createSuite('ObjectIndexOf', 1000, make_indexOf(), SmiIndexOfSetup);
createSuite('SparseObjectIndexOf', 1000, make_indexOf(), SparseSmiIndexOfSetup);
createSuite('StringIndexOf', 1000, make_indexOf(), StringIndexOfSetup);
createSuite('SparseStringIndexOf', 1000, make_indexOf(), SparseStringIndexOfSetup);
function SmiIndexOfSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = i;
target = array[array_size-1];
}
function SparseSmiIndexOfSetup() {
SmiIndexOfSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function StringIndexOfSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = `Item no. ${i}`;
target = array[array_size-1];
}
function SparseStringIndexOfSetup() {
StringIndexOfSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function DoubleIndexOfSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = i;
target = array[array_size-1];
}
function SparseDoubleIndexOfSetup() {
DoubleIndexOfSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
function ObjectIndexOfSetup() {
array = new Array();
for (let i = 0; i < array_size; ++i) array[i] = {i};
target = array[array_size-1];
}
function SparseObjectIndexOfSetup() {
ObjectIndexOfSetup();
array.length = array.length * 2;
target = array[array_size-1];
}
})();
...@@ -10,7 +10,6 @@ let array; ...@@ -10,7 +10,6 @@ let array;
let func = 0; let func = 0;
let this_arg; let this_arg;
let result; let result;
let target;
const array_size = 100; const array_size = 100;
const max_index = array_size - 1; const max_index = array_size - 1;
// Matches what {FastSetup} below produces. // Matches what {FastSetup} below produces.
...@@ -142,8 +141,6 @@ d8.file.execute('join.js'); ...@@ -142,8 +141,6 @@ d8.file.execute('join.js');
d8.file.execute('to-string.js'); d8.file.execute('to-string.js');
d8.file.execute('slice.js'); d8.file.execute('slice.js');
d8.file.execute('copy-within.js'); d8.file.execute('copy-within.js');
d8.file.execute('index-of.js')
d8.file.execute('includes.js')
var success = true; var success = true;
......
...@@ -60,8 +60,7 @@ ...@@ -60,8 +60,7 @@
"resources": [ "resources": [
"filter.js", "map.js", "every.js", "join.js", "some.js", "reduce.js", "filter.js", "map.js", "every.js", "join.js", "some.js", "reduce.js",
"reduce-right.js", "to-string.js", "find.js", "find-index.js", "reduce-right.js", "to-string.js", "find.js", "find-index.js",
"from.js", "of.js", "for-each.js", "slice.js", "copy-within.js", "from.js", "of.js", "for-each.js", "slice.js", "copy-within.js"
"index-of.js", "includes.js"
], ],
"flags": [ "flags": [
"--allow-natives-syntax" "--allow-natives-syntax"
...@@ -182,23 +181,7 @@ ...@@ -182,23 +181,7 @@
{"name": "SmiCopyWithin"}, {"name": "SmiCopyWithin"},
{"name": "StringCopyWithin"}, {"name": "StringCopyWithin"},
{"name": "SparseSmiCopyWithin"}, {"name": "SparseSmiCopyWithin"},
{"name": "SparseStringCopyWithin"}, {"name": "SparseStringCopyWithin"}
{"name": "SmiIndexOf"},
{"name": "SparseSmiIndexOf"},
{"name": "DoubleIndexOf"},
{"name": "SparseDoubleIndexOf"},
{"name": "ObjectIndexOf"},
{"name": "SparseObjectIndexOf"},
{"name": "StringIndexOf"},
{"name": "SparseStringIncludes"},
{"name": "SmiIncludes"},
{"name": "SparseSmiIncludes"},
{"name": "DoubleIncludes"},
{"name": "SparseDoubleIncludes"},
{"name": "ObjectIncludes"},
{"name": "SparseObjectIncludes"},
{"name": "StringIncludes"},
{"name": "SparseStringIncludes"}
] ]
} }
] ]
......
This diff is collapsed.
This diff is collapsed.
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