[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:
parent
93f1f198a6
commit
85f6e16844
@ -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() &&
|
||||
|
16
test/mjsunit/regress/regress-crbug-523307.js
Normal file
16
test/mjsunit/regress/regress-crbug-523307.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user