Revision: 19836
Author:   [email protected]
Date:     Wed Mar 12 10:14:29 2014 UTC
Log:      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
[email protected]

Review URL: https://codereview.chromium.org/196943002
http://code.google.com/p/v8/source/detail?r=19836

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-351320.js
Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-351320.js Wed Mar 12 10:14:29 2014 UTC
@@ -0,0 +1,21 @@
+// 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();
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Mar 12 10:11:38 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Mar 12 10:14:29 2014 UTC
@@ -3110,17 +3110,6 @@
   *block = NULL;
   return false;
 }
-
-
-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) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Mar 12 09:59:36 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Mar 12 10:14:29 2014 UTC
@@ -4383,8 +4383,6 @@
virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
     return Representation::Tagged();
   }
-
-  virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;

  protected:
   virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to