e583fc836b
When optimizing SpeculativeToNumber we need to pay attention to the hint, otherwise we optimize away a Signed32 conversion, based on the fact that the input is a Number. Bug: chromium:819298 Change-Id: I2ac7b0dac708fee9083eca2880bd5674a82daaa3 Reviewed-on: https://chromium-review.googlesource.com/955423 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51805}
18 lines
359 B
JavaScript
18 lines
359 B
JavaScript
// Copyright 2018 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
|
|
|
|
var a = new Int32Array(2);
|
|
|
|
function foo(base) {
|
|
a[base - 91] = 1;
|
|
}
|
|
|
|
foo("");
|
|
foo("");
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
foo(NaN);
|
|
assertEquals(0, a[0]);
|