Fix HIsSmiAndBranch::KnownSuccessorBlock() by deleting it

Constants can still change their representation, so we cannot determine reachability of blocks based on their Smi-ness

BUG=chromium:351320
LOG=y
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19836 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ae1669b5
......@@ -3112,17 +3112,6 @@ bool HIsStringAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
}
bool HIsSmiAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
if (FLAG_fold_constants && value()->IsConstant()) {
*block = HConstant::cast(value())->HasSmiValue()
? FirstSuccessor() : SecondSuccessor();
return true;
}
*block = NULL;
return false;
}
bool HIsUndetectableAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
if (FLAG_fold_constants && value()->IsConstant()) {
*block = HConstant::cast(value())->IsUndetectable()
......
......@@ -4384,8 +4384,6 @@ class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction {
return Representation::Tagged();
}
virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;
protected:
virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
virtual int RedefinedOperandIndex() { return 0; }
......
// 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 --fold-constants
var result = 0;
var o1 = {};
o2 = {y:1.5};
o2.y = 0;
o3 = o2.y;
function crash() {
for (var i = 0; i < 10; i++) {
result += o1.x + o3.foo;
}
}
crash();
%OptimizeFunctionOnNextCall(crash);
crash();
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