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

Side by Side Diff: src/ic/x64/ic-x64.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_X64 5 #if V8_TARGET_ARCH_X64
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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 665
666 void LoadIC::GenerateMiss(MacroAssembler* masm) { 666 void LoadIC::GenerateMiss(MacroAssembler* masm) {
667 // The return address is on the stack. 667 // The return address is on the stack.
668 668
669 Counters* counters = masm->isolate()->counters(); 669 Counters* counters = masm->isolate()->counters();
670 __ IncrementCounter(counters->load_miss(), 1); 670 __ IncrementCounter(counters->load_miss(), 1);
671 671
672 LoadIC_PushArgs(masm); 672 LoadIC_PushArgs(masm);
673 673
674 // Perform tail call to the entry. 674 // Perform tail call to the entry.
675 int arg_count = 4; 675 __ TailCallRuntime(Runtime::kLoadIC_Miss);
676 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count);
677 } 676 }
678 677
679 678
680 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 679 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
681 LanguageMode language_mode) { 680 LanguageMode language_mode) {
682 // The return address is on the stack. 681 // The return address is on the stack.
683 Register receiver = LoadDescriptor::ReceiverRegister(); 682 Register receiver = LoadDescriptor::ReceiverRegister();
684 Register name = LoadDescriptor::NameRegister(); 683 Register name = LoadDescriptor::NameRegister();
685 684
686 DCHECK(!rbx.is(receiver) && !rbx.is(name)); 685 DCHECK(!rbx.is(receiver) && !rbx.is(name));
687 686
688 __ PopReturnAddressTo(rbx); 687 __ PopReturnAddressTo(rbx);
689 __ Push(receiver); 688 __ Push(receiver);
690 __ Push(name); 689 __ Push(name);
691 __ PushReturnAddressFrom(rbx); 690 __ PushReturnAddressFrom(rbx);
692 691
693 // Do tail-call to runtime routine. 692 // Do tail-call to runtime routine.
694 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong 693 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
695 : Runtime::kGetProperty, 694 : Runtime::kGetProperty);
696 2);
697 } 695 }
698 696
699 697
700 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 698 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
701 // The return address is on the stack. 699 // The return address is on the stack.
702 Counters* counters = masm->isolate()->counters(); 700 Counters* counters = masm->isolate()->counters();
703 __ IncrementCounter(counters->keyed_load_miss(), 1); 701 __ IncrementCounter(counters->keyed_load_miss(), 1);
704 702
705 LoadIC_PushArgs(masm); 703 LoadIC_PushArgs(masm);
706 704
707 // Perform tail call to the entry. 705 // Perform tail call to the entry.
708 int arg_count = 4; 706 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss);
709 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count);
710 } 707 }
711 708
712 709
713 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 710 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
714 LanguageMode language_mode) { 711 LanguageMode language_mode) {
715 // The return address is on the stack. 712 // The return address is on the stack.
716 Register receiver = LoadDescriptor::ReceiverRegister(); 713 Register receiver = LoadDescriptor::ReceiverRegister();
717 Register name = LoadDescriptor::NameRegister(); 714 Register name = LoadDescriptor::NameRegister();
718 715
719 DCHECK(!rbx.is(receiver) && !rbx.is(name)); 716 DCHECK(!rbx.is(receiver) && !rbx.is(name));
720 717
721 __ PopReturnAddressTo(rbx); 718 __ PopReturnAddressTo(rbx);
722 __ Push(receiver); 719 __ Push(receiver);
723 __ Push(name); 720 __ Push(name);
724 __ PushReturnAddressFrom(rbx); 721 __ PushReturnAddressFrom(rbx);
725 722
726 // Do tail-call to runtime routine. 723 // Do tail-call to runtime routine.
727 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong 724 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
728 : Runtime::kKeyedGetProperty, 725 : Runtime::kKeyedGetProperty);
729 2);
730 } 726 }
731 727
732 728
733 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 729 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
734 // This shouldn't be called. 730 // This shouldn't be called.
735 __ int3(); 731 __ int3();
736 } 732 }
737 733
738 734
739 static void StoreIC_PushArgs(MacroAssembler* masm) { 735 static void StoreIC_PushArgs(MacroAssembler* masm) {
(...skipping 14 matching lines...) Expand all
754 __ Push(vector); 750 __ Push(vector);
755 __ PushReturnAddressFrom(temp); 751 __ PushReturnAddressFrom(temp);
756 } 752 }
757 753
758 754
759 void StoreIC::GenerateMiss(MacroAssembler* masm) { 755 void StoreIC::GenerateMiss(MacroAssembler* masm) {
760 // Return address is on the stack. 756 // Return address is on the stack.
761 StoreIC_PushArgs(masm); 757 StoreIC_PushArgs(masm);
762 758
763 // Perform tail call to the entry. 759 // Perform tail call to the entry.
764 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); 760 __ TailCallRuntime(Runtime::kStoreIC_Miss);
765 } 761 }
766 762
767 763
768 void StoreIC::GenerateNormal(MacroAssembler* masm) { 764 void StoreIC::GenerateNormal(MacroAssembler* masm) {
769 Register receiver = StoreDescriptor::ReceiverRegister(); 765 Register receiver = StoreDescriptor::ReceiverRegister();
770 Register name = StoreDescriptor::NameRegister(); 766 Register name = StoreDescriptor::NameRegister();
771 Register value = StoreDescriptor::ValueRegister(); 767 Register value = StoreDescriptor::ValueRegister();
772 Register dictionary = r11; 768 Register dictionary = r11;
773 DCHECK(!AreAliased(dictionary, VectorStoreICDescriptor::VectorRegister(), 769 DCHECK(!AreAliased(dictionary, VectorStoreICDescriptor::VectorRegister(),
774 VectorStoreICDescriptor::SlotRegister())); 770 VectorStoreICDescriptor::SlotRegister()));
(...skipping 10 matching lines...) Expand all
785 __ IncrementCounter(counters->store_normal_miss(), 1); 781 __ IncrementCounter(counters->store_normal_miss(), 1);
786 GenerateMiss(masm); 782 GenerateMiss(masm);
787 } 783 }
788 784
789 785
790 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 786 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
791 // Return address is on the stack. 787 // Return address is on the stack.
792 StoreIC_PushArgs(masm); 788 StoreIC_PushArgs(masm);
793 789
794 // Do tail-call to runtime routine. 790 // Do tail-call to runtime routine.
795 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); 791 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
796 } 792 }
797 793
798 794
799 #undef __ 795 #undef __
800 796
801 797
802 Condition CompareIC::ComputeCondition(Token::Value op) { 798 Condition CompareIC::ComputeCondition(Token::Value op) {
803 switch (op) { 799 switch (op) {
804 case Token::EQ_STRICT: 800 case Token::EQ_STRICT:
805 case Token::EQ: 801 case Token::EQ:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 Condition cc = 860 Condition cc =
865 (check == ENABLE_INLINED_SMI_CHECK) 861 (check == ENABLE_INLINED_SMI_CHECK)
866 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 862 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
867 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 863 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
868 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 864 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
869 } 865 }
870 } // namespace internal 866 } // namespace internal
871 } // namespace v8 867 } // namespace v8
872 868
873 #endif // V8_TARGET_ARCH_X64 869 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698