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

Side by Side Diff: src/ic/x64/ic-x64.cc

Issue 1248303002: Unify runtime-style IC functions with Runtime intrinsics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make mips work Created 5 years, 5 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
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 669
670 void LoadIC::GenerateMiss(MacroAssembler* masm) { 670 void LoadIC::GenerateMiss(MacroAssembler* masm) {
671 // The return address is on the stack. 671 // The return address is on the stack.
672 672
673 Counters* counters = masm->isolate()->counters(); 673 Counters* counters = masm->isolate()->counters();
674 __ IncrementCounter(counters->load_miss(), 1); 674 __ IncrementCounter(counters->load_miss(), 1);
675 675
676 LoadIC_PushArgs(masm); 676 LoadIC_PushArgs(masm);
677 677
678 // Perform tail call to the entry. 678 // Perform tail call to the entry.
679 ExternalReference ref =
680 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
681 int arg_count = 4; 679 int arg_count = 4;
682 __ TailCallExternalReference(ref, arg_count, 1); 680 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
683 } 681 }
684 682
685 683
686 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 684 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
687 LanguageMode language_mode) { 685 LanguageMode language_mode) {
688 // The return address is on the stack. 686 // The return address is on the stack.
689 Register receiver = LoadDescriptor::ReceiverRegister(); 687 Register receiver = LoadDescriptor::ReceiverRegister();
690 Register name = LoadDescriptor::NameRegister(); 688 Register name = LoadDescriptor::NameRegister();
691 689
692 DCHECK(!rbx.is(receiver) && !rbx.is(name)); 690 DCHECK(!rbx.is(receiver) && !rbx.is(name));
(...skipping 11 matching lines...) Expand all
704 702
705 703
706 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 704 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
707 // The return address is on the stack. 705 // The return address is on the stack.
708 Counters* counters = masm->isolate()->counters(); 706 Counters* counters = masm->isolate()->counters();
709 __ IncrementCounter(counters->keyed_load_miss(), 1); 707 __ IncrementCounter(counters->keyed_load_miss(), 1);
710 708
711 LoadIC_PushArgs(masm); 709 LoadIC_PushArgs(masm);
712 710
713 // Perform tail call to the entry. 711 // Perform tail call to the entry.
714 ExternalReference ref =
715 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
716 int arg_count = 4; 712 int arg_count = 4;
717 __ TailCallExternalReference(ref, arg_count, 1); 713 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
718 } 714 }
719 715
720 716
721 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 717 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
722 LanguageMode language_mode) { 718 LanguageMode language_mode) {
723 // The return address is on the stack. 719 // The return address is on the stack.
724 Register receiver = LoadDescriptor::ReceiverRegister(); 720 Register receiver = LoadDescriptor::ReceiverRegister();
725 Register name = LoadDescriptor::NameRegister(); 721 Register name = LoadDescriptor::NameRegister();
726 722
727 DCHECK(!rbx.is(receiver) && !rbx.is(name)); 723 DCHECK(!rbx.is(receiver) && !rbx.is(name));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 __ Push(value); 762 __ Push(value);
767 __ PushReturnAddressFrom(rbx); 763 __ PushReturnAddressFrom(rbx);
768 } 764 }
769 765
770 766
771 void StoreIC::GenerateMiss(MacroAssembler* masm) { 767 void StoreIC::GenerateMiss(MacroAssembler* masm) {
772 // Return address is on the stack. 768 // Return address is on the stack.
773 StoreIC_PushArgs(masm); 769 StoreIC_PushArgs(masm);
774 770
775 // Perform tail call to the entry. 771 // Perform tail call to the entry.
776 ExternalReference ref = 772 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
777 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
778 __ TailCallExternalReference(ref, 3, 1);
779 } 773 }
780 774
781 775
782 void StoreIC::GenerateNormal(MacroAssembler* masm) { 776 void StoreIC::GenerateNormal(MacroAssembler* masm) {
783 Register receiver = StoreDescriptor::ReceiverRegister(); 777 Register receiver = StoreDescriptor::ReceiverRegister();
784 Register name = StoreDescriptor::NameRegister(); 778 Register name = StoreDescriptor::NameRegister();
785 Register value = StoreDescriptor::ValueRegister(); 779 Register value = StoreDescriptor::ValueRegister();
786 Register dictionary = rbx; 780 Register dictionary = rbx;
787 781
788 Label miss; 782 Label miss;
789 783
790 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); 784 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset));
791 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); 785 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9);
792 Counters* counters = masm->isolate()->counters(); 786 Counters* counters = masm->isolate()->counters();
793 __ IncrementCounter(counters->store_normal_hit(), 1); 787 __ IncrementCounter(counters->store_normal_hit(), 1);
794 __ ret(0); 788 __ ret(0);
795 789
796 __ bind(&miss); 790 __ bind(&miss);
797 __ IncrementCounter(counters->store_normal_miss(), 1); 791 __ IncrementCounter(counters->store_normal_miss(), 1);
798 GenerateMiss(masm); 792 GenerateMiss(masm);
799 } 793 }
800 794
801 795
802 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 796 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
803 // Return address is on the stack. 797 // Return address is on the stack.
804 StoreIC_PushArgs(masm); 798 StoreIC_PushArgs(masm);
805 799
806 // Do tail-call to runtime routine. 800 // Do tail-call to runtime routine.
807 ExternalReference ref = 801 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
808 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
809 __ TailCallExternalReference(ref, 3, 1);
810 } 802 }
811 803
812 804
813 #undef __ 805 #undef __
814 806
815 807
816 Condition CompareIC::ComputeCondition(Token::Value op) { 808 Condition CompareIC::ComputeCondition(Token::Value op) {
817 switch (op) { 809 switch (op) {
818 case Token::EQ_STRICT: 810 case Token::EQ_STRICT:
819 case Token::EQ: 811 case Token::EQ:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 Condition cc = 869 Condition cc =
878 (check == ENABLE_INLINED_SMI_CHECK) 870 (check == ENABLE_INLINED_SMI_CHECK)
879 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 871 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
880 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 872 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
881 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 873 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
882 } 874 }
883 } // namespace internal 875 } // namespace internal
884 } // namespace v8 876 } // namespace v8
885 877
886 #endif // V8_TARGET_ARCH_X64 878 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698