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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 149133004: A64: Synchronize with r17807. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/i18n.js ('k') | src/ia32/deoptimizer-ia32.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Isolate* isolate, 111 Isolate* isolate,
112 CodeStubInterfaceDescriptor* descriptor) { 112 CodeStubInterfaceDescriptor* descriptor) {
113 static Register registers[] = { edx, ecx }; 113 static Register registers[] = { edx, ecx };
114 descriptor->register_param_count_ = 2; 114 descriptor->register_param_count_ = 2;
115 descriptor->register_params_ = registers; 115 descriptor->register_params_ = registers;
116 descriptor->deoptimization_handler_ = 116 descriptor->deoptimization_handler_ =
117 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); 117 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
118 } 118 }
119 119
120 120
121 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
122 Isolate* isolate,
123 CodeStubInterfaceDescriptor* descriptor) {
124 static Register registers[] = { edx, ecx };
125 descriptor->register_param_count_ = 2;
126 descriptor->register_params_ = registers;
127 descriptor->deoptimization_handler_ =
128 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
129 }
130
131
121 void LoadFieldStub::InitializeInterfaceDescriptor( 132 void LoadFieldStub::InitializeInterfaceDescriptor(
122 Isolate* isolate, 133 Isolate* isolate,
123 CodeStubInterfaceDescriptor* descriptor) { 134 CodeStubInterfaceDescriptor* descriptor) {
124 static Register registers[] = { edx }; 135 static Register registers[] = { edx };
125 descriptor->register_param_count_ = 1; 136 descriptor->register_param_count_ = 1;
126 descriptor->register_params_ = registers; 137 descriptor->register_params_ = registers;
127 descriptor->deoptimization_handler_ = NULL; 138 descriptor->deoptimization_handler_ = NULL;
128 } 139 }
129 140
130 141
131 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 142 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
132 Isolate* isolate, 143 Isolate* isolate,
133 CodeStubInterfaceDescriptor* descriptor) { 144 CodeStubInterfaceDescriptor* descriptor) {
134 static Register registers[] = { edx }; 145 static Register registers[] = { edx };
135 descriptor->register_param_count_ = 1; 146 descriptor->register_param_count_ = 1;
136 descriptor->register_params_ = registers; 147 descriptor->register_params_ = registers;
137 descriptor->deoptimization_handler_ = NULL; 148 descriptor->deoptimization_handler_ = NULL;
138 } 149 }
139 150
140 151
152 void KeyedArrayCallStub::InitializeInterfaceDescriptor(
153 Isolate* isolate,
154 CodeStubInterfaceDescriptor* descriptor) {
155 static Register registers[] = { ecx };
156 descriptor->register_param_count_ = 1;
157 descriptor->register_params_ = registers;
158 descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
159 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
160 descriptor->deoptimization_handler_ =
161 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
162 }
163
164
141 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 165 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
142 Isolate* isolate, 166 Isolate* isolate,
143 CodeStubInterfaceDescriptor* descriptor) { 167 CodeStubInterfaceDescriptor* descriptor) {
144 static Register registers[] = { edx, ecx, eax }; 168 static Register registers[] = { edx, ecx, eax };
145 descriptor->register_param_count_ = 3; 169 descriptor->register_param_count_ = 3;
146 descriptor->register_params_ = registers; 170 descriptor->register_params_ = registers;
147 descriptor->deoptimization_handler_ = 171 descriptor->deoptimization_handler_ =
148 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 172 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
149 } 173 }
150 174
(...skipping 10 matching lines...) Expand all
161 185
162 186
163 static void InitializeArrayConstructorDescriptor( 187 static void InitializeArrayConstructorDescriptor(
164 Isolate* isolate, 188 Isolate* isolate,
165 CodeStubInterfaceDescriptor* descriptor, 189 CodeStubInterfaceDescriptor* descriptor,
166 int constant_stack_parameter_count) { 190 int constant_stack_parameter_count) {
167 // register state 191 // register state
168 // eax -- number of arguments 192 // eax -- number of arguments
169 // edi -- function 193 // edi -- function
170 // ebx -- type info cell with elements kind 194 // ebx -- type info cell with elements kind
171 static Register registers[] = { edi, ebx }; 195 static Register registers_variable_args[] = { edi, ebx, eax };
172 descriptor->register_param_count_ = 2; 196 static Register registers_no_args[] = { edi, ebx };
173 197
174 if (constant_stack_parameter_count != 0) { 198 if (constant_stack_parameter_count == 0) {
199 descriptor->register_param_count_ = 2;
200 descriptor->register_params_ = registers_no_args;
201 } else {
175 // stack param count needs (constructor pointer, and single argument) 202 // stack param count needs (constructor pointer, and single argument)
203 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
176 descriptor->stack_parameter_count_ = eax; 204 descriptor->stack_parameter_count_ = eax;
205 descriptor->register_param_count_ = 3;
206 descriptor->register_params_ = registers_variable_args;
177 } 207 }
208
178 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 209 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
179 descriptor->register_params_ = registers;
180 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 210 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
181 descriptor->deoptimization_handler_ = 211 descriptor->deoptimization_handler_ =
182 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; 212 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
183 } 213 }
184 214
185 215
186 static void InitializeInternalArrayConstructorDescriptor( 216 static void InitializeInternalArrayConstructorDescriptor(
187 Isolate* isolate, 217 Isolate* isolate,
188 CodeStubInterfaceDescriptor* descriptor, 218 CodeStubInterfaceDescriptor* descriptor,
189 int constant_stack_parameter_count) { 219 int constant_stack_parameter_count) {
190 // register state 220 // register state
191 // eax -- number of arguments 221 // eax -- number of arguments
192 // edi -- constructor function 222 // edi -- constructor function
193 static Register registers[] = { edi }; 223 static Register registers_variable_args[] = { edi, eax };
194 descriptor->register_param_count_ = 1; 224 static Register registers_no_args[] = { edi };
195 225
196 if (constant_stack_parameter_count != 0) { 226 if (constant_stack_parameter_count == 0) {
227 descriptor->register_param_count_ = 1;
228 descriptor->register_params_ = registers_no_args;
229 } else {
197 // stack param count needs (constructor pointer, and single argument) 230 // stack param count needs (constructor pointer, and single argument)
231 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
198 descriptor->stack_parameter_count_ = eax; 232 descriptor->stack_parameter_count_ = eax;
233 descriptor->register_param_count_ = 2;
234 descriptor->register_params_ = registers_variable_args;
199 } 235 }
236
200 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 237 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
201 descriptor->register_params_ = registers;
202 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 238 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
203 descriptor->deoptimization_handler_ = 239 descriptor->deoptimization_handler_ =
204 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; 240 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
205 } 241 }
206 242
207 243
208 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 244 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
209 Isolate* isolate, 245 Isolate* isolate,
210 CodeStubInterfaceDescriptor* descriptor) { 246 CodeStubInterfaceDescriptor* descriptor) {
211 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); 247 InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
(...skipping 5428 matching lines...) Expand 10 before | Expand all | Expand 10 after
5640 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 5676 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
5641 __ pop(ecx); 5677 __ pop(ecx);
5642 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE 5678 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE
5643 ? kPointerSize 5679 ? kPointerSize
5644 : 0; 5680 : 0;
5645 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 5681 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
5646 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 5682 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
5647 } 5683 }
5648 5684
5649 5685
5686 void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
5687 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
5688 __ call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
5689 __ mov(edi, eax);
5690 int parameter_count_offset =
5691 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
5692 __ mov(eax, MemOperand(ebp, parameter_count_offset));
5693 // The parameter count above includes the receiver for the arguments passed to
5694 // the deoptimization handler. Subtract the receiver for the parameter count
5695 // for the call.
5696 __ sub(eax, Immediate(1));
5697 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
5698 ParameterCount argument_count(eax);
5699 __ InvokeFunction(
5700 edi, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
5701 }
5702
5703
5650 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 5704 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
5651 if (masm->isolate()->function_entry_hook() != NULL) { 5705 if (masm->isolate()->function_entry_hook() != NULL) {
5652 // It's always safe to call the entry hook stub, as the hook itself 5706 // It's always safe to call the entry hook stub, as the hook itself
5653 // is not allowed to call back to V8. 5707 // is not allowed to call back to V8.
5654 AllowStubCallsScope allow_stub_calls(masm, true); 5708 AllowStubCallsScope allow_stub_calls(masm, true);
5655 5709
5656 ProfileEntryHookStub stub; 5710 ProfileEntryHookStub stub;
5657 masm->CallStub(&stub); 5711 masm->CallStub(&stub);
5658 } 5712 }
5659 } 5713 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
5766 // Fix kind and retry. 5820 // Fix kind and retry.
5767 __ inc(edx); 5821 __ inc(edx);
5768 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); 5822 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset));
5769 if (FLAG_debug_code) { 5823 if (FLAG_debug_code) {
5770 Handle<Map> allocation_site_map = 5824 Handle<Map> allocation_site_map =
5771 masm->isolate()->factory()->allocation_site_map(); 5825 masm->isolate()->factory()->allocation_site_map();
5772 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); 5826 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map));
5773 __ Assert(equal, kExpectedAllocationSiteInCell); 5827 __ Assert(equal, kExpectedAllocationSiteInCell);
5774 } 5828 }
5775 5829
5776 // Save the resulting elements kind in type info 5830 // Save the resulting elements kind in type info. We can't just store r3
5777 __ SmiTag(edx); 5831 // in the AllocationSite::transition_info field because elements kind is
5778 __ mov(FieldOperand(ecx, AllocationSite::kTransitionInfoOffset), edx); 5832 // restricted to a portion of the field...upper bits need to be left alone.
5779 __ SmiUntag(edx); 5833 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
5834 __ add(FieldOperand(ecx, AllocationSite::kTransitionInfoOffset),
5835 Immediate(Smi::FromInt(kFastElementsKindPackedToHoley)));
5780 5836
5781 __ bind(&normal_sequence); 5837 __ bind(&normal_sequence);
5782 int last_index = GetSequenceIndexFromFastElementsKind( 5838 int last_index = GetSequenceIndexFromFastElementsKind(
5783 TERMINAL_FAST_ELEMENTS_KIND); 5839 TERMINAL_FAST_ELEMENTS_KIND);
5784 for (int i = 0; i <= last_index; ++i) { 5840 for (int i = 0; i <= last_index; ++i) {
5785 Label next; 5841 Label next;
5786 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5842 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5787 __ cmp(edx, kind); 5843 __ cmp(edx, kind);
5788 __ j(not_equal, &next); 5844 __ j(not_equal, &next);
5789 ArraySingleArgumentConstructorStub stub(kind); 5845 ArraySingleArgumentConstructorStub stub(kind);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5910 Label no_info; 5966 Label no_info;
5911 // If the type cell is undefined, or contains anything other than an 5967 // If the type cell is undefined, or contains anything other than an
5912 // AllocationSite, call an array constructor that doesn't use AllocationSites. 5968 // AllocationSite, call an array constructor that doesn't use AllocationSites.
5913 __ cmp(ebx, Immediate(undefined_sentinel)); 5969 __ cmp(ebx, Immediate(undefined_sentinel));
5914 __ j(equal, &no_info); 5970 __ j(equal, &no_info);
5915 __ mov(edx, FieldOperand(ebx, Cell::kValueOffset)); 5971 __ mov(edx, FieldOperand(ebx, Cell::kValueOffset));
5916 __ cmp(FieldOperand(edx, 0), Immediate( 5972 __ cmp(FieldOperand(edx, 0), Immediate(
5917 masm->isolate()->factory()->allocation_site_map())); 5973 masm->isolate()->factory()->allocation_site_map()));
5918 __ j(not_equal, &no_info); 5974 __ j(not_equal, &no_info);
5919 5975
5976 // Only look at the lower 16 bits of the transition info.
5920 __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset)); 5977 __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset));
5921 __ SmiUntag(edx); 5978 __ SmiUntag(edx);
5979 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
5980 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask));
5922 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); 5981 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
5923 5982
5924 __ bind(&no_info); 5983 __ bind(&no_info);
5925 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); 5984 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
5926 } 5985 }
5927 5986
5928 5987
5929 void InternalArrayConstructorStub::GenerateCase( 5988 void InternalArrayConstructorStub::GenerateCase(
5930 MacroAssembler* masm, ElementsKind kind) { 5989 MacroAssembler* masm, ElementsKind kind) {
5931 Label not_zero_case, not_one_case; 5990 Label not_zero_case, not_one_case;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
6012 __ bind(&fast_elements_case); 6071 __ bind(&fast_elements_case);
6013 GenerateCase(masm, FAST_ELEMENTS); 6072 GenerateCase(masm, FAST_ELEMENTS);
6014 } 6073 }
6015 6074
6016 6075
6017 #undef __ 6076 #undef __
6018 6077
6019 } } // namespace v8::internal 6078 } } // namespace v8::internal
6020 6079
6021 #endif // V8_TARGET_ARCH_IA32 6080 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/i18n.js ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698