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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5604 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); | 5604 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); |
5605 __ j(equal, true_label, true_distance); | 5605 __ j(equal, true_label, true_distance); |
5606 __ JumpIfSmi(input, false_label, false_distance); | 5606 __ JumpIfSmi(input, false_label, false_distance); |
5607 // Check for undetectable objects => true. | 5607 // Check for undetectable objects => true. |
5608 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); | 5608 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); |
5609 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5609 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
5610 Immediate(1 << Map::kIsUndetectable)); | 5610 Immediate(1 << Map::kIsUndetectable)); |
5611 final_branch_condition = not_zero; | 5611 final_branch_condition = not_zero; |
5612 | 5612 |
5613 } else if (String::Equals(type_name, factory->function_string())) { | 5613 } else if (String::Equals(type_name, factory->function_string())) { |
5614 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
5615 __ JumpIfSmi(input, false_label, false_distance); | 5614 __ JumpIfSmi(input, false_label, false_distance); |
5616 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); | 5615 // Check for callable and not undetectable objects => true. |
5617 __ j(equal, true_label, true_distance); | 5616 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); |
5618 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); | 5617 __ movzxbl(input, FieldOperand(input, Map::kBitFieldOffset)); |
| 5618 __ andb(input, |
| 5619 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5620 __ cmpb(input, Immediate(1 << Map::kIsCallable)); |
5619 final_branch_condition = equal; | 5621 final_branch_condition = equal; |
5620 | 5622 |
5621 } else if (String::Equals(type_name, factory->object_string())) { | 5623 } else if (String::Equals(type_name, factory->object_string())) { |
5622 __ JumpIfSmi(input, false_label, false_distance); | 5624 __ JumpIfSmi(input, false_label, false_distance); |
5623 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5625 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5624 __ j(equal, true_label, true_distance); | 5626 __ j(equal, true_label, true_distance); |
5625 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5627 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 5628 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, input); |
5626 __ j(below, false_label, false_distance); | 5629 __ j(below, false_label, false_distance); |
5627 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5630 // Check for callable or undetectable objects => false. |
5628 __ j(above, false_label, false_distance); | |
5629 // Check for undetectable objects => false. | |
5630 __ testb(FieldOperand(input, Map::kBitFieldOffset), | 5631 __ testb(FieldOperand(input, Map::kBitFieldOffset), |
5631 Immediate(1 << Map::kIsUndetectable)); | 5632 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5632 final_branch_condition = zero; | 5633 final_branch_condition = zero; |
5633 | 5634 |
5634 // clang-format off | 5635 // clang-format off |
5635 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5636 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5636 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5637 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5637 __ JumpIfSmi(input, false_label, false_distance); \ | 5638 __ JumpIfSmi(input, false_label, false_distance); \ |
5638 __ movp(input, FieldOperand(input, HeapObject::kMapOffset)); \ | 5639 __ CompareRoot(FieldOperand(input, HeapObject::kMapOffset), \ |
5639 __ CompareRoot(input, Heap::k##Type##MapRootIndex); \ | 5640 Heap::k##Type##MapRootIndex); \ |
5640 final_branch_condition = equal; | 5641 final_branch_condition = equal; |
5641 SIMD128_TYPES(SIMD128_TYPE) | 5642 SIMD128_TYPES(SIMD128_TYPE) |
5642 #undef SIMD128_TYPE | 5643 #undef SIMD128_TYPE |
5643 // clang-format on | 5644 // clang-format on |
5644 | 5645 |
5645 } else { | 5646 } else { |
5646 __ jmp(false_label, false_distance); | 5647 __ jmp(false_label, false_distance); |
5647 } | 5648 } |
5648 | 5649 |
5649 return final_branch_condition; | 5650 return final_branch_condition; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5939 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5940 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5940 } | 5941 } |
5941 | 5942 |
5942 | 5943 |
5943 #undef __ | 5944 #undef __ |
5944 | 5945 |
5945 } // namespace internal | 5946 } // namespace internal |
5946 } // namespace v8 | 5947 } // namespace v8 |
5947 | 5948 |
5948 #endif // V8_TARGET_ARCH_X64 | 5949 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |