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
This commit is contained in:
parent
4a5001ddd1
commit
fc71f7fdb3
@ -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<HDeoptimize>("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<HDeoptimize>("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<HDeoptimize>("Insufficient type feedback for combined type "
|
||||
"of binary operation",
|
||||
Deoptimizer::SOFT);
|
||||
|
12
test/mjsunit/regress/regress-crbug-412210.js
Normal file
12
test/mjsunit/regress/regress-crbug-412210.js
Normal file
@ -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();
|
Loading…
Reference in New Issue
Block a user