OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/builtins/builtins-constructor.h" | 10 #include "src/builtins/builtins-constructor.h" |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 __ jmp(instr->FalseLabel(chunk_)); | 2058 __ jmp(instr->FalseLabel(chunk_)); |
2059 __ bind(¬_string); | 2059 __ bind(¬_string); |
2060 } | 2060 } |
2061 | 2061 |
2062 if (expected & ToBooleanHint::kSymbol) { | 2062 if (expected & ToBooleanHint::kSymbol) { |
2063 // Symbol value -> true. | 2063 // Symbol value -> true. |
2064 __ CmpInstanceType(map, SYMBOL_TYPE); | 2064 __ CmpInstanceType(map, SYMBOL_TYPE); |
2065 __ j(equal, instr->TrueLabel(chunk_)); | 2065 __ j(equal, instr->TrueLabel(chunk_)); |
2066 } | 2066 } |
2067 | 2067 |
| 2068 if (expected & ToBooleanHint::kSimdValue) { |
| 2069 // SIMD value -> true. |
| 2070 __ CmpInstanceType(map, SIMD128_VALUE_TYPE); |
| 2071 __ j(equal, instr->TrueLabel(chunk_)); |
| 2072 } |
| 2073 |
2068 if (expected & ToBooleanHint::kHeapNumber) { | 2074 if (expected & ToBooleanHint::kHeapNumber) { |
2069 // heap number -> false iff +0, -0, or NaN. | 2075 // heap number -> false iff +0, -0, or NaN. |
2070 Label not_heap_number; | 2076 Label not_heap_number; |
2071 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2077 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2072 __ j(not_equal, ¬_heap_number, Label::kNear); | 2078 __ j(not_equal, ¬_heap_number, Label::kNear); |
2073 XMMRegister xmm_scratch = double_scratch0(); | 2079 XMMRegister xmm_scratch = double_scratch0(); |
2074 __ Xorpd(xmm_scratch, xmm_scratch); | 2080 __ Xorpd(xmm_scratch, xmm_scratch); |
2075 __ Ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2081 __ Ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
2076 __ j(zero, instr->FalseLabel(chunk_)); | 2082 __ j(zero, instr->FalseLabel(chunk_)); |
2077 __ jmp(instr->TrueLabel(chunk_)); | 2083 __ jmp(instr->TrueLabel(chunk_)); |
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5182 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5188 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5183 __ j(equal, true_label, true_distance); | 5189 __ j(equal, true_label, true_distance); |
5184 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5190 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5185 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); | 5191 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); |
5186 __ j(below, false_label, false_distance); | 5192 __ j(below, false_label, false_distance); |
5187 // Check for callable or undetectable objects => false. | 5193 // Check for callable or undetectable objects => false. |
5188 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5194 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
5189 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5195 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5190 final_branch_condition = zero; | 5196 final_branch_condition = zero; |
5191 | 5197 |
| 5198 // clang-format off |
| 5199 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5200 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5201 __ JumpIfSmi(input, false_label, false_distance); \ |
| 5202 __ CompareRoot(FieldOperand(input, HeapObject::kMapOffset), \ |
| 5203 Heap::k##Type##MapRootIndex); \ |
| 5204 final_branch_condition = equal; |
| 5205 SIMD128_TYPES(SIMD128_TYPE) |
| 5206 #undef SIMD128_TYPE |
| 5207 // clang-format on |
| 5208 |
5192 } else { | 5209 } else { |
5193 __ jmp(false_label, false_distance); | 5210 __ jmp(false_label, false_distance); |
5194 } | 5211 } |
5195 | 5212 |
5196 return final_branch_condition; | 5213 return final_branch_condition; |
5197 } | 5214 } |
5198 | 5215 |
5199 | 5216 |
5200 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5217 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5201 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5218 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5431 __ bind(deferred->exit()); | 5448 __ bind(deferred->exit()); |
5432 __ bind(&done); | 5449 __ bind(&done); |
5433 } | 5450 } |
5434 | 5451 |
5435 #undef __ | 5452 #undef __ |
5436 | 5453 |
5437 } // namespace internal | 5454 } // namespace internal |
5438 } // namespace v8 | 5455 } // namespace v8 |
5439 | 5456 |
5440 #endif // V8_TARGET_ARCH_X64 | 5457 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |