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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 292 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
293 } | 293 } |
294 | 294 |
295 // Restore context register. | 295 // Restore context register. |
296 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 296 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
297 } | 297 } |
298 __ Ret(); | 298 __ Ret(); |
299 } | 299 } |
300 | 300 |
301 | 301 |
| 302 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 303 if (FLAG_vector_stores) { |
| 304 __ Push(StoreDescriptor::ReceiverRegister(), |
| 305 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), |
| 306 VectorStoreICDescriptor::SlotRegister(), |
| 307 VectorStoreICDescriptor::VectorRegister()); |
| 308 } else { |
| 309 __ Push(StoreDescriptor::ReceiverRegister(), |
| 310 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); |
| 311 } |
| 312 } |
| 313 |
| 314 |
302 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 315 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
303 // Push receiver, name and value for runtime call. | 316 StoreIC_PushArgs(masm); |
304 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
305 StoreDescriptor::ValueRegister()); | |
306 | 317 |
307 // The slow case calls into the runtime to complete the store without causing | 318 // The slow case calls into the runtime to complete the store without causing |
308 // an IC miss that would otherwise cause a transition to the generic stub. | 319 // an IC miss that would otherwise cause a transition to the generic stub. |
309 __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1); | 320 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); |
310 } | 321 } |
311 | 322 |
312 | 323 |
313 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 324 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
314 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); | 325 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); |
315 | 326 StoreIC_PushArgs(masm); |
316 // Push receiver, key and value for runtime call. | |
317 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
318 StoreDescriptor::ValueRegister()); | |
319 | 327 |
320 // The slow case calls into the runtime to complete the store without causing | 328 // The slow case calls into the runtime to complete the store without causing |
321 // an IC miss that would otherwise cause a transition to the generic stub. | 329 // an IC miss that would otherwise cause a transition to the generic stub. |
322 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1); | 330 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, |
| 331 1); |
323 } | 332 } |
324 | 333 |
325 | 334 |
326 #undef __ | 335 #undef __ |
327 #define __ ACCESS_MASM(masm()) | 336 #define __ ACCESS_MASM(masm()) |
328 | 337 |
329 | 338 |
330 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 339 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
331 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 340 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
332 Label miss; | 341 Label miss; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 } | 620 } |
612 } | 621 } |
613 | 622 |
614 | 623 |
615 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 624 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
616 if (!miss->is_unused()) { | 625 if (!miss->is_unused()) { |
617 Label success; | 626 Label success; |
618 __ B(&success); | 627 __ B(&success); |
619 | 628 |
620 GenerateRestoreName(miss, name); | 629 GenerateRestoreName(miss, name); |
| 630 if (IC::ICUseVector(kind())) PopVectorAndSlot(); |
621 TailCallBuiltin(masm(), MissBuiltin(kind())); | 631 TailCallBuiltin(masm(), MissBuiltin(kind())); |
622 | 632 |
623 __ Bind(&success); | 633 __ Bind(&success); |
624 } | 634 } |
625 } | 635 } |
626 | 636 |
627 | 637 |
628 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 638 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
629 // Return the constant value. | 639 // Return the constant value. |
630 __ LoadObject(x0, value); | 640 __ LoadObject(x0, value); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 // Return the generated code. | 801 // Return the generated code. |
792 return GetCode(kind(), Code::FAST, name); | 802 return GetCode(kind(), Code::FAST, name); |
793 } | 803 } |
794 | 804 |
795 | 805 |
796 #undef __ | 806 #undef __ |
797 } // namespace internal | 807 } // namespace internal |
798 } // namespace v8 | 808 } // namespace v8 |
799 | 809 |
800 #endif // V8_TARGET_ARCH_IA32 | 810 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |