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