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

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

Issue 70203002: Simplify Hydrogen code stubs with variable argument count (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 1 month 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/deoptimizer.cc ('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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 162
163 static void InitializeArrayConstructorDescriptor( 163 static void InitializeArrayConstructorDescriptor(
164 Isolate* isolate, 164 Isolate* isolate,
165 CodeStubInterfaceDescriptor* descriptor, 165 CodeStubInterfaceDescriptor* descriptor,
166 int constant_stack_parameter_count) { 166 int constant_stack_parameter_count) {
167 // register state 167 // register state
168 // eax -- number of arguments 168 // eax -- number of arguments
169 // edi -- function 169 // edi -- function
170 // ebx -- type info cell with elements kind 170 // ebx -- type info cell with elements kind
171 static Register registers[] = { edi, ebx }; 171 static Register registers_variable_args[] = { edi, ebx, eax };
172 descriptor->register_param_count_ = 2; 172 static Register registers_no_args[] = { edi, ebx };
173 173
174 if (constant_stack_parameter_count != 0) { 174 if (constant_stack_parameter_count == 0) {
175 descriptor->register_param_count_ = 2;
176 descriptor->register_params_ = registers_no_args;
177 } else {
175 // stack param count needs (constructor pointer, and single argument) 178 // stack param count needs (constructor pointer, and single argument)
179 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
176 descriptor->stack_parameter_count_ = eax; 180 descriptor->stack_parameter_count_ = eax;
181 descriptor->register_param_count_ = 3;
182 descriptor->register_params_ = registers_variable_args;
177 } 183 }
184
178 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 185 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
179 descriptor->register_params_ = registers;
180 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 186 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
181 descriptor->deoptimization_handler_ = 187 descriptor->deoptimization_handler_ =
182 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; 188 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
183 } 189 }
184 190
185 191
186 static void InitializeInternalArrayConstructorDescriptor( 192 static void InitializeInternalArrayConstructorDescriptor(
187 Isolate* isolate, 193 Isolate* isolate,
188 CodeStubInterfaceDescriptor* descriptor, 194 CodeStubInterfaceDescriptor* descriptor,
189 int constant_stack_parameter_count) { 195 int constant_stack_parameter_count) {
190 // register state 196 // register state
191 // eax -- number of arguments 197 // eax -- number of arguments
192 // edi -- constructor function 198 // edi -- constructor function
193 static Register registers[] = { edi }; 199 static Register registers_variable_args[] = { edi, eax };
194 descriptor->register_param_count_ = 1; 200 static Register registers_no_args[] = { edi };
195 201
196 if (constant_stack_parameter_count != 0) { 202 if (constant_stack_parameter_count == 0) {
203 descriptor->register_param_count_ = 1;
204 descriptor->register_params_ = registers_no_args;
205 } else {
197 // stack param count needs (constructor pointer, and single argument) 206 // stack param count needs (constructor pointer, and single argument)
207 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
198 descriptor->stack_parameter_count_ = eax; 208 descriptor->stack_parameter_count_ = eax;
209 descriptor->register_param_count_ = 2;
210 descriptor->register_params_ = registers_variable_args;
199 } 211 }
212
200 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 213 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
201 descriptor->register_params_ = registers;
202 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 214 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
203 descriptor->deoptimization_handler_ = 215 descriptor->deoptimization_handler_ =
204 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; 216 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
205 } 217 }
206 218
207 219
208 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 220 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
209 Isolate* isolate, 221 Isolate* isolate,
210 CodeStubInterfaceDescriptor* descriptor) { 222 CodeStubInterfaceDescriptor* descriptor) {
211 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); 223 InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
(...skipping 5800 matching lines...) Expand 10 before | Expand all | Expand 10 after
6012 __ bind(&fast_elements_case); 6024 __ bind(&fast_elements_case);
6013 GenerateCase(masm, FAST_ELEMENTS); 6025 GenerateCase(masm, FAST_ELEMENTS);
6014 } 6026 }
6015 6027
6016 6028
6017 #undef __ 6029 #undef __
6018 6030
6019 } } // namespace v8::internal 6031 } } // namespace v8::internal
6020 6032
6021 #endif // V8_TARGET_ARCH_IA32 6033 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698