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/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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 6011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6022 __ cmp(input, factory()->undefined_value()); | 6022 __ cmp(input, factory()->undefined_value()); |
6023 __ j(equal, true_label, true_distance); | 6023 __ j(equal, true_label, true_distance); |
6024 __ JumpIfSmi(input, false_label, false_distance); | 6024 __ JumpIfSmi(input, false_label, false_distance); |
6025 // Check for undetectable objects => true. | 6025 // Check for undetectable objects => true. |
6026 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); | 6026 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); |
6027 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 6027 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
6028 1 << Map::kIsUndetectable); | 6028 1 << Map::kIsUndetectable); |
6029 final_branch_condition = not_zero; | 6029 final_branch_condition = not_zero; |
6030 | 6030 |
6031 } else if (String::Equals(type_name, factory()->function_string())) { | 6031 } else if (String::Equals(type_name, factory()->function_string())) { |
6032 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
6033 __ JumpIfSmi(input, false_label, false_distance); | 6032 __ JumpIfSmi(input, false_label, false_distance); |
6034 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); | 6033 // Check for callable and not undetectable objects => true. |
6035 __ j(equal, true_label, true_distance); | 6034 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); |
6036 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); | 6035 __ movzx_b(input, FieldOperand(input, Map::kBitFieldOffset)); |
| 6036 __ and_(input, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
| 6037 __ cmp(input, 1 << Map::kIsCallable); |
6037 final_branch_condition = equal; | 6038 final_branch_condition = equal; |
6038 | 6039 |
6039 } else if (String::Equals(type_name, factory()->object_string())) { | 6040 } else if (String::Equals(type_name, factory()->object_string())) { |
6040 __ JumpIfSmi(input, false_label, false_distance); | 6041 __ JumpIfSmi(input, false_label, false_distance); |
6041 __ cmp(input, factory()->null_value()); | 6042 __ cmp(input, factory()->null_value()); |
6042 __ j(equal, true_label, true_distance); | 6043 __ j(equal, true_label, true_distance); |
6043 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 6044 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 6045 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, input); |
6044 __ j(below, false_label, false_distance); | 6046 __ j(below, false_label, false_distance); |
6045 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 6047 // Check for callable or undetectable objects => false. |
6046 __ j(above, false_label, false_distance); | |
6047 // Check for undetectable objects => false. | |
6048 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 6048 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
6049 1 << Map::kIsUndetectable); | 6049 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
6050 final_branch_condition = zero; | 6050 final_branch_condition = zero; |
6051 | 6051 |
6052 // clang-format off | 6052 // clang-format off |
6053 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 6053 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
6054 } else if (String::Equals(type_name, factory()->type##_string())) { \ | 6054 } else if (String::Equals(type_name, factory()->type##_string())) { \ |
6055 __ JumpIfSmi(input, false_label, false_distance); \ | 6055 __ JumpIfSmi(input, false_label, false_distance); \ |
6056 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \ | 6056 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \ |
6057 factory()->type##_map()); \ | 6057 factory()->type##_map()); \ |
6058 final_branch_condition = equal; | 6058 final_branch_condition = equal; |
6059 SIMD128_TYPES(SIMD128_TYPE) | 6059 SIMD128_TYPES(SIMD128_TYPE) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6361 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6361 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6362 } | 6362 } |
6363 | 6363 |
6364 | 6364 |
6365 #undef __ | 6365 #undef __ |
6366 | 6366 |
6367 } // namespace internal | 6367 } // namespace internal |
6368 } // namespace v8 | 6368 } // namespace v8 |
6369 | 6369 |
6370 #endif // V8_TARGET_ARCH_X87 | 6370 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |