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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 289 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
290 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 290 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
291 __ li(api_function_address, Operand(ref)); | 291 __ li(api_function_address, Operand(ref)); |
292 | 292 |
293 // Jump to stub. | 293 // Jump to stub. |
294 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 294 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
295 __ TailCallStub(&stub); | 295 __ TailCallStub(&stub); |
296 } | 296 } |
297 | 297 |
298 | 298 |
299 static void StoreIC_PushArgs(MacroAssembler* masm) { | |
300 if (FLAG_vector_stores) { | |
301 __ Push(StoreDescriptor::ReceiverRegister(), | |
302 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), | |
303 VectorStoreICDescriptor::SlotRegister(), | |
304 VectorStoreICDescriptor::VectorRegister()); | |
305 } else { | |
306 __ Push(StoreDescriptor::ReceiverRegister(), | |
307 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); | |
308 } | |
309 } | |
310 | |
311 | |
312 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 299 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
313 StoreIC_PushArgs(masm); | 300 // Push receiver, key and value for runtime call. |
| 301 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
| 302 StoreDescriptor::ValueRegister()); |
314 | 303 |
315 // The slow case calls into the runtime to complete the store without causing | 304 // The slow case calls into the runtime to complete the store without causing |
316 // an IC miss that would otherwise cause a transition to the generic stub. | 305 // an IC miss that would otherwise cause a transition to the generic stub. |
317 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); | 306 __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1); |
318 } | 307 } |
319 | 308 |
320 | 309 |
321 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 310 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
322 StoreIC_PushArgs(masm); | 311 // Push receiver, key and value for runtime call. |
| 312 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
| 313 StoreDescriptor::ValueRegister()); |
323 | 314 |
324 // The slow case calls into the runtime to complete the store without causing | 315 // 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. | 316 // an IC miss that would otherwise cause a transition to the generic stub. |
326 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, | 317 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1); |
327 1); | |
328 } | 318 } |
329 | 319 |
330 | 320 |
331 #undef __ | 321 #undef __ |
332 #define __ ACCESS_MASM(masm()) | 322 #define __ ACCESS_MASM(masm()) |
333 | 323 |
334 | 324 |
335 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 325 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
336 Handle<Name> name) { | 326 Handle<Name> name) { |
337 if (!label->is_unused()) { | 327 if (!label->is_unused()) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 __ bind(&success); | 550 __ bind(&success); |
561 } | 551 } |
562 } | 552 } |
563 | 553 |
564 | 554 |
565 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 555 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
566 if (!miss->is_unused()) { | 556 if (!miss->is_unused()) { |
567 Label success; | 557 Label success; |
568 __ Branch(&success); | 558 __ Branch(&success); |
569 GenerateRestoreName(miss, name); | 559 GenerateRestoreName(miss, name); |
570 if (IC::ICUseVector(kind())) PopVectorAndSlot(); | |
571 TailCallBuiltin(masm(), MissBuiltin(kind())); | 560 TailCallBuiltin(masm(), MissBuiltin(kind())); |
572 __ bind(&success); | 561 __ bind(&success); |
573 } | 562 } |
574 } | 563 } |
575 | 564 |
576 | 565 |
577 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 566 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
578 // Return the constant value. | 567 // Return the constant value. |
579 __ li(v0, value); | 568 __ li(v0, value); |
580 __ Ret(); | 569 __ Ret(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 // Return the generated code. | 769 // Return the generated code. |
781 return GetCode(kind(), Code::NORMAL, name); | 770 return GetCode(kind(), Code::NORMAL, name); |
782 } | 771 } |
783 | 772 |
784 | 773 |
785 #undef __ | 774 #undef __ |
786 } // namespace internal | 775 } // namespace internal |
787 } // namespace v8 | 776 } // namespace v8 |
788 | 777 |
789 #endif // V8_TARGET_ARCH_MIPS | 778 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |