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 #include "src/arm64/frames-arm64.h" | 5 #include "src/arm64/frames-arm64.h" |
6 #include "src/arm64/lithium-codegen-arm64.h" | 6 #include "src/arm64/lithium-codegen-arm64.h" |
7 #include "src/arm64/lithium-gap-resolver-arm64.h" | 7 #include "src/arm64/lithium-gap-resolver-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 5835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5846 Register scratch = ToRegister(instr->temp1()); | 5846 Register scratch = ToRegister(instr->temp1()); |
5847 | 5847 |
5848 __ JumpIfRoot(value, Heap::kUndefinedValueRootIndex, true_label); | 5848 __ JumpIfRoot(value, Heap::kUndefinedValueRootIndex, true_label); |
5849 __ JumpIfSmi(value, false_label); | 5849 __ JumpIfSmi(value, false_label); |
5850 // Check for undetectable objects and jump to the true branch in this case. | 5850 // Check for undetectable objects and jump to the true branch in this case. |
5851 __ Ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); | 5851 __ Ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); |
5852 __ Ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5852 __ Ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5853 EmitTestAndBranch(instr, ne, scratch, 1 << Map::kIsUndetectable); | 5853 EmitTestAndBranch(instr, ne, scratch, 1 << Map::kIsUndetectable); |
5854 | 5854 |
5855 } else if (String::Equals(type_name, factory->function_string())) { | 5855 } else if (String::Equals(type_name, factory->function_string())) { |
5856 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
5857 DCHECK(instr->temp1() != NULL); | 5856 DCHECK(instr->temp1() != NULL); |
5858 Register type = ToRegister(instr->temp1()); | 5857 Register scratch = ToRegister(instr->temp1()); |
5859 | 5858 |
5860 __ JumpIfSmi(value, false_label); | 5859 __ JumpIfSmi(value, false_label); |
5861 __ JumpIfObjectType(value, type, type, JS_FUNCTION_TYPE, true_label); | 5860 __ Ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); |
5862 // HeapObject's type has been loaded into type register by JumpIfObjectType. | 5861 __ Ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5863 EmitCompareAndBranch(instr, eq, type, JS_FUNCTION_PROXY_TYPE); | 5862 __ And(scratch, scratch, |
| 5863 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
| 5864 EmitCompareAndBranch(instr, eq, scratch, 1 << Map::kIsCallable); |
5864 | 5865 |
5865 } else if (String::Equals(type_name, factory->object_string())) { | 5866 } else if (String::Equals(type_name, factory->object_string())) { |
5866 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); | 5867 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
5867 Register map = ToRegister(instr->temp1()); | 5868 Register map = ToRegister(instr->temp1()); |
5868 Register scratch = ToRegister(instr->temp2()); | 5869 Register scratch = ToRegister(instr->temp2()); |
5869 | 5870 |
5870 __ JumpIfSmi(value, false_label); | 5871 __ JumpIfSmi(value, false_label); |
5871 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); | 5872 __ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label); |
5872 __ JumpIfObjectType(value, map, scratch, | 5873 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
5873 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label, lt); | 5874 __ JumpIfObjectType(value, map, scratch, FIRST_SPEC_OBJECT_TYPE, |
5874 __ CompareInstanceType(map, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5875 false_label, lt); |
5875 __ B(gt, false_label); | 5876 // Check for callable or undetectable objects => false. |
5876 // Check for undetectable objects => false. | |
5877 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5877 __ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
5878 EmitTestAndBranch(instr, eq, scratch, 1 << Map::kIsUndetectable); | 5878 EmitTestAndBranch(instr, eq, scratch, |
| 5879 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
5879 | 5880 |
5880 // clang-format off | 5881 // clang-format off |
5881 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5882 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5882 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5883 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5883 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \ | 5884 DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \ |
5884 Register map = ToRegister(instr->temp1()); \ | 5885 Register map = ToRegister(instr->temp1()); \ |
5885 \ | 5886 \ |
5886 __ JumpIfSmi(value, false_label); \ | 5887 __ JumpIfSmi(value, false_label); \ |
5887 __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \ | 5888 __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \ |
5888 __ CompareRoot(map, Heap::k##Type##MapRootIndex); \ | 5889 __ CompareRoot(map, Heap::k##Type##MapRootIndex); \ |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6045 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6046 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6046 __ Push(scope_info); | 6047 __ Push(scope_info); |
6047 __ Push(ToRegister(instr->function())); | 6048 __ Push(ToRegister(instr->function())); |
6048 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6049 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6049 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6050 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6050 } | 6051 } |
6051 | 6052 |
6052 | 6053 |
6053 } // namespace internal | 6054 } // namespace internal |
6054 } // namespace v8 | 6055 } // namespace v8 |
OLD | NEW |