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