Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2614663009: PPC: fix smi compare in DoBoundsCheck (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4004 matching lines...) Expand 10 before | Expand all | Expand 10 after
4015 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4015 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4016 Representation representation = instr->hydrogen()->length()->representation(); 4016 Representation representation = instr->hydrogen()->length()->representation();
4017 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); 4017 DCHECK(representation.Equals(instr->hydrogen()->index()->representation()));
4018 DCHECK(representation.IsSmiOrInteger32()); 4018 DCHECK(representation.IsSmiOrInteger32());
4019 4019
4020 Condition cc = instr->hydrogen()->allow_equality() ? lt : le; 4020 Condition cc = instr->hydrogen()->allow_equality() ? lt : le;
4021 if (instr->length()->IsConstantOperand()) { 4021 if (instr->length()->IsConstantOperand()) {
4022 int32_t length = ToInteger32(LConstantOperand::cast(instr->length())); 4022 int32_t length = ToInteger32(LConstantOperand::cast(instr->length()));
4023 Register index = ToRegister(instr->index()); 4023 Register index = ToRegister(instr->index());
4024 if (representation.IsSmi()) { 4024 if (representation.IsSmi()) {
4025 __ Cmpli(index, Operand(Smi::FromInt(length)), r0); 4025 __ CmplSmiLiteral(index, Smi::FromInt(length), r0);
4026 } else { 4026 } else {
4027 __ Cmplwi(index, Operand(length), r0); 4027 __ Cmplwi(index, Operand(length), r0);
4028 } 4028 }
4029 cc = CommuteCondition(cc); 4029 cc = CommuteCondition(cc);
4030 } else if (instr->index()->IsConstantOperand()) { 4030 } else if (instr->index()->IsConstantOperand()) {
4031 int32_t index = ToInteger32(LConstantOperand::cast(instr->index())); 4031 int32_t index = ToInteger32(LConstantOperand::cast(instr->index()));
4032 Register length = ToRegister(instr->length()); 4032 Register length = ToRegister(instr->length());
4033 if (representation.IsSmi()) { 4033 if (representation.IsSmi()) {
4034 __ Cmpli(length, Operand(Smi::FromInt(index)), r0); 4034 __ CmplSmiLiteral(length, Smi::FromInt(index), r0);
4035 } else { 4035 } else {
4036 __ Cmplwi(length, Operand(index), r0); 4036 __ Cmplwi(length, Operand(index), r0);
4037 } 4037 }
4038 } else { 4038 } else {
4039 Register index = ToRegister(instr->index()); 4039 Register index = ToRegister(instr->index());
4040 Register length = ToRegister(instr->length()); 4040 Register length = ToRegister(instr->length());
4041 if (representation.IsSmi()) { 4041 if (representation.IsSmi()) {
4042 __ cmpl(length, index); 4042 __ cmpl(length, index);
4043 } else { 4043 } else {
4044 __ cmplw(length, index); 4044 __ cmplw(length, index);
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
5656 __ LoadP(result, 5656 __ LoadP(result,
5657 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5657 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5658 __ bind(deferred->exit()); 5658 __ bind(deferred->exit());
5659 __ bind(&done); 5659 __ bind(&done);
5660 } 5660 }
5661 5661
5662 #undef __ 5662 #undef __
5663 5663
5664 } // namespace internal 5664 } // namespace internal
5665 } // namespace v8 5665 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698