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 | |
2074 if (expected & ToBooleanHint::kHeapNumber) { | 2068 if (expected & ToBooleanHint::kHeapNumber) { |
2075 // heap number -> false iff +0, -0, or NaN. | 2069 // heap number -> false iff +0, -0, or NaN. |
2076 Label not_heap_number; | 2070 Label not_heap_number; |
2077 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2071 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2078 __ j(not_equal, ¬_heap_number, Label::kNear); | 2072 __ j(not_equal, ¬_heap_number, Label::kNear); |
2079 XMMRegister xmm_scratch = double_scratch0(); | 2073 XMMRegister xmm_scratch = double_scratch0(); |
2080 __ Xorpd(xmm_scratch, xmm_scratch); | 2074 __ Xorpd(xmm_scratch, xmm_scratch); |
2081 __ Ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2075 __ Ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
2082 __ j(zero, instr->FalseLabel(chunk_)); | 2076 __ j(zero, instr->FalseLabel(chunk_)); |
2083 __ jmp(instr->TrueLabel(chunk_)); | 2077 __ jmp(instr->TrueLabel(chunk_)); |
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5188 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5182 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5189 __ j(equal, true_label, true_distance); | 5183 __ j(equal, true_label, true_distance); |
5190 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5184 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5191 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); | 5185 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); |
5192 __ j(below, false_label, false_distance); | 5186 __ j(below, false_label, false_distance); |
5193 // Check for callable or undetectable objects => false. | 5187 // Check for callable or undetectable objects => false. |
5194 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5188 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
5195 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5189 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5196 final_branch_condition = zero; | 5190 final_branch_condition = zero; |
5197 | 5191 |
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 | |
5209 } else { | 5192 } else { |
5210 __ jmp(false_label, false_distance); | 5193 __ jmp(false_label, false_distance); |
5211 } | 5194 } |
5212 | 5195 |
5213 return final_branch_condition; | 5196 return final_branch_condition; |
5214 } | 5197 } |
5215 | 5198 |
5216 | 5199 |
5217 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5200 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5218 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5201 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5448 __ bind(deferred->exit()); | 5431 __ bind(deferred->exit()); |
5449 __ bind(&done); | 5432 __ bind(&done); |
5450 } | 5433 } |
5451 | 5434 |
5452 #undef __ | 5435 #undef __ |
5453 | 5436 |
5454 } // namespace internal | 5437 } // namespace internal |
5455 } // namespace v8 | 5438 } // namespace v8 |
5456 | 5439 |
5457 #endif // V8_TARGET_ARCH_X64 | 5440 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |