OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/stub-cache.h" | 10 #include "src/stub-cache.h" |
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 } else { | 2397 } else { |
2398 __ cmp(ToRegister(left), Operand(value)); | 2398 __ cmp(ToRegister(left), Operand(value)); |
2399 } | 2399 } |
2400 } else if (left->IsConstantOperand()) { | 2400 } else if (left->IsConstantOperand()) { |
2401 int32_t value = ToInteger32(LConstantOperand::cast(left)); | 2401 int32_t value = ToInteger32(LConstantOperand::cast(left)); |
2402 if (instr->hydrogen_value()->representation().IsSmi()) { | 2402 if (instr->hydrogen_value()->representation().IsSmi()) { |
2403 __ cmp(ToRegister(right), Operand(Smi::FromInt(value))); | 2403 __ cmp(ToRegister(right), Operand(Smi::FromInt(value))); |
2404 } else { | 2404 } else { |
2405 __ cmp(ToRegister(right), Operand(value)); | 2405 __ cmp(ToRegister(right), Operand(value)); |
2406 } | 2406 } |
2407 // We transposed the operands. Reverse the condition. | 2407 // We commuted the operands, so commute the condition. |
2408 cond = ReverseCondition(cond); | 2408 cond = CommuteCondition(cond); |
2409 } else { | 2409 } else { |
2410 __ cmp(ToRegister(left), ToRegister(right)); | 2410 __ cmp(ToRegister(left), ToRegister(right)); |
2411 } | 2411 } |
2412 } | 2412 } |
2413 EmitBranch(instr, cond); | 2413 EmitBranch(instr, cond); |
2414 } | 2414 } |
2415 } | 2415 } |
2416 | 2416 |
2417 | 2417 |
2418 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { | 2418 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4141 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4141 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4142 } | 4142 } |
4143 | 4143 |
4144 | 4144 |
4145 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4145 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4146 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4146 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4147 if (instr->index()->IsConstantOperand()) { | 4147 if (instr->index()->IsConstantOperand()) { |
4148 Operand index = ToOperand(instr->index()); | 4148 Operand index = ToOperand(instr->index()); |
4149 Register length = ToRegister(instr->length()); | 4149 Register length = ToRegister(instr->length()); |
4150 __ cmp(length, index); | 4150 __ cmp(length, index); |
4151 cc = ReverseCondition(cc); | 4151 cc = CommuteCondition(cc); |
4152 } else { | 4152 } else { |
4153 Register index = ToRegister(instr->index()); | 4153 Register index = ToRegister(instr->index()); |
4154 Operand length = ToOperand(instr->length()); | 4154 Operand length = ToOperand(instr->length()); |
4155 __ cmp(index, length); | 4155 __ cmp(index, length); |
4156 } | 4156 } |
4157 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { | 4157 if (FLAG_debug_code && instr->hydrogen()->skip_check()) { |
4158 Label done; | 4158 Label done; |
4159 __ b(NegateCondition(cc), &done); | 4159 __ b(NegateCondition(cc), &done); |
4160 __ stop("eliminated bounds check failed"); | 4160 __ stop("eliminated bounds check failed"); |
4161 __ bind(&done); | 4161 __ bind(&done); |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5814 __ ldr(result, FieldMemOperand(scratch, | 5814 __ ldr(result, FieldMemOperand(scratch, |
5815 FixedArray::kHeaderSize - kPointerSize)); | 5815 FixedArray::kHeaderSize - kPointerSize)); |
5816 __ bind(deferred->exit()); | 5816 __ bind(deferred->exit()); |
5817 __ bind(&done); | 5817 __ bind(&done); |
5818 } | 5818 } |
5819 | 5819 |
5820 | 5820 |
5821 #undef __ | 5821 #undef __ |
5822 | 5822 |
5823 } } // namespace v8::internal | 5823 } } // namespace v8::internal |
OLD | NEW |