Commit 4f635647 authored by Andreas Rossberg's avatar Andreas Rossberg

Fix lower bound violation

R=jarin@chromium.org
BUG=433332
LOG=N

Review URL: https://codereview.chromium.org/739563002

Cr-Commit-Position: refs/heads/master@{#25436}
parent 1808badc
......@@ -1035,7 +1035,7 @@ struct BoundsImpl {
TypeHandle lower = Type::Union(b1.lower, b2.lower, region);
TypeHandle upper = Type::Intersect(b1.upper, b2.upper, region);
// Lower bounds are considered approximate, correct as necessary.
lower = Type::Intersect(lower, upper, region);
if (!lower->Is(upper)) lower = upper;
return BoundsImpl(lower, upper);
}
......@@ -1047,14 +1047,16 @@ struct BoundsImpl {
}
static BoundsImpl NarrowLower(BoundsImpl b, TypeHandle t, Region* region) {
// Lower bounds are considered approximate, correct as necessary.
t = Type::Intersect(t, b.upper, region);
TypeHandle lower = Type::Union(b.lower, t, region);
// Lower bounds are considered approximate, correct as necessary.
if (!lower->Is(b.upper)) lower = b.upper;
return BoundsImpl(lower, b.upper);
}
static BoundsImpl NarrowUpper(BoundsImpl b, TypeHandle t, Region* region) {
TypeHandle lower = Type::Intersect(b.lower, t, region);
TypeHandle lower = b.lower;
TypeHandle upper = Type::Intersect(b.upper, t, region);
// Lower bounds are considered approximate, correct as necessary.
if (!lower->Is(upper)) lower = upper;
return BoundsImpl(lower, upper);
}
......
// Copyright 2014 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 f(foo) {
var g;
true ? (g = 0.1) : g |= null;
if (null != g) {}
};
f(1.4);
f(1.4);
%OptimizeFunctionOnNextCall(f);
f(1.4);
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