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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/ic-compiler.h" | 10 #include "src/ic/ic-compiler.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 DCHECK(kind() != Code::KEYED_STORE_IC || | 64 DCHECK(kind() != Code::KEYED_STORE_IC || |
65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); | 65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); |
66 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 66 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
67 int receiver_count = types->length(); | 67 int receiver_count = types->length(); |
68 int number_of_handled_maps = 0; | 68 int number_of_handled_maps = 0; |
69 for (int current = 0; current < receiver_count; ++current) { | 69 for (int current = 0; current < receiver_count; ++current) { |
70 Handle<HeapType> type = types->at(current); | 70 Handle<HeapType> type = types->at(current); |
71 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 71 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
72 if (!map->is_deprecated()) { | 72 if (!map->is_deprecated()) { |
73 number_of_handled_maps++; | 73 number_of_handled_maps++; |
| 74 Handle<WeakCell> cell = Map::WeakCellForMap(map); |
| 75 __ CmpWeakValue(map_reg, cell, scratch2()); |
74 Label try_next; | 76 Label try_next; |
75 __ Cmp(map_reg, Operand(map)); | |
76 __ B(ne, &try_next); | 77 __ B(ne, &try_next); |
77 if (type->Is(HeapType::Number())) { | 78 if (type->Is(HeapType::Number())) { |
78 DCHECK(!number_case.is_unused()); | 79 DCHECK(!number_case.is_unused()); |
79 __ Bind(&number_case); | 80 __ Bind(&number_case); |
80 } | 81 } |
81 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET); | 82 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET); |
82 __ Bind(&try_next); | 83 __ Bind(&try_next); |
83 } | 84 } |
84 } | 85 } |
85 DCHECK(number_of_handled_maps != 0); | 86 DCHECK(number_of_handled_maps != 0); |
(...skipping 11 matching lines...) Expand all Loading... |
97 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( | 98 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( |
98 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, | 99 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, |
99 MapHandleList* transitioned_maps) { | 100 MapHandleList* transitioned_maps) { |
100 Label miss; | 101 Label miss; |
101 | 102 |
102 ASM_LOCATION("PropertyICCompiler::CompileStorePolymorphic"); | 103 ASM_LOCATION("PropertyICCompiler::CompileStorePolymorphic"); |
103 | 104 |
104 __ JumpIfSmi(receiver(), &miss); | 105 __ JumpIfSmi(receiver(), &miss); |
105 | 106 |
106 int receiver_count = receiver_maps->length(); | 107 int receiver_count = receiver_maps->length(); |
107 __ Ldr(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 108 Register map_reg = scratch1(); |
| 109 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
108 for (int i = 0; i < receiver_count; i++) { | 110 for (int i = 0; i < receiver_count; i++) { |
109 __ Cmp(scratch1(), Operand(receiver_maps->at(i))); | 111 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_maps->at(i)); |
110 | 112 __ CmpWeakValue(map_reg, cell, scratch2()); |
111 Label skip; | 113 Label skip; |
112 __ B(&skip, ne); | 114 __ B(&skip, ne); |
113 if (!transitioned_maps->at(i).is_null()) { | 115 if (!transitioned_maps->at(i).is_null()) { |
114 // This argument is used by the handler stub. For example, see | 116 // This argument is used by the handler stub. For example, see |
115 // ElementsTransitionGenerator::GenerateMapChangeElementsTransition. | 117 // ElementsTransitionGenerator::GenerateMapChangeElementsTransition. |
116 __ Mov(transition_map(), Operand(transitioned_maps->at(i))); | 118 Handle<WeakCell> cell = Map::WeakCellForMap(transitioned_maps->at(i)); |
| 119 __ LoadWeakValue(transition_map(), cell, &miss); |
117 } | 120 } |
118 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET); | 121 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET); |
119 __ Bind(&skip); | 122 __ Bind(&skip); |
120 } | 123 } |
121 | 124 |
122 __ Bind(&miss); | 125 __ Bind(&miss); |
123 TailCallBuiltin(masm(), MissBuiltin(kind())); | 126 TailCallBuiltin(masm(), MissBuiltin(kind())); |
124 | 127 |
125 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 128 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
126 } | 129 } |
127 | 130 |
128 | 131 |
129 #undef __ | 132 #undef __ |
130 } | 133 } |
131 } // namespace v8::internal | 134 } // namespace v8::internal |
132 | 135 |
133 #endif // V8_TARGET_ARCH_ARM64 | 136 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |