cbe03f370e
When a 32-bit binop operates on the result of a 64-bit shift, for example the decoding of a BoundedSize, the previous code would attempt to perform the shift as part of the 32-bit binop, failing a CHECK when attempting to get the 32-bit shift constant. With this CL, the instruction selector will now only attempt to perform the shift as part of another binop if both operations are either 32-bit or 64-bit. Bug: chromium:1379738 Change-Id: I2e4cf54fe5b0edcd28bf0ffd662e43259cb6bebf Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3990832 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Samuel Groß <saelo@chromium.org> Cr-Commit-Position: refs/heads/main@{#84110}
16 lines
436 B
JavaScript
16 lines
436 B
JavaScript
// 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.
|
|
//
|
|
// Flags: --allow-natives-syntax --turboshaft
|
|
|
|
let a = new Int32Array(1000);
|
|
function f() {
|
|
return a.length & 0xeeeeee;
|
|
}
|
|
assertEquals(f(), 744);
|
|
%PrepareFunctionForOptimization(f);
|
|
assertEquals(f(), 744);
|
|
%OptimizeFunctionOnNextCall(f);
|
|
assertEquals(f(), 744);
|