OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3904 GetLinkRegisterState(), kSaveFPRegs, | 3904 GetLinkRegisterState(), kSaveFPRegs, |
3905 EMIT_REMEMBERED_SET, hinstr->SmiCheckForWriteBarrier(), | 3905 EMIT_REMEMBERED_SET, hinstr->SmiCheckForWriteBarrier(), |
3906 hinstr->PointersToHereCheckForValue()); | 3906 hinstr->PointersToHereCheckForValue()); |
3907 } | 3907 } |
3908 } | 3908 } |
3909 | 3909 |
3910 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3910 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
3911 Representation representation = instr->hydrogen()->length()->representation(); | 3911 Representation representation = instr->hydrogen()->length()->representation(); |
3912 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 3912 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); |
3913 DCHECK(representation.IsSmiOrInteger32()); | 3913 DCHECK(representation.IsSmiOrInteger32()); |
| 3914 Register temp = scratch0(); |
3914 | 3915 |
3915 Condition cc = instr->hydrogen()->allow_equality() ? lt : le; | 3916 Condition cc = instr->hydrogen()->allow_equality() ? lt : le; |
3916 if (instr->length()->IsConstantOperand()) { | 3917 if (instr->length()->IsConstantOperand()) { |
3917 int32_t length = ToInteger32(LConstantOperand::cast(instr->length())); | 3918 int32_t length = ToInteger32(LConstantOperand::cast(instr->length())); |
3918 Register index = ToRegister(instr->index()); | 3919 Register index = ToRegister(instr->index()); |
3919 if (representation.IsSmi()) { | 3920 if (representation.IsSmi()) { |
3920 __ CmpLogicalP(index, Operand(Smi::FromInt(length))); | 3921 __ CmpLogicalSmiLiteral(index, Smi::FromInt(length), temp); |
3921 } else { | 3922 } else { |
3922 __ CmpLogical32(index, Operand(length)); | 3923 __ CmpLogical32(index, Operand(length)); |
3923 } | 3924 } |
3924 cc = CommuteCondition(cc); | 3925 cc = CommuteCondition(cc); |
3925 } else if (instr->index()->IsConstantOperand()) { | 3926 } else if (instr->index()->IsConstantOperand()) { |
3926 int32_t index = ToInteger32(LConstantOperand::cast(instr->index())); | 3927 int32_t index = ToInteger32(LConstantOperand::cast(instr->index())); |
3927 Register length = ToRegister(instr->length()); | 3928 Register length = ToRegister(instr->length()); |
3928 if (representation.IsSmi()) { | 3929 if (representation.IsSmi()) { |
3929 __ CmpLogicalP(length, Operand(Smi::FromInt(index))); | 3930 __ CmpLogicalSmiLiteral(length, Smi::FromInt(index), temp); |
3930 } else { | 3931 } else { |
3931 __ CmpLogical32(length, Operand(index)); | 3932 __ CmpLogical32(length, Operand(index)); |
3932 } | 3933 } |
3933 } else { | 3934 } else { |
3934 Register index = ToRegister(instr->index()); | 3935 Register index = ToRegister(instr->index()); |
3935 Register length = ToRegister(instr->length()); | 3936 Register length = ToRegister(instr->length()); |
3936 if (representation.IsSmi()) { | 3937 if (representation.IsSmi()) { |
3937 __ CmpLogicalP(length, index); | 3938 __ CmpLogicalP(length, index); |
3938 } else { | 3939 } else { |
3939 __ CmpLogical32(length, index); | 3940 __ CmpLogical32(length, index); |
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5577 __ LoadP(result, | 5578 __ LoadP(result, |
5578 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5579 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5579 __ bind(deferred->exit()); | 5580 __ bind(deferred->exit()); |
5580 __ bind(&done); | 5581 __ bind(&done); |
5581 } | 5582 } |
5582 | 5583 |
5583 #undef __ | 5584 #undef __ |
5584 | 5585 |
5585 } // namespace internal | 5586 } // namespace internal |
5586 } // namespace v8 | 5587 } // namespace v8 |
OLD | NEW |