From: rossberg@chromium.org Date: Thu, 11 Sep 2014 12:13:34 +0000 (+0000) Subject: Fix inaccurate type condition in Hydrogen X-Git-Tag: upstream/4.7.83~6980 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc71f7fdb318ed4c6286a1b4016ad7b389dc3e48;p=platform%2Fupstream%2Fv8.git Fix inaccurate type condition in Hydrogen R=bmeurer@chromium.org BUG=chromium:412210 LOG=Y Review URL: https://codereview.chromium.org/550453003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen.cc b/src/hydrogen.cc index ce3d368..ee0ed36 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -10253,7 +10253,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( right_type->Maybe(Type::String()) || right_type->Maybe(Type::Receiver())); - if (left_type->Is(Type::None())) { + if (!left_type->IsInhabited()) { Add("Insufficient type feedback for LHS of binary operation", Deoptimizer::SOFT); // TODO(rossberg): we should be able to get rid of non-continuous @@ -10264,7 +10264,7 @@ HValue* HGraphBuilder::BuildBinaryOperation( left_rep = Representation::FromType(left_type); } - if (right_type->Is(Type::None())) { + if (!right_type->IsInhabited()) { Add("Insufficient type feedback for RHS of binary operation", Deoptimizer::SOFT); right_type = Type::Any(zone()); @@ -10761,7 +10761,7 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction( BailoutId bailout_id) { // Cases handled below depend on collected type feedback. They should // soft deoptimize when there is no type feedback. - if (combined_type->Is(Type::None())) { + if (!combined_type->IsInhabited()) { Add("Insufficient type feedback for combined type " "of binary operation", Deoptimizer::SOFT); diff --git a/test/mjsunit/regress/regress-crbug-412210.js b/test/mjsunit/regress/regress-crbug-412210.js new file mode 100644 index 0000000..6ec7d62 --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-412210.js @@ -0,0 +1,12 @@ +// 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(x) { + return (x ? "" >> 0 : "") + /a/; +}; + +%OptimizeFunctionOnNextCall(f); +f();