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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | 213 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
214 __ push(name); | 214 __ push(name); |
215 __ push(receiver); | 215 __ push(receiver); |
216 __ push(holder); | 216 __ push(holder); |
217 } | 217 } |
218 | 218 |
219 | 219 |
220 static void CompileCallLoadPropertyWithInterceptor( | 220 static void CompileCallLoadPropertyWithInterceptor( |
221 MacroAssembler* masm, Register receiver, Register holder, Register name, | 221 MacroAssembler* masm, Register receiver, Register holder, Register name, |
222 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 222 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
223 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | |
Igor Sheludko
2015/12/30 14:48:17
Ditto.
| |
224 Runtime::FunctionForId(id)->nargs); | |
223 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 225 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
224 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); | 226 __ CallRuntime(id); |
225 } | 227 } |
226 | 228 |
227 | 229 |
228 // Generate call to api function. | 230 // Generate call to api function. |
229 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 231 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
230 MacroAssembler* masm, const CallOptimization& optimization, | 232 MacroAssembler* masm, const CallOptimization& optimization, |
231 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 233 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
232 bool is_store, Register store_parameter, Register accessor_holder, | 234 bool is_store, Register store_parameter, Register accessor_holder, |
233 int accessor_index) { | 235 int accessor_index) { |
234 DCHECK(!accessor_holder.is(scratch_in)); | 236 DCHECK(!accessor_holder.is(scratch_in)); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 VectorStoreICDescriptor::SlotRegister(), | 319 VectorStoreICDescriptor::SlotRegister(), |
318 VectorStoreICDescriptor::VectorRegister()); | 320 VectorStoreICDescriptor::VectorRegister()); |
319 } | 321 } |
320 | 322 |
321 | 323 |
322 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 324 void NamedStoreHandlerCompiler::GenerateSlow(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::kStoreIC_Slow, 5); | 329 __ TailCallRuntime(Runtime::kStoreIC_Slow); |
328 } | 330 } |
329 | 331 |
330 | 332 |
331 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 333 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
332 StoreIC_PushArgs(masm); | 334 StoreIC_PushArgs(masm); |
333 | 335 |
334 // The slow case calls into the runtime to complete the store without causing | 336 // 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. | 337 // an IC miss that would otherwise cause a transition to the generic stub. |
336 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); | 338 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); |
337 } | 339 } |
338 | 340 |
339 | 341 |
340 #undef __ | 342 #undef __ |
341 #define __ ACCESS_MASM(masm()) | 343 #define __ ACCESS_MASM(masm()) |
342 | 344 |
343 | 345 |
344 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 346 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
345 Handle<Name> name) { | 347 Handle<Name> name) { |
346 if (!label->is_unused()) { | 348 if (!label->is_unused()) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 } | 699 } |
698 | 700 |
699 | 701 |
700 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 702 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
701 // Call the runtime system to load the interceptor. | 703 // Call the runtime system to load the interceptor. |
702 DCHECK(holder()->HasNamedInterceptor()); | 704 DCHECK(holder()->HasNamedInterceptor()); |
703 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 705 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
704 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 706 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
705 holder()); | 707 holder()); |
706 | 708 |
707 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 709 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
708 NamedLoadHandlerCompiler::kInterceptorArgsLength); | |
709 } | 710 } |
710 | 711 |
711 | 712 |
712 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 713 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
713 Handle<JSObject> object, Handle<Name> name, | 714 Handle<JSObject> object, Handle<Name> name, |
714 Handle<ExecutableAccessorInfo> callback) { | 715 Handle<ExecutableAccessorInfo> callback) { |
715 Register holder_reg = Frontend(name); | 716 Register holder_reg = Frontend(name); |
716 | 717 |
717 __ Push(receiver(), holder_reg); // receiver | 718 __ Push(receiver(), holder_reg); // receiver |
718 | 719 |
719 // If the callback cannot leak, then push the callback directly, | 720 // If the callback cannot leak, then push the callback directly, |
720 // otherwise wrap it in a weak cell. | 721 // otherwise wrap it in a weak cell. |
721 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 722 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
722 __ mov(ip, Operand(callback)); | 723 __ mov(ip, Operand(callback)); |
723 } else { | 724 } else { |
724 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 725 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
725 __ mov(ip, Operand(cell)); | 726 __ mov(ip, Operand(cell)); |
726 } | 727 } |
727 __ push(ip); | 728 __ push(ip); |
728 __ mov(ip, Operand(name)); | 729 __ mov(ip, Operand(name)); |
729 __ Push(ip, value()); | 730 __ Push(ip, value()); |
730 | 731 |
731 // Do tail-call to the runtime system. | 732 // Do tail-call to the runtime system. |
732 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); | 733 __ TailCallRuntime(Runtime::kStoreCallbackProperty); |
733 | 734 |
734 // Return the generated code. | 735 // Return the generated code. |
735 return GetCode(kind(), Code::FAST, name); | 736 return GetCode(kind(), Code::FAST, name); |
736 } | 737 } |
737 | 738 |
738 | 739 |
739 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 740 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
740 Handle<Name> name) { | 741 Handle<Name> name) { |
741 __ Push(receiver(), this->name(), value()); | 742 __ Push(receiver(), this->name(), value()); |
742 | 743 |
743 // Do tail-call to the runtime system. | 744 // Do tail-call to the runtime system. |
744 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); | 745 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor); |
745 | 746 |
746 // Return the generated code. | 747 // Return the generated code. |
747 return GetCode(kind(), Code::FAST, name); | 748 return GetCode(kind(), Code::FAST, name); |
748 } | 749 } |
749 | 750 |
750 | 751 |
751 Register NamedStoreHandlerCompiler::value() { | 752 Register NamedStoreHandlerCompiler::value() { |
752 return StoreDescriptor::ValueRegister(); | 753 return StoreDescriptor::ValueRegister(); |
753 } | 754 } |
754 | 755 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
786 // Return the generated code. | 787 // Return the generated code. |
787 return GetCode(kind(), Code::NORMAL, name); | 788 return GetCode(kind(), Code::NORMAL, name); |
788 } | 789 } |
789 | 790 |
790 | 791 |
791 #undef __ | 792 #undef __ |
792 } // namespace internal | 793 } // namespace internal |
793 } // namespace v8 | 794 } // namespace v8 |
794 | 795 |
795 #endif // V8_TARGET_ARCH_ARM | 796 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |