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 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 5746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5757 __ JumpIfSmi(input, false_label); | 5757 __ JumpIfSmi(input, false_label); |
5758 // Check for undetectable objects => true. | 5758 // Check for undetectable objects => true. |
5759 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); | 5759 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); |
5760 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); | 5760 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); |
5761 __ And(at, at, 1 << Map::kIsUndetectable); | 5761 __ And(at, at, 1 << Map::kIsUndetectable); |
5762 *cmp1 = at; | 5762 *cmp1 = at; |
5763 *cmp2 = Operand(zero_reg); | 5763 *cmp2 = Operand(zero_reg); |
5764 final_branch_condition = ne; | 5764 final_branch_condition = ne; |
5765 | 5765 |
5766 } else if (String::Equals(type_name, factory->function_string())) { | 5766 } else if (String::Equals(type_name, factory->function_string())) { |
5767 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
5768 __ JumpIfSmi(input, false_label); | 5767 __ JumpIfSmi(input, false_label); |
5769 __ GetObjectType(input, scratch, input); | 5768 __ ld(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
5770 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); | 5769 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5771 *cmp1 = input; | 5770 __ And(scratch, scratch, |
5772 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); | 5771 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5772 *cmp1 = scratch; |
| 5773 *cmp2 = Operand(1 << Map::kIsCallable); |
5773 final_branch_condition = eq; | 5774 final_branch_condition = eq; |
5774 | 5775 |
5775 } else if (String::Equals(type_name, factory->object_string())) { | 5776 } else if (String::Equals(type_name, factory->object_string())) { |
5776 __ JumpIfSmi(input, false_label); | 5777 __ JumpIfSmi(input, false_label); |
5777 __ LoadRoot(at, Heap::kNullValueRootIndex); | 5778 __ LoadRoot(at, Heap::kNullValueRootIndex); |
5778 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5779 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
5779 Register map = input; | 5780 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
5780 __ GetObjectType(input, map, scratch); | 5781 __ GetObjectType(input, scratch, scratch1()); |
5781 __ Branch(false_label, | 5782 __ Branch(false_label, lt, scratch1(), Operand(FIRST_SPEC_OBJECT_TYPE)); |
5782 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5783 // Check for callable or undetectable objects => false. |
5783 __ Branch(USE_DELAY_SLOT, false_label, | 5784 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5784 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5785 __ And(at, scratch, |
5785 // map is still valid, so the BitField can be loaded in delay slot. | 5786 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5786 // Check for undetectable objects => false. | |
5787 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | |
5788 __ And(at, at, 1 << Map::kIsUndetectable); | |
5789 *cmp1 = at; | 5787 *cmp1 = at; |
5790 *cmp2 = Operand(zero_reg); | 5788 *cmp2 = Operand(zero_reg); |
5791 final_branch_condition = eq; | 5789 final_branch_condition = eq; |
5792 | 5790 |
5793 // clang-format off | 5791 // clang-format off |
5794 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5792 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5795 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5793 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5796 __ JumpIfSmi(input, false_label); \ | 5794 __ JumpIfSmi(input, false_label); \ |
5797 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ | 5795 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
5798 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ | 5796 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6114 __ Push(at, ToRegister(instr->function())); | 6112 __ Push(at, ToRegister(instr->function())); |
6115 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6113 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6116 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6114 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6117 } | 6115 } |
6118 | 6116 |
6119 | 6117 |
6120 #undef __ | 6118 #undef __ |
6121 | 6119 |
6122 } // namespace internal | 6120 } // namespace internal |
6123 } // namespace v8 | 6121 } // namespace v8 |
OLD | NEW |