Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: src/ic/arm/handler-compiler-arm.cc

Issue 1553703002: [runtime] TailCallRuntime and CallRuntime should use default argument counts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-12-29_TailCallRuntime_default_result_size_1_1550923002
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_ARM 5 #if V8_TARGET_ARCH_ARM
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); 215 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3);
216 __ push(name); 216 __ push(name);
217 __ push(receiver); 217 __ push(receiver);
218 __ push(holder); 218 __ push(holder);
219 } 219 }
220 220
221 221
222 static void CompileCallLoadPropertyWithInterceptor( 222 static void CompileCallLoadPropertyWithInterceptor(
223 MacroAssembler* masm, Register receiver, Register holder, Register name, 223 MacroAssembler* masm, Register receiver, Register holder, Register name,
224 Handle<JSObject> holder_obj, Runtime::FunctionId id) { 224 Handle<JSObject> holder_obj, Runtime::FunctionId id) {
225 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength ==
Igor Sheludko 2015/12/30 14:48:17 DCHECK_EQ
226 Runtime::FunctionForId(id)->nargs);
225 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 227 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
226 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); 228 __ CallRuntime(id);
227 } 229 }
228 230
229 231
230 // Generate call to api function. 232 // Generate call to api function.
231 void PropertyHandlerCompiler::GenerateApiAccessorCall( 233 void PropertyHandlerCompiler::GenerateApiAccessorCall(
232 MacroAssembler* masm, const CallOptimization& optimization, 234 MacroAssembler* masm, const CallOptimization& optimization,
233 Handle<Map> receiver_map, Register receiver, Register scratch_in, 235 Handle<Map> receiver_map, Register receiver, Register scratch_in,
234 bool is_store, Register store_parameter, Register accessor_holder, 236 bool is_store, Register store_parameter, Register accessor_holder,
235 int accessor_index) { 237 int accessor_index) {
236 DCHECK(!accessor_holder.is(scratch_in)); 238 DCHECK(!accessor_holder.is(scratch_in));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 VectorStoreICDescriptor::SlotRegister(), 320 VectorStoreICDescriptor::SlotRegister(),
319 VectorStoreICDescriptor::VectorRegister()); 321 VectorStoreICDescriptor::VectorRegister());
320 } 322 }
321 323
322 324
323 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { 325 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
324 StoreIC_PushArgs(masm); 326 StoreIC_PushArgs(masm);
325 327
326 // The slow case calls into the runtime to complete the store without causing 328 // The slow case calls into the runtime to complete the store without causing
327 // an IC miss that would otherwise cause a transition to the generic stub. 329 // an IC miss that would otherwise cause a transition to the generic stub.
328 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); 330 __ TailCallRuntime(Runtime::kStoreIC_Slow);
329 } 331 }
330 332
331 333
332 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { 334 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
333 StoreIC_PushArgs(masm); 335 StoreIC_PushArgs(masm);
334 336
335 // The slow case calls into the runtime to complete the store without causing 337 // The slow case calls into the runtime to complete the store without causing
336 // an IC miss that would otherwise cause a transition to the generic stub. 338 // an IC miss that would otherwise cause a transition to the generic stub.
337 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); 339 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
338 } 340 }
339 341
340 342
341 #undef __ 343 #undef __
342 #define __ ACCESS_MASM(masm()) 344 #define __ ACCESS_MASM(masm())
343 345
344 346
345 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, 347 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
346 Handle<Name> name) { 348 Handle<Name> name) {
347 if (!label->is_unused()) { 349 if (!label->is_unused()) {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 702 }
701 703
702 704
703 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { 705 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
704 // Call the runtime system to load the interceptor. 706 // Call the runtime system to load the interceptor.
705 DCHECK(holder()->HasNamedInterceptor()); 707 DCHECK(holder()->HasNamedInterceptor());
706 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); 708 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
707 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), 709 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
708 holder()); 710 holder());
709 711
710 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, 712 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor);
711 NamedLoadHandlerCompiler::kInterceptorArgsLength);
712 } 713 }
713 714
714 715
715 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( 716 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
716 Handle<JSObject> object, Handle<Name> name, 717 Handle<JSObject> object, Handle<Name> name,
717 Handle<ExecutableAccessorInfo> callback) { 718 Handle<ExecutableAccessorInfo> callback) {
718 Register holder_reg = Frontend(name); 719 Register holder_reg = Frontend(name);
719 720
720 __ push(receiver()); // receiver 721 __ push(receiver()); // receiver
721 __ push(holder_reg); 722 __ push(holder_reg);
722 723
723 // If the callback cannot leak, then push the callback directly, 724 // If the callback cannot leak, then push the callback directly,
724 // otherwise wrap it in a weak cell. 725 // otherwise wrap it in a weak cell.
725 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { 726 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) {
726 __ mov(ip, Operand(callback)); 727 __ mov(ip, Operand(callback));
727 } else { 728 } else {
728 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); 729 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback);
729 __ mov(ip, Operand(cell)); 730 __ mov(ip, Operand(cell));
730 } 731 }
731 __ push(ip); 732 __ push(ip);
732 __ mov(ip, Operand(name)); 733 __ mov(ip, Operand(name));
733 __ Push(ip, value()); 734 __ Push(ip, value());
734 735
735 // Do tail-call to the runtime system. 736 // Do tail-call to the runtime system.
736 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); 737 __ TailCallRuntime(Runtime::kStoreCallbackProperty);
737 738
738 // Return the generated code. 739 // Return the generated code.
739 return GetCode(kind(), Code::FAST, name); 740 return GetCode(kind(), Code::FAST, name);
740 } 741 }
741 742
742 743
743 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( 744 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
744 Handle<Name> name) { 745 Handle<Name> name) {
745 __ Push(receiver(), this->name(), value()); 746 __ Push(receiver(), this->name(), value());
746 747
747 // Do tail-call to the runtime system. 748 // Do tail-call to the runtime system.
748 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); 749 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor);
749 750
750 // Return the generated code. 751 // Return the generated code.
751 return GetCode(kind(), Code::FAST, name); 752 return GetCode(kind(), Code::FAST, name);
752 } 753 }
753 754
754 755
755 Register NamedStoreHandlerCompiler::value() { 756 Register NamedStoreHandlerCompiler::value() {
756 return StoreDescriptor::ValueRegister(); 757 return StoreDescriptor::ValueRegister();
757 } 758 }
758 759
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 // Return the generated code. 791 // Return the generated code.
791 return GetCode(kind(), Code::NORMAL, name); 792 return GetCode(kind(), Code::NORMAL, name);
792 } 793 }
793 794
794 795
795 #undef __ 796 #undef __
796 } // namespace internal 797 } // namespace internal
797 } // namespace v8 798 } // namespace v8
798 799
799 #endif // V8_TARGET_ARCH_ARM 800 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698