Revision: 19683
Author: [email protected]
Date: Thu Mar 6 09:47:27 2014 UTC
Log: Also delete force representations that have no uses.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/187773002
http://code.google.com/p/v8/source/detail?r=19683
Added:
/branches/bleeding_edge/test/mjsunit/regress/regress-force-representation.js
Modified:
/branches/bleeding_edge/src/hydrogen-representation-changes.cc
=======================================
--- /dev/null
+++
/branches/bleeding_edge/test/mjsunit/regress/regress-force-representation.js
Thu Mar 6 09:47:27 2014 UTC
@@ -0,0 +1,22 @@
+// 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 optimize(crankshaft_test) {
+ crankshaft_test();
+ crankshaft_test();
+ %OptimizeFunctionOnNextCall(crankshaft_test);
+ crankshaft_test();
+}
+
+function f() {
+ var v1 = 0;
+ var v2 = -0;
+ var t = v2++;
+ v2++;
+ return Math.max(v2++, v1++);
+}
+
+optimize(f);
=======================================
--- /branches/bleeding_edge/src/hydrogen-representation-changes.cc Thu Feb
13 16:09:28 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-representation-changes.cc Thu Mar
6 09:47:27 2014 UTC
@@ -78,7 +78,10 @@
HValue* value) {
Representation r = value->representation();
if (r.IsNone()) return;
- if (value->HasNoUses()) return;
+ if (value->HasNoUses()) {
+ if (value->IsForceRepresentation()) value->DeleteAndReplaceWith(NULL);
+ return;
+ }
for (HUseIterator it(value->uses()); !it.Done(); it.Advance()) {
HValue* use_value = it.value();
--
--
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/groups/opt_out.