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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 __ jmp(instr->FalseLabel(chunk_)); | 2191 __ jmp(instr->FalseLabel(chunk_)); |
2192 __ bind(¬_string); | 2192 __ bind(¬_string); |
2193 } | 2193 } |
2194 | 2194 |
2195 if (expected & ToBooleanHint::kSymbol) { | 2195 if (expected & ToBooleanHint::kSymbol) { |
2196 // Symbol value -> true. | 2196 // Symbol value -> true. |
2197 __ CmpInstanceType(map, SYMBOL_TYPE); | 2197 __ CmpInstanceType(map, SYMBOL_TYPE); |
2198 __ j(equal, instr->TrueLabel(chunk_)); | 2198 __ j(equal, instr->TrueLabel(chunk_)); |
2199 } | 2199 } |
2200 | 2200 |
| 2201 if (expected & ToBooleanHint::kSimdValue) { |
| 2202 // SIMD value -> true. |
| 2203 __ CmpInstanceType(map, SIMD128_VALUE_TYPE); |
| 2204 __ j(equal, instr->TrueLabel(chunk_)); |
| 2205 } |
| 2206 |
2201 if (expected & ToBooleanHint::kHeapNumber) { | 2207 if (expected & ToBooleanHint::kHeapNumber) { |
2202 // heap number -> false iff +0, -0, or NaN. | 2208 // heap number -> false iff +0, -0, or NaN. |
2203 Label not_heap_number; | 2209 Label not_heap_number; |
2204 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2210 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2205 factory()->heap_number_map()); | 2211 factory()->heap_number_map()); |
2206 __ j(not_equal, ¬_heap_number, Label::kNear); | 2212 __ j(not_equal, ¬_heap_number, Label::kNear); |
2207 __ fldz(); | 2213 __ fldz(); |
2208 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); | 2214 __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset)); |
2209 __ FCmp(); | 2215 __ FCmp(); |
2210 __ j(zero, instr->FalseLabel(chunk_)); | 2216 __ j(zero, instr->FalseLabel(chunk_)); |
(...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5393 __ cmp(input, factory()->null_value()); | 5399 __ cmp(input, factory()->null_value()); |
5394 __ j(equal, true_label, true_distance); | 5400 __ j(equal, true_label, true_distance); |
5395 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 5401 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
5396 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); | 5402 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, input); |
5397 __ j(below, false_label, false_distance); | 5403 __ j(below, false_label, false_distance); |
5398 // Check for callable or undetectable objects => false. | 5404 // Check for callable or undetectable objects => false. |
5399 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5405 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
5400 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5406 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5401 final_branch_condition = zero; | 5407 final_branch_condition = zero; |
5402 | 5408 |
| 5409 // clang-format off |
| 5410 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5411 } else if (String::Equals(type_name, factory()->type##_string())) { \ |
| 5412 __ JumpIfSmi(input, false_label, false_distance); \ |
| 5413 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \ |
| 5414 factory()->type##_map()); \ |
| 5415 final_branch_condition = equal; |
| 5416 SIMD128_TYPES(SIMD128_TYPE) |
| 5417 #undef SIMD128_TYPE |
| 5418 // clang-format on |
| 5419 |
5403 } else { | 5420 } else { |
5404 __ jmp(false_label, false_distance); | 5421 __ jmp(false_label, false_distance); |
5405 } | 5422 } |
5406 return final_branch_condition; | 5423 return final_branch_condition; |
5407 } | 5424 } |
5408 | 5425 |
5409 | 5426 |
5410 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5427 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5411 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5428 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
5412 // Ensure that we have enough space after the previous lazy-bailout | 5429 // Ensure that we have enough space after the previous lazy-bailout |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5649 __ bind(deferred->exit()); | 5666 __ bind(deferred->exit()); |
5650 __ bind(&done); | 5667 __ bind(&done); |
5651 } | 5668 } |
5652 | 5669 |
5653 #undef __ | 5670 #undef __ |
5654 | 5671 |
5655 } // namespace internal | 5672 } // namespace internal |
5656 } // namespace v8 | 5673 } // namespace v8 |
5657 | 5674 |
5658 #endif // V8_TARGET_ARCH_X87 | 5675 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |