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/crankshaft/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.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 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 __ b(instr->FalseLabel(chunk_)); | 2123 __ b(instr->FalseLabel(chunk_)); |
2124 __ bind(¬_string); | 2124 __ bind(¬_string); |
2125 } | 2125 } |
2126 | 2126 |
2127 if (expected & ToBooleanHint::kSymbol) { | 2127 if (expected & ToBooleanHint::kSymbol) { |
2128 // Symbol value -> true. | 2128 // Symbol value -> true. |
2129 __ CompareInstanceType(map, ip, SYMBOL_TYPE); | 2129 __ CompareInstanceType(map, ip, SYMBOL_TYPE); |
2130 __ b(eq, instr->TrueLabel(chunk_)); | 2130 __ b(eq, instr->TrueLabel(chunk_)); |
2131 } | 2131 } |
2132 | 2132 |
| 2133 if (expected & ToBooleanHint::kSimdValue) { |
| 2134 // SIMD value -> true. |
| 2135 __ CompareInstanceType(map, ip, SIMD128_VALUE_TYPE); |
| 2136 __ b(eq, instr->TrueLabel(chunk_)); |
| 2137 } |
| 2138 |
2133 if (expected & ToBooleanHint::kHeapNumber) { | 2139 if (expected & ToBooleanHint::kHeapNumber) { |
2134 // heap number -> false iff +0, -0, or NaN. | 2140 // heap number -> false iff +0, -0, or NaN. |
2135 DwVfpRegister dbl_scratch = double_scratch0(); | 2141 DwVfpRegister dbl_scratch = double_scratch0(); |
2136 Label not_heap_number; | 2142 Label not_heap_number; |
2137 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2143 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2138 __ b(ne, ¬_heap_number); | 2144 __ b(ne, ¬_heap_number); |
2139 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2145 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2140 __ VFPCompareAndSetFlags(dbl_scratch, 0.0); | 2146 __ VFPCompareAndSetFlags(dbl_scratch, 0.0); |
2141 __ cmp(r0, r0, vs); // NaN -> false. | 2147 __ cmp(r0, r0, vs); // NaN -> false. |
2142 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false. | 2148 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false. |
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5123 __ b(eq, true_label); | 5129 __ b(eq, true_label); |
5124 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5130 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5125 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE); | 5131 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE); |
5126 __ b(lt, false_label); | 5132 __ b(lt, false_label); |
5127 // Check for callable or undetectable objects => false. | 5133 // Check for callable or undetectable objects => false. |
5128 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5134 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5129 __ tst(scratch, | 5135 __ tst(scratch, |
5130 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5136 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5131 final_branch_condition = eq; | 5137 final_branch_condition = eq; |
5132 | 5138 |
| 5139 // clang-format off |
| 5140 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5141 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5142 __ JumpIfSmi(input, false_label); \ |
| 5143 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5144 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ |
| 5145 final_branch_condition = eq; |
| 5146 SIMD128_TYPES(SIMD128_TYPE) |
| 5147 #undef SIMD128_TYPE |
| 5148 // clang-format on |
| 5149 |
5133 } else { | 5150 } else { |
5134 __ b(false_label); | 5151 __ b(false_label); |
5135 } | 5152 } |
5136 | 5153 |
5137 return final_branch_condition; | 5154 return final_branch_condition; |
5138 } | 5155 } |
5139 | 5156 |
5140 | 5157 |
5141 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5158 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5142 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5159 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5385 __ ldr(result, FieldMemOperand(scratch, | 5402 __ ldr(result, FieldMemOperand(scratch, |
5386 FixedArray::kHeaderSize - kPointerSize)); | 5403 FixedArray::kHeaderSize - kPointerSize)); |
5387 __ bind(deferred->exit()); | 5404 __ bind(deferred->exit()); |
5388 __ bind(&done); | 5405 __ bind(&done); |
5389 } | 5406 } |
5390 | 5407 |
5391 #undef __ | 5408 #undef __ |
5392 | 5409 |
5393 } // namespace internal | 5410 } // namespace internal |
5394 } // namespace v8 | 5411 } // namespace v8 |
OLD | NEW |