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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 299 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
300 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 300 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
301 __ mov(api_function_address, Operand(ref)); | 301 __ mov(api_function_address, Operand(ref)); |
302 | 302 |
303 // Jump to stub. | 303 // Jump to stub. |
304 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 304 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
305 __ TailCallStub(&stub); | 305 __ TailCallStub(&stub); |
306 } | 306 } |
307 | 307 |
308 | 308 |
| 309 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 310 if (FLAG_vector_stores) { |
| 311 __ Push(StoreDescriptor::ReceiverRegister(), |
| 312 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), |
| 313 VectorStoreICDescriptor::SlotRegister(), |
| 314 VectorStoreICDescriptor::VectorRegister()); |
| 315 } else { |
| 316 __ Push(StoreDescriptor::ReceiverRegister(), |
| 317 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); |
| 318 } |
| 319 } |
| 320 |
| 321 |
309 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 322 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
310 // Push receiver, key and value for runtime call. | 323 StoreIC_PushArgs(masm); |
311 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
312 StoreDescriptor::ValueRegister()); | |
313 | 324 |
314 // The slow case calls into the runtime to complete the store without causing | 325 // The slow case calls into the runtime to complete the store without causing |
315 // an IC miss that would otherwise cause a transition to the generic stub. | 326 // an IC miss that would otherwise cause a transition to the generic stub. |
316 __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1); | 327 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); |
317 } | 328 } |
318 | 329 |
319 | 330 |
320 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 331 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
321 // Push receiver, key and value for runtime call. | 332 StoreIC_PushArgs(masm); |
322 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
323 StoreDescriptor::ValueRegister()); | |
324 | 333 |
325 // The slow case calls into the runtime to complete the store without causing | 334 // The slow case calls into the runtime to complete the store without causing |
326 // an IC miss that would otherwise cause a transition to the generic stub. | 335 // an IC miss that would otherwise cause a transition to the generic stub. |
327 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1); | 336 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, |
| 337 1); |
328 } | 338 } |
329 | 339 |
330 | 340 |
331 #undef __ | 341 #undef __ |
332 #define __ ACCESS_MASM(masm()) | 342 #define __ ACCESS_MASM(masm()) |
333 | 343 |
334 | 344 |
335 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 345 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
336 Handle<Name> name) { | 346 Handle<Name> name) { |
337 if (!label->is_unused()) { | 347 if (!label->is_unused()) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 __ bind(&success); | 570 __ bind(&success); |
561 } | 571 } |
562 } | 572 } |
563 | 573 |
564 | 574 |
565 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 575 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
566 if (!miss->is_unused()) { | 576 if (!miss->is_unused()) { |
567 Label success; | 577 Label success; |
568 __ b(&success); | 578 __ b(&success); |
569 GenerateRestoreName(miss, name); | 579 GenerateRestoreName(miss, name); |
| 580 if (IC::ICUseVector(kind())) PopVectorAndSlot(); |
570 TailCallBuiltin(masm(), MissBuiltin(kind())); | 581 TailCallBuiltin(masm(), MissBuiltin(kind())); |
571 __ bind(&success); | 582 __ bind(&success); |
572 } | 583 } |
573 } | 584 } |
574 | 585 |
575 | 586 |
576 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 587 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
577 // Return the constant value. | 588 // Return the constant value. |
578 __ Move(r0, value); | 589 __ Move(r0, value); |
579 __ Ret(); | 590 __ Ret(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 // Return the generated code. | 790 // Return the generated code. |
780 return GetCode(kind(), Code::NORMAL, name); | 791 return GetCode(kind(), Code::NORMAL, name); |
781 } | 792 } |
782 | 793 |
783 | 794 |
784 #undef __ | 795 #undef __ |
785 } // namespace internal | 796 } // namespace internal |
786 } // namespace v8 | 797 } // namespace v8 |
787 | 798 |
788 #endif // V8_TARGET_ARCH_ARM | 799 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |