Commit f913c3b4 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Also delete force representations that have no uses.

BUG=
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19683 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 14e81c8e
......@@ -78,7 +78,10 @@ void HRepresentationChangesPhase::InsertRepresentationChangesForValue(
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();
......
// 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);
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