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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2260 __ b(instr->FalseLabel(chunk_)); | 2260 __ b(instr->FalseLabel(chunk_)); |
2261 __ bind(¬_string); | 2261 __ bind(¬_string); |
2262 } | 2262 } |
2263 | 2263 |
2264 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2264 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2265 // Symbol value -> true. | 2265 // Symbol value -> true. |
2266 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2266 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
2267 __ b(eq, instr->TrueLabel(chunk_)); | 2267 __ b(eq, instr->TrueLabel(chunk_)); |
2268 } | 2268 } |
2269 | 2269 |
| 2270 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
| 2271 // SIMD value -> true. |
| 2272 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE); |
| 2273 __ b(eq, instr->TrueLabel(chunk_)); |
| 2274 } |
| 2275 |
2270 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2276 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2271 // heap number -> false iff +0, -0, or NaN. | 2277 // heap number -> false iff +0, -0, or NaN. |
2272 DwVfpRegister dbl_scratch = double_scratch0(); | 2278 DwVfpRegister dbl_scratch = double_scratch0(); |
2273 Label not_heap_number; | 2279 Label not_heap_number; |
2274 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2280 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2275 __ b(ne, ¬_heap_number); | 2281 __ b(ne, ¬_heap_number); |
2276 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2282 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2277 __ VFPCompareAndSetFlags(dbl_scratch, 0.0); | 2283 __ VFPCompareAndSetFlags(dbl_scratch, 0.0); |
2278 __ cmp(r0, r0, vs); // NaN -> false. | 2284 __ cmp(r0, r0, vs); // NaN -> false. |
2279 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false. | 2285 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false. |
(...skipping 3391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5671 __ CheckObjectTypeRange(input, | 5677 __ CheckObjectTypeRange(input, |
5672 map, | 5678 map, |
5673 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5679 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
5674 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5680 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, |
5675 false_label); | 5681 false_label); |
5676 // Check for undetectable objects => false. | 5682 // Check for undetectable objects => false. |
5677 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5683 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5678 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); | 5684 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); |
5679 final_branch_condition = eq; | 5685 final_branch_condition = eq; |
5680 | 5686 |
| 5687 } else if (String::Equals(type_name, factory->float32x4_string())) { |
| 5688 __ JumpIfSmi(input, false_label); |
| 5689 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE); |
| 5690 final_branch_condition = eq; |
| 5691 |
5681 } else { | 5692 } else { |
5682 __ b(false_label); | 5693 __ b(false_label); |
5683 } | 5694 } |
5684 | 5695 |
5685 return final_branch_condition; | 5696 return final_branch_condition; |
5686 } | 5697 } |
5687 | 5698 |
5688 | 5699 |
5689 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | 5700 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
5690 Register temp1 = ToRegister(instr->temp()); | 5701 Register temp1 = ToRegister(instr->temp()); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5987 __ push(ToRegister(instr->function())); | 5998 __ push(ToRegister(instr->function())); |
5988 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5999 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5989 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6000 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5990 } | 6001 } |
5991 | 6002 |
5992 | 6003 |
5993 #undef __ | 6004 #undef __ |
5994 | 6005 |
5995 } // namespace internal | 6006 } // namespace internal |
5996 } // namespace v8 | 6007 } // namespace v8 |
OLD | NEW |