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

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

Issue 535873002: Encapsulate megamorphic load/tail-call in hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/stub-cache.h ('k') | src/ic/x64/stub-cache-x64.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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 __ leap(r9, unmapped_location); 816 __ leap(r9, unmapped_location);
817 __ movp(r8, value); 817 __ movp(r8, value);
818 __ RecordWrite(rbx, r9, r8, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 818 __ RecordWrite(rbx, r9, r8, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
819 INLINE_SMI_CHECK); 819 INLINE_SMI_CHECK);
820 __ Ret(); 820 __ Ret();
821 __ bind(&slow); 821 __ bind(&slow);
822 GenerateMiss(masm); 822 GenerateMiss(masm);
823 } 823 }
824 824
825 825
826 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
827 // The return address is on the stack.
828 Register receiver = LoadDescriptor::ReceiverRegister();
829 Register name = LoadDescriptor::NameRegister();
830 DCHECK(receiver.is(rdx));
831 DCHECK(name.is(rcx));
832
833 // Probe the stub cache.
834 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
835 Code::ComputeHandlerFlags(Code::LOAD_IC));
836 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, rbx,
837 rax);
838
839 GenerateMiss(masm);
840 }
841
842
843 void LoadIC::GenerateNormal(MacroAssembler* masm) { 826 void LoadIC::GenerateNormal(MacroAssembler* masm) {
844 Register dictionary = rax; 827 Register dictionary = rax;
845 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); 828 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
846 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); 829 DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
847 830
848 Label slow; 831 Label slow;
849 832
850 __ movp(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), 833 __ movp(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(),
851 JSObject::kPropertiesOffset)); 834 JSObject::kPropertiesOffset));
852 GenerateDictionaryLoad(masm, &slow, dictionary, 835 GenerateDictionaryLoad(masm, &slow, dictionary,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 } 910 }
928 911
929 912
930 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 913 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
931 // The return address is on the stack. 914 // The return address is on the stack.
932 915
933 // Get the receiver from the stack and probe the stub cache. 916 // Get the receiver from the stack and probe the stub cache.
934 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 917 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
935 Code::ComputeHandlerFlags(Code::STORE_IC)); 918 Code::ComputeHandlerFlags(Code::STORE_IC));
936 masm->isolate()->stub_cache()->GenerateProbe( 919 masm->isolate()->stub_cache()->GenerateProbe(
937 masm, flags, StoreDescriptor::ReceiverRegister(), 920 masm, flags, false, StoreDescriptor::ReceiverRegister(),
938 StoreDescriptor::NameRegister(), rbx, no_reg); 921 StoreDescriptor::NameRegister(), rbx, no_reg);
939 922
940 // Cache miss: Jump to runtime. 923 // Cache miss: Jump to runtime.
941 GenerateMiss(masm); 924 GenerateMiss(masm);
942 } 925 }
943 926
944 927
945 static void StoreIC_PushArgs(MacroAssembler* masm) { 928 static void StoreIC_PushArgs(MacroAssembler* masm) {
946 Register receiver = StoreDescriptor::ReceiverRegister(); 929 Register receiver = StoreDescriptor::ReceiverRegister();
947 Register name = StoreDescriptor::NameRegister(); 930 Register name = StoreDescriptor::NameRegister();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 Condition cc = 1049 Condition cc =
1067 (check == ENABLE_INLINED_SMI_CHECK) 1050 (check == ENABLE_INLINED_SMI_CHECK)
1068 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1051 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1069 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1052 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1070 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1053 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1071 } 1054 }
1072 } 1055 }
1073 } // namespace v8::internal 1056 } // namespace v8::internal
1074 1057
1075 #endif // V8_TARGET_ARCH_X64 1058 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/stub-cache.h ('k') | src/ic/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698