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