OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 5 #include "src/base/bits.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/cpu-profiler.h" | 8 #include "src/cpu-profiler.h" |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 5811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5822 __ beq(true_label); | 5822 __ beq(true_label); |
5823 __ JumpIfSmi(input, false_label); | 5823 __ JumpIfSmi(input, false_label); |
5824 // Check for undetectable objects => true. | 5824 // Check for undetectable objects => true. |
5825 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); | 5825 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
5826 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5826 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5827 __ ExtractBit(r0, scratch, Map::kIsUndetectable); | 5827 __ ExtractBit(r0, scratch, Map::kIsUndetectable); |
5828 __ cmpi(r0, Operand::Zero()); | 5828 __ cmpi(r0, Operand::Zero()); |
5829 final_branch_condition = ne; | 5829 final_branch_condition = ne; |
5830 | 5830 |
5831 } else if (String::Equals(type_name, factory->function_string())) { | 5831 } else if (String::Equals(type_name, factory->function_string())) { |
5832 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
5833 Register type_reg = scratch; | |
5834 __ JumpIfSmi(input, false_label); | 5832 __ JumpIfSmi(input, false_label); |
5835 __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE); | 5833 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
5836 __ beq(true_label); | 5834 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5837 __ cmpi(type_reg, Operand(JS_FUNCTION_PROXY_TYPE)); | 5835 __ andi(scratch, scratch, |
| 5836 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5837 __ cmpi(scratch, Operand(1 << Map::kIsCallable)); |
5838 final_branch_condition = eq; | 5838 final_branch_condition = eq; |
5839 | 5839 |
5840 } else if (String::Equals(type_name, factory->object_string())) { | 5840 } else if (String::Equals(type_name, factory->object_string())) { |
5841 Register map = scratch; | |
5842 __ JumpIfSmi(input, false_label); | 5841 __ JumpIfSmi(input, false_label); |
5843 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5842 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5844 __ beq(true_label); | 5843 __ beq(true_label); |
5845 __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5844 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
5846 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); | 5845 __ CompareObjectType(input, scratch, ip, FIRST_SPEC_OBJECT_TYPE); |
5847 // Check for undetectable objects => false. | 5846 __ blt(false_label); |
5848 __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5847 // Check for callable or undetectable objects => false. |
5849 __ ExtractBit(r0, scratch, Map::kIsUndetectable); | 5848 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
| 5849 __ andi(r0, scratch, |
| 5850 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5850 __ cmpi(r0, Operand::Zero()); | 5851 __ cmpi(r0, Operand::Zero()); |
5851 final_branch_condition = eq; | 5852 final_branch_condition = eq; |
5852 | 5853 |
5853 // clang-format off | 5854 // clang-format off |
5854 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5855 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5855 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5856 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5856 __ JumpIfSmi(input, false_label); \ | 5857 __ JumpIfSmi(input, false_label); \ |
5857 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ | 5858 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
5858 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ | 5859 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ |
5859 final_branch_condition = eq; | 5860 final_branch_condition = eq; |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6161 __ Push(scope_info); | 6162 __ Push(scope_info); |
6162 __ push(ToRegister(instr->function())); | 6163 __ push(ToRegister(instr->function())); |
6163 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6164 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6164 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6165 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6165 } | 6166 } |
6166 | 6167 |
6167 | 6168 |
6168 #undef __ | 6169 #undef __ |
6169 } // namespace internal | 6170 } // namespace internal |
6170 } // namespace v8 | 6171 } // namespace v8 |
OLD | NEW |