Skip to content

Commit 2c3add1

Browse files
DadaIsCrazyV8 LUCI CQ
authored andcommitted
[compiler] Fix broken control chain in ArrayIterator lowering
Fixed: chromium:1486342 Change-Id: Ie0f30d180c9545f073b161717226d37e68da3296 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4887041 Reviewed-by: Tobias Tebbi <[email protected]> Commit-Queue: Darius Mercadier <[email protected]> Auto-Submit: Darius Mercadier <[email protected]> Cr-Commit-Position: refs/heads/main@{#90164}
1 parent 1661bef commit 2c3add1

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

src/compiler/js-call-reducer.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6382,8 +6382,11 @@ Reduction JSCallReducer::ReduceArrayIterator(Node* node,
63826382
}
63836383
}
63846384

6385+
// JSCreateArrayIterator doesn't have control output, so we bypass the old
6386+
// JSCall node on the control chain.
6387+
ReplaceWithValue(node, node, node, control);
6388+
63856389
// Morph the {node} into a JSCreateArrayIterator with the given {kind}.
6386-
RelaxControls(node);
63876390
node->ReplaceInput(0, receiver);
63886391
node->ReplaceInput(1, context);
63896392
node->ReplaceInput(2, effect);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2023 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax --jit-fuzzing
6+
7+
const o13 = {
8+
"maxByteLength": 5368789,
9+
};
10+
const v14 = new ArrayBuffer(129, o13);
11+
const v16 = new Uint16Array(v14);
12+
13+
function f3(param) {
14+
for (let i = 0; i < 5; i++) {
15+
try {"resize".includes(v14); } catch (e) {}
16+
v14.resize(3.0, ..."resize", ...v16);
17+
}
18+
19+
let f = function() { return param; }
20+
}
21+
22+
%PrepareFunctionForOptimization(f3);
23+
f3();
24+
%OptimizeFunctionOnNextCall(f3);
25+
f3();

0 commit comments

Comments
 (0)