Commit 6d533403 authored by bmeurer's avatar bmeurer Committed by Commit bot

[crankshaft] Not all HAdd instructions produce a number.

BUG=chromium:664084
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2494703002
Cr-Commit-Position: refs/heads/master@{#40894}
parent eca64a2a
......@@ -3800,8 +3800,9 @@ class HMathFloorOfDiv final : public HBinaryOperation {
class HArithmeticBinaryOperation : public HBinaryOperation {
public:
HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right)
: HBinaryOperation(context, left, right, HType::TaggedNumber()) {
HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right,
HType type = HType::TaggedNumber())
: HBinaryOperation(context, left, right, type) {
SetAllSideEffects();
SetFlag(kFlexibleRepresentation);
SetFlag(kTruncatingToNumber);
......@@ -4326,7 +4327,7 @@ class HAdd final : public HArithmeticBinaryOperation {
private:
HAdd(HValue* context, HValue* left, HValue* right,
ExternalAddType external_add_type = NoExternalAdd)
: HArithmeticBinaryOperation(context, left, right),
: HArithmeticBinaryOperation(context, left, right, HType::Tagged()),
external_add_type_(external_add_type) {
SetFlag(kCanOverflow);
switch (external_add_type_) {
......
// Copyright 2016 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
function foo() {
return +({} + 1);
}
assertEquals(NaN, foo());
assertEquals(NaN, foo());
%OptimizeFunctionOnNextCall(foo);
assertEquals(NaN, foo());
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