[arm64] Don't try convert binary operation to shifted form when both operands are the same.

BUG=chromium:523307
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30538}
This commit is contained in:
ishell 2015-09-02 02:32:31 -07:00 committed by Commit bot
parent 93f1f198a6
commit 85f6e16844
2 changed files with 18 additions and 0 deletions

View File

@ -2132,6 +2132,8 @@ HBitwiseBinaryOperation* LChunkBuilder::CanTransformToShiftedOp(HValue* val,
DCHECK(hleft->representation().Equals(hinstr->representation()));
DCHECK(hright->representation().Equals(hinstr->representation()));
if (hleft == hright) return NULL;
if ((hright->IsConstant() &&
LikelyFitsImmField(hinstr, HConstant::cast(hright)->Integer32Value())) ||
(hinstr->IsCommutative() && hleft->IsConstant() &&

View File

@ -0,0 +1,16 @@
// Copyright 2015 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) {
var c = x * x << 366;
var a = c + c;
return a;
}
f(1);
f(1);
%OptimizeFunctionOnNextCall(f);
f(1);