| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3145 HandleArrayCases(masm, feedback, receiver_map, scratch1, x7, false, &miss); | 3145 HandleArrayCases(masm, feedback, receiver_map, scratch1, x7, false, &miss); |
| 3146 | 3146 |
| 3147 __ Bind(&miss); | 3147 __ Bind(&miss); |
| 3148 KeyedLoadIC::GenerateMiss(masm); | 3148 KeyedLoadIC::GenerateMiss(masm); |
| 3149 | 3149 |
| 3150 __ Bind(&load_smi_map); | 3150 __ Bind(&load_smi_map); |
| 3151 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 3151 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
| 3152 __ jmp(&compare_map); | 3152 __ jmp(&compare_map); |
| 3153 } | 3153 } |
| 3154 | 3154 |
| 3155 void StoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
| 3156 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); | |
| 3157 StoreICStub stub(isolate(), state()); | |
| 3158 stub.GenerateForTrampoline(masm); | |
| 3159 } | |
| 3160 | |
| 3161 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { | 3155 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
| 3162 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); | 3156 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); |
| 3163 KeyedStoreICStub stub(isolate(), state()); | 3157 KeyedStoreICStub stub(isolate(), state()); |
| 3164 stub.GenerateForTrampoline(masm); | 3158 stub.GenerateForTrampoline(masm); |
| 3165 } | 3159 } |
| 3166 | 3160 |
| 3167 void StoreICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } | |
| 3168 | |
| 3169 void StoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
| 3170 GenerateImpl(masm, true); | |
| 3171 } | |
| 3172 | |
| 3173 void StoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
| 3174 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); // x1 | |
| 3175 Register key = StoreWithVectorDescriptor::NameRegister(); // x2 | |
| 3176 Register vector = StoreWithVectorDescriptor::VectorRegister(); // x3 | |
| 3177 Register slot = StoreWithVectorDescriptor::SlotRegister(); // x4 | |
| 3178 DCHECK(StoreWithVectorDescriptor::ValueRegister().is(x0)); // x0 | |
| 3179 Register feedback = x5; | |
| 3180 Register receiver_map = x6; | |
| 3181 Register scratch1 = x7; | |
| 3182 | |
| 3183 __ Add(feedback, vector, Operand::UntagSmiAndScale(slot, kPointerSizeLog2)); | |
| 3184 __ Ldr(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); | |
| 3185 | |
| 3186 // Try to quickly handle the monomorphic case without knowing for sure | |
| 3187 // if we have a weak cell in feedback. We do know it's safe to look | |
| 3188 // at WeakCell::kValueOffset. | |
| 3189 Label try_array, load_smi_map, compare_map; | |
| 3190 Label not_array, miss; | |
| 3191 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, | |
| 3192 scratch1, &compare_map, &load_smi_map, &try_array); | |
| 3193 | |
| 3194 // Is it a fixed array? | |
| 3195 __ Bind(&try_array); | |
| 3196 __ Ldr(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | |
| 3197 __ JumpIfNotRoot(scratch1, Heap::kFixedArrayMapRootIndex, ¬_array); | |
| 3198 HandleArrayCases(masm, feedback, receiver_map, scratch1, x8, true, &miss); | |
| 3199 | |
| 3200 __ Bind(¬_array); | |
| 3201 __ JumpIfNotRoot(feedback, Heap::kmegamorphic_symbolRootIndex, &miss); | |
| 3202 masm->isolate()->store_stub_cache()->GenerateProbe( | |
| 3203 masm, receiver, key, feedback, receiver_map, scratch1, x8); | |
| 3204 | |
| 3205 __ Bind(&miss); | |
| 3206 StoreIC::GenerateMiss(masm); | |
| 3207 | |
| 3208 __ Bind(&load_smi_map); | |
| 3209 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | |
| 3210 __ jmp(&compare_map); | |
| 3211 } | |
| 3212 | |
| 3213 void KeyedStoreICStub::Generate(MacroAssembler* masm) { | 3161 void KeyedStoreICStub::Generate(MacroAssembler* masm) { |
| 3214 GenerateImpl(masm, false); | 3162 GenerateImpl(masm, false); |
| 3215 } | 3163 } |
| 3216 | 3164 |
| 3217 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | 3165 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
| 3218 GenerateImpl(masm, true); | 3166 GenerateImpl(masm, true); |
| 3219 } | 3167 } |
| 3220 | 3168 |
| 3221 | 3169 |
| 3222 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register feedback, | 3170 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register feedback, |
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5189 kStackUnwindSpace, NULL, spill_offset, | 5137 kStackUnwindSpace, NULL, spill_offset, |
| 5190 return_value_operand, NULL); | 5138 return_value_operand, NULL); |
| 5191 } | 5139 } |
| 5192 | 5140 |
| 5193 #undef __ | 5141 #undef __ |
| 5194 | 5142 |
| 5195 } // namespace internal | 5143 } // namespace internal |
| 5196 } // namespace v8 | 5144 } // namespace v8 |
| 5197 | 5145 |
| 5198 #endif // V8_TARGET_ARCH_ARM64 | 5146 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |