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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); | 208 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
209 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | 209 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
210 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | 210 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
211 __ Push(name, receiver, holder); | 211 __ Push(name, receiver, holder); |
212 } | 212 } |
213 | 213 |
214 | 214 |
215 static void CompileCallLoadPropertyWithInterceptor( | 215 static void CompileCallLoadPropertyWithInterceptor( |
216 MacroAssembler* masm, Register receiver, Register holder, Register name, | 216 MacroAssembler* masm, Register receiver, Register holder, Register name, |
217 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 217 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
| 218 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
| 219 Runtime::FunctionForId(id)->nargs); |
218 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 220 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
219 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); | 221 __ CallRuntime(id); |
220 } | 222 } |
221 | 223 |
222 | 224 |
223 // Generate call to api function. | 225 // Generate call to api function. |
224 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 226 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
225 MacroAssembler* masm, const CallOptimization& optimization, | 227 MacroAssembler* masm, const CallOptimization& optimization, |
226 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 228 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
227 bool is_store, Register store_parameter, Register accessor_holder, | 229 bool is_store, Register store_parameter, Register accessor_holder, |
228 int accessor_index) { | 230 int accessor_index) { |
229 DCHECK(!accessor_holder.is(scratch_in)); | 231 DCHECK(!accessor_holder.is(scratch_in)); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 VectorStoreICDescriptor::SlotRegister(), | 310 VectorStoreICDescriptor::SlotRegister(), |
309 VectorStoreICDescriptor::VectorRegister()); | 311 VectorStoreICDescriptor::VectorRegister()); |
310 } | 312 } |
311 | 313 |
312 | 314 |
313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 315 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
314 StoreIC_PushArgs(masm); | 316 StoreIC_PushArgs(masm); |
315 | 317 |
316 // The slow case calls into the runtime to complete the store without causing | 318 // 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. | 319 // an IC miss that would otherwise cause a transition to the generic stub. |
318 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); | 320 __ TailCallRuntime(Runtime::kStoreIC_Slow); |
319 } | 321 } |
320 | 322 |
321 | 323 |
322 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 324 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
323 StoreIC_PushArgs(masm); | 325 StoreIC_PushArgs(masm); |
324 | 326 |
325 // The slow case calls into the runtime to complete the store without causing | 327 // 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. | 328 // an IC miss that would otherwise cause a transition to the generic stub. |
327 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); | 329 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); |
328 } | 330 } |
329 | 331 |
330 | 332 |
331 #undef __ | 333 #undef __ |
332 #define __ ACCESS_MASM(masm()) | 334 #define __ ACCESS_MASM(masm()) |
333 | 335 |
334 | 336 |
335 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 337 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
336 Handle<Name> name) { | 338 Handle<Name> name) { |
337 if (!label->is_unused()) { | 339 if (!label->is_unused()) { |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 693 } |
692 | 694 |
693 | 695 |
694 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 696 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
695 // Call the runtime system to load the interceptor. | 697 // Call the runtime system to load the interceptor. |
696 DCHECK(holder()->HasNamedInterceptor()); | 698 DCHECK(holder()->HasNamedInterceptor()); |
697 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 699 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
698 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 700 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
699 holder()); | 701 holder()); |
700 | 702 |
701 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 703 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
702 NamedLoadHandlerCompiler::kInterceptorArgsLength); | |
703 } | 704 } |
704 | 705 |
705 | 706 |
706 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 707 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
707 Handle<JSObject> object, Handle<Name> name, | 708 Handle<JSObject> object, Handle<Name> name, |
708 Handle<ExecutableAccessorInfo> callback) { | 709 Handle<ExecutableAccessorInfo> callback) { |
709 Register holder_reg = Frontend(name); | 710 Register holder_reg = Frontend(name); |
710 | 711 |
711 __ Push(receiver(), holder_reg); // Receiver. | 712 __ Push(receiver(), holder_reg); // Receiver. |
712 // If the callback cannot leak, then push the callback directly, | 713 // If the callback cannot leak, then push the callback directly, |
713 // otherwise wrap it in a weak cell. | 714 // otherwise wrap it in a weak cell. |
714 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 715 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
715 __ li(at, Operand(callback)); | 716 __ li(at, Operand(callback)); |
716 } else { | 717 } else { |
717 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 718 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
718 __ li(at, Operand(cell)); | 719 __ li(at, Operand(cell)); |
719 } | 720 } |
720 __ push(at); | 721 __ push(at); |
721 __ li(at, Operand(name)); | 722 __ li(at, Operand(name)); |
722 __ Push(at, value()); | 723 __ Push(at, value()); |
723 | 724 |
724 // Do tail-call to the runtime system. | 725 // Do tail-call to the runtime system. |
725 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); | 726 __ TailCallRuntime(Runtime::kStoreCallbackProperty); |
726 | 727 |
727 // Return the generated code. | 728 // Return the generated code. |
728 return GetCode(kind(), Code::FAST, name); | 729 return GetCode(kind(), Code::FAST, name); |
729 } | 730 } |
730 | 731 |
731 | 732 |
732 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 733 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
733 Handle<Name> name) { | 734 Handle<Name> name) { |
734 __ Push(receiver(), this->name(), value()); | 735 __ Push(receiver(), this->name(), value()); |
735 | 736 |
736 // Do tail-call to the runtime system. | 737 // Do tail-call to the runtime system. |
737 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); | 738 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor); |
738 | 739 |
739 // Return the generated code. | 740 // Return the generated code. |
740 return GetCode(kind(), Code::FAST, name); | 741 return GetCode(kind(), Code::FAST, name); |
741 } | 742 } |
742 | 743 |
743 | 744 |
744 Register NamedStoreHandlerCompiler::value() { | 745 Register NamedStoreHandlerCompiler::value() { |
745 return StoreDescriptor::ValueRegister(); | 746 return StoreDescriptor::ValueRegister(); |
746 } | 747 } |
747 | 748 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 // Return the generated code. | 781 // Return the generated code. |
781 return GetCode(kind(), Code::NORMAL, name); | 782 return GetCode(kind(), Code::NORMAL, name); |
782 } | 783 } |
783 | 784 |
784 | 785 |
785 #undef __ | 786 #undef __ |
786 } // namespace internal | 787 } // namespace internal |
787 } // namespace v8 | 788 } // namespace v8 |
788 | 789 |
789 #endif // V8_TARGET_ARCH_MIPS64 | 790 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |