Commit e0b8707c authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Fix typing rule for number addition.

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

Review-Url: https://codereview.chromium.org/2161013002
Cr-Commit-Position: refs/heads/master@{#37859}
parent 4f552f5a
......@@ -299,7 +299,13 @@ Type* OperationTyper::NumberAdd(Type* lhs, Type* rhs) {
return Type::Number();
}
Type* int_lhs = Type::Intersect(lhs, cache_.kInteger, zone());
if (lhs->Maybe(Type::MinusZero())) {
int_lhs = Type::Union(int_lhs, cache_.kSingletonZero, zone());
}
Type* int_rhs = Type::Intersect(rhs, cache_.kInteger, zone());
if (rhs->Maybe(Type::MinusZero())) {
int_rhs = Type::Union(int_rhs, cache_.kSingletonZero, zone());
}
Type* result =
AddRanger(int_lhs->Min(), int_lhs->Max(), int_rhs->Min(), int_rhs->Max());
if (lhs->Maybe(Type::NaN()) || rhs->Maybe(Type::NaN())) {
......
// 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 bar(v) {
v.constructor;
}
bar([]);
bar([]);
function foo() {
var x = -0;
bar(x + 1);
}
%OptimizeFunctionOnNextCall(foo);
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