| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 VectorStoreICDescriptor::SlotRegister(), | 308 VectorStoreICDescriptor::SlotRegister(), |
| 309 VectorStoreICDescriptor::VectorRegister()); | 309 VectorStoreICDescriptor::VectorRegister()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
| 314 StoreIC_PushArgs(masm); | 314 StoreIC_PushArgs(masm); |
| 315 | 315 |
| 316 // The slow case calls into the runtime to complete the store without causing | 316 // The slow case calls into the runtime to complete the store without causing |
| 317 // an IC miss that would otherwise cause a transition to the generic stub. | 317 // an IC miss that would otherwise cause a transition to the generic stub. |
| 318 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5, 1); | 318 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); |
| 319 } | 319 } |
| 320 | 320 |
| 321 | 321 |
| 322 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 322 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
| 323 StoreIC_PushArgs(masm); | 323 StoreIC_PushArgs(masm); |
| 324 | 324 |
| 325 // 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 |
| 326 // 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. |
| 327 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5, 1); | 327 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); |
| 328 } | 328 } |
| 329 | 329 |
| 330 | 330 |
| 331 #undef __ | 331 #undef __ |
| 332 #define __ ACCESS_MASM(masm()) | 332 #define __ ACCESS_MASM(masm()) |
| 333 | 333 |
| 334 | 334 |
| 335 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 335 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
| 336 Handle<Name> name) { | 336 Handle<Name> name) { |
| 337 if (!label->is_unused()) { | 337 if (!label->is_unused()) { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 692 |
| 693 | 693 |
| 694 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 694 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
| 695 // Call the runtime system to load the interceptor. | 695 // Call the runtime system to load the interceptor. |
| 696 DCHECK(holder()->HasNamedInterceptor()); | 696 DCHECK(holder()->HasNamedInterceptor()); |
| 697 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 697 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
| 698 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 698 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
| 699 holder()); | 699 holder()); |
| 700 | 700 |
| 701 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 701 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, |
| 702 NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); | 702 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 703 } | 703 } |
| 704 | 704 |
| 705 | 705 |
| 706 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 706 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 707 Handle<JSObject> object, Handle<Name> name, | 707 Handle<JSObject> object, Handle<Name> name, |
| 708 Handle<ExecutableAccessorInfo> callback) { | 708 Handle<ExecutableAccessorInfo> callback) { |
| 709 Register holder_reg = Frontend(name); | 709 Register holder_reg = Frontend(name); |
| 710 | 710 |
| 711 __ Push(receiver(), holder_reg); // Receiver. | 711 __ Push(receiver(), holder_reg); // Receiver. |
| 712 // If the callback cannot leak, then push the callback directly, | 712 // If the callback cannot leak, then push the callback directly, |
| 713 // otherwise wrap it in a weak cell. | 713 // otherwise wrap it in a weak cell. |
| 714 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 714 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
| 715 __ li(at, Operand(callback)); | 715 __ li(at, Operand(callback)); |
| 716 } else { | 716 } else { |
| 717 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 717 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 718 __ li(at, Operand(cell)); | 718 __ li(at, Operand(cell)); |
| 719 } | 719 } |
| 720 __ push(at); | 720 __ push(at); |
| 721 __ li(at, Operand(name)); | 721 __ li(at, Operand(name)); |
| 722 __ Push(at, value()); | 722 __ Push(at, value()); |
| 723 | 723 |
| 724 // Do tail-call to the runtime system. | 724 // Do tail-call to the runtime system. |
| 725 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1); | 725 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); |
| 726 | 726 |
| 727 // Return the generated code. | 727 // Return the generated code. |
| 728 return GetCode(kind(), Code::FAST, name); | 728 return GetCode(kind(), Code::FAST, name); |
| 729 } | 729 } |
| 730 | 730 |
| 731 | 731 |
| 732 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 732 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
| 733 Handle<Name> name) { | 733 Handle<Name> name) { |
| 734 __ Push(receiver(), this->name(), value()); | 734 __ Push(receiver(), this->name(), value()); |
| 735 | 735 |
| 736 // Do tail-call to the runtime system. | 736 // Do tail-call to the runtime system. |
| 737 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1); | 737 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); |
| 738 | 738 |
| 739 // Return the generated code. | 739 // Return the generated code. |
| 740 return GetCode(kind(), Code::FAST, name); | 740 return GetCode(kind(), Code::FAST, name); |
| 741 } | 741 } |
| 742 | 742 |
| 743 | 743 |
| 744 Register NamedStoreHandlerCompiler::value() { | 744 Register NamedStoreHandlerCompiler::value() { |
| 745 return StoreDescriptor::ValueRegister(); | 745 return StoreDescriptor::ValueRegister(); |
| 746 } | 746 } |
| 747 | 747 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 // Return the generated code. | 780 // Return the generated code. |
| 781 return GetCode(kind(), Code::NORMAL, name); | 781 return GetCode(kind(), Code::NORMAL, name); |
| 782 } | 782 } |
| 783 | 783 |
| 784 | 784 |
| 785 #undef __ | 785 #undef __ |
| 786 } // namespace internal | 786 } // namespace internal |
| 787 } // namespace v8 | 787 } // namespace v8 |
| 788 | 788 |
| 789 #endif // V8_TARGET_ARCH_MIPS | 789 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |