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

Side by Side Diff: src/ic/mips/ic-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/codegen.h" 7 #include "src/codegen.h"
8 #include "src/ic/ic.h" 8 #include "src/ic/ic.h"
9 #include "src/ic/ic-compiler.h" 9 #include "src/ic/ic-compiler.h"
10 #include "src/ic/stub-cache.h" 10 #include "src/ic/stub-cache.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // The return address is in ra. 309 // The return address is in ra.
310 Isolate* isolate = masm->isolate(); 310 Isolate* isolate = masm->isolate();
311 311
312 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), 312 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(),
313 LoadWithVectorDescriptor::VectorRegister())); 313 LoadWithVectorDescriptor::VectorRegister()));
314 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); 314 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1);
315 315
316 LoadIC_PushArgs(masm); 316 LoadIC_PushArgs(masm);
317 317
318 // Perform tail call to the entry. 318 // Perform tail call to the entry.
319 int arg_count = 4; 319 __ TailCallRuntime(Runtime::kLoadIC_Miss);
320 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count);
321 } 320 }
322 321
323 322
324 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 323 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
325 LanguageMode language_mode) { 324 LanguageMode language_mode) {
326 // The return address is in ra. 325 // The return address is in ra.
327 326
328 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); 327 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
329 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); 328 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
330 329
331 // Do tail-call to runtime routine. 330 // Do tail-call to runtime routine.
332 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong 331 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
333 : Runtime::kGetProperty, 332 : Runtime::kGetProperty);
334 2);
335 } 333 }
336 334
337 335
338 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 336 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
339 // The return address is in ra. 337 // The return address is in ra.
340 Isolate* isolate = masm->isolate(); 338 Isolate* isolate = masm->isolate();
341 339
342 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), 340 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(),
343 LoadWithVectorDescriptor::VectorRegister())); 341 LoadWithVectorDescriptor::VectorRegister()));
344 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); 342 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1);
345 343
346 LoadIC_PushArgs(masm); 344 LoadIC_PushArgs(masm);
347 345
348 // Perform tail call to the entry. 346 // Perform tail call to the entry.
349 int arg_count = 4; 347 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
350 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count);
351 } 348 }
352 349
353 350
354 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 351 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
355 LanguageMode language_mode) { 352 LanguageMode language_mode) {
356 // The return address is in ra. 353 // The return address is in ra.
357 354
358 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); 355 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
359 356
360 // Do tail-call to runtime routine. 357 // Do tail-call to runtime routine.
361 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong 358 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
362 : Runtime::kKeyedGetProperty, 359 : Runtime::kKeyedGetProperty);
363 2);
364 } 360 }
365 361
366 362
367 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, 363 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm,
368 LanguageMode language_mode) { 364 LanguageMode language_mode) {
369 // The return address is in ra. 365 // The return address is in ra.
370 Label slow, check_name, index_smi, index_name, property_array_property; 366 Label slow, check_name, index_smi, index_name, property_array_property;
371 Label probe_dictionary, check_number_dictionary; 367 Label probe_dictionary, check_number_dictionary;
372 368
373 Register key = LoadDescriptor::NameRegister(); 369 Register key = LoadDescriptor::NameRegister();
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 738 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
743 StoreDescriptor::ValueRegister(), 739 StoreDescriptor::ValueRegister(),
744 VectorStoreICDescriptor::SlotRegister(), 740 VectorStoreICDescriptor::SlotRegister(),
745 VectorStoreICDescriptor::VectorRegister()); 741 VectorStoreICDescriptor::VectorRegister());
746 } 742 }
747 743
748 744
749 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 745 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
750 StoreIC_PushArgs(masm); 746 StoreIC_PushArgs(masm);
751 747
752 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); 748 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
753 } 749 }
754 750
755 751
756 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 752 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
757 Register receiver = StoreDescriptor::ReceiverRegister(); 753 Register receiver = StoreDescriptor::ReceiverRegister();
758 Register name = StoreDescriptor::NameRegister(); 754 Register name = StoreDescriptor::NameRegister();
759 DCHECK(receiver.is(a1)); 755 DCHECK(receiver.is(a1));
760 DCHECK(name.is(a2)); 756 DCHECK(name.is(a2));
761 DCHECK(StoreDescriptor::ValueRegister().is(a0)); 757 DCHECK(StoreDescriptor::ValueRegister().is(a0));
762 758
763 // Get the receiver from the stack and probe the stub cache. 759 // Get the receiver from the stack and probe the stub cache.
764 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 760 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
765 Code::ComputeHandlerFlags(Code::STORE_IC)); 761 Code::ComputeHandlerFlags(Code::STORE_IC));
766 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, 762 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags,
767 receiver, name, a3, t0, t1, t2); 763 receiver, name, a3, t0, t1, t2);
768 764
769 // Cache miss: Jump to runtime. 765 // Cache miss: Jump to runtime.
770 GenerateMiss(masm); 766 GenerateMiss(masm);
771 } 767 }
772 768
773 769
774 void StoreIC::GenerateMiss(MacroAssembler* masm) { 770 void StoreIC::GenerateMiss(MacroAssembler* masm) {
775 StoreIC_PushArgs(masm); 771 StoreIC_PushArgs(masm);
776 772
777 // Perform tail call to the entry. 773 // Perform tail call to the entry.
778 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); 774 __ TailCallRuntime(Runtime::kStoreIC_Miss);
779 } 775 }
780 776
781 777
782 void StoreIC::GenerateNormal(MacroAssembler* masm) { 778 void StoreIC::GenerateNormal(MacroAssembler* masm) {
783 Label miss; 779 Label miss;
784 Register receiver = StoreDescriptor::ReceiverRegister(); 780 Register receiver = StoreDescriptor::ReceiverRegister();
785 Register name = StoreDescriptor::NameRegister(); 781 Register name = StoreDescriptor::NameRegister();
786 Register value = StoreDescriptor::ValueRegister(); 782 Register value = StoreDescriptor::ValueRegister();
787 Register dictionary = t1; 783 Register dictionary = t1;
788 DCHECK(receiver.is(a1)); 784 DCHECK(receiver.is(a1));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 break; 922 break;
927 default: 923 default:
928 UNIMPLEMENTED(); 924 UNIMPLEMENTED();
929 } 925 }
930 patcher.ChangeBranchCondition(branch_instr, opcode); 926 patcher.ChangeBranchCondition(branch_instr, opcode);
931 } 927 }
932 } // namespace internal 928 } // namespace internal
933 } // namespace v8 929 } // namespace v8
934 930
935 #endif // V8_TARGET_ARCH_MIPS 931 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698