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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 4924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4935 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); | 4935 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); |
4936 __ j(equal, if_true); | 4936 __ j(equal, if_true); |
4937 __ JumpIfSmi(rax, if_false); | 4937 __ JumpIfSmi(rax, if_false); |
4938 // Check for undetectable objects => true. | 4938 // Check for undetectable objects => true. |
4939 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 4939 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
4940 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 4940 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
4941 Immediate(1 << Map::kIsUndetectable)); | 4941 Immediate(1 << Map::kIsUndetectable)); |
4942 Split(not_zero, if_true, if_false, fall_through); | 4942 Split(not_zero, if_true, if_false, fall_through); |
4943 } else if (String::Equals(check, factory->function_string())) { | 4943 } else if (String::Equals(check, factory->function_string())) { |
4944 __ JumpIfSmi(rax, if_false); | 4944 __ JumpIfSmi(rax, if_false); |
4945 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4945 // Check for callable and not undetectable objects => true. |
4946 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rdx); | 4946 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
4947 __ j(equal, if_true); | 4947 __ movzxbl(rdx, FieldOperand(rdx, Map::kBitFieldOffset)); |
4948 __ CmpInstanceType(rdx, JS_FUNCTION_PROXY_TYPE); | 4948 __ andb(rdx, |
| 4949 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 4950 __ cmpb(rdx, Immediate(1 << Map::kIsCallable)); |
4949 Split(equal, if_true, if_false, fall_through); | 4951 Split(equal, if_true, if_false, fall_through); |
4950 } else if (String::Equals(check, factory->object_string())) { | 4952 } else if (String::Equals(check, factory->object_string())) { |
4951 __ JumpIfSmi(rax, if_false); | 4953 __ JumpIfSmi(rax, if_false); |
4952 __ CompareRoot(rax, Heap::kNullValueRootIndex); | 4954 __ CompareRoot(rax, Heap::kNullValueRootIndex); |
4953 __ j(equal, if_true); | 4955 __ j(equal, if_true); |
4954 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); | 4956 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 4957 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rdx); |
4955 __ j(below, if_false); | 4958 __ j(below, if_false); |
4956 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4959 // Check for callable or undetectable objects => false. |
4957 __ j(above, if_false); | |
4958 // Check for undetectable objects => false. | |
4959 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 4960 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
4960 Immediate(1 << Map::kIsUndetectable)); | 4961 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
4961 Split(zero, if_true, if_false, fall_through); | 4962 Split(zero, if_true, if_false, fall_through); |
4962 // clang-format off | 4963 // clang-format off |
4963 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 4964 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
4964 } else if (String::Equals(check, factory->type##_string())) { \ | 4965 } else if (String::Equals(check, factory->type##_string())) { \ |
4965 __ JumpIfSmi(rax, if_false); \ | 4966 __ JumpIfSmi(rax, if_false); \ |
4966 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); \ | 4967 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); \ |
4967 __ CompareRoot(rax, Heap::k##Type##MapRootIndex); \ | 4968 __ CompareRoot(rax, Heap::k##Type##MapRootIndex); \ |
4968 Split(equal, if_true, if_false, fall_through); | 4969 Split(equal, if_true, if_false, fall_through); |
4969 SIMD128_TYPES(SIMD128_TYPE) | 4970 SIMD128_TYPES(SIMD128_TYPE) |
4970 #undef SIMD128_TYPE | 4971 #undef SIMD128_TYPE |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5265 Assembler::target_address_at(call_target_address, | 5266 Assembler::target_address_at(call_target_address, |
5266 unoptimized_code)); | 5267 unoptimized_code)); |
5267 return OSR_AFTER_STACK_CHECK; | 5268 return OSR_AFTER_STACK_CHECK; |
5268 } | 5269 } |
5269 | 5270 |
5270 | 5271 |
5271 } // namespace internal | 5272 } // namespace internal |
5272 } // namespace v8 | 5273 } // namespace v8 |
5273 | 5274 |
5274 #endif // V8_TARGET_ARCH_X64 | 5275 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |