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

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

Issue 70163006: MIPS: Simplify behavior of code stubs that accept a variable number of stack arguments in addition … (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: 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
« no previous file with comments | « no previous file | src/mips/deoptimizer-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 // 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 172
173 static void InitializeArrayConstructorDescriptor( 173 static void InitializeArrayConstructorDescriptor(
174 Isolate* isolate, 174 Isolate* isolate,
175 CodeStubInterfaceDescriptor* descriptor, 175 CodeStubInterfaceDescriptor* descriptor,
176 int constant_stack_parameter_count) { 176 int constant_stack_parameter_count) {
177 // register state 177 // register state
178 // a0 -- number of arguments 178 // a0 -- number of arguments
179 // a1 -- function 179 // a1 -- function
180 // a2 -- type info cell with elements kind 180 // a2 -- type info cell with elements kind
181 static Register registers[] = { a1, a2 }; 181 static Register registers_variable_args[] = { a1, a2, a0 };
182 descriptor->register_param_count_ = 2; 182 static Register registers_no_args[] = { a1, a2 };
183 if (constant_stack_parameter_count != 0) { 183
184 if (constant_stack_parameter_count == 0) {
185 descriptor->register_param_count_ = 2;
186 descriptor->register_params_ = registers_no_args;
187 } else {
184 // stack param count needs (constructor pointer, and single argument) 188 // stack param count needs (constructor pointer, and single argument)
189 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
185 descriptor->stack_parameter_count_ = a0; 190 descriptor->stack_parameter_count_ = a0;
191 descriptor->register_param_count_ = 3;
192 descriptor->register_params_ = registers_variable_args;
186 } 193 }
194
187 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 195 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
188 descriptor->register_params_ = registers;
189 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 196 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
190 descriptor->deoptimization_handler_ = 197 descriptor->deoptimization_handler_ =
191 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; 198 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
192 } 199 }
193 200
194 201
195 static void InitializeInternalArrayConstructorDescriptor( 202 static void InitializeInternalArrayConstructorDescriptor(
196 Isolate* isolate, 203 Isolate* isolate,
197 CodeStubInterfaceDescriptor* descriptor, 204 CodeStubInterfaceDescriptor* descriptor,
198 int constant_stack_parameter_count) { 205 int constant_stack_parameter_count) {
199 // register state 206 // register state
200 // a0 -- number of arguments 207 // a0 -- number of arguments
201 // a1 -- constructor function 208 // a1 -- constructor function
202 static Register registers[] = { a1 }; 209 static Register registers_variable_args[] = { a1, a0 };
203 descriptor->register_param_count_ = 1; 210 static Register registers_no_args[] = { a1 };
204 211
205 if (constant_stack_parameter_count != 0) { 212 if (constant_stack_parameter_count == 0) {
206 // Stack param count needs (constructor pointer, and single argument). 213 descriptor->register_param_count_ = 1;
214 descriptor->register_params_ = registers_no_args;
215 } else {
216 // stack param count needs (constructor pointer, and single argument)
217 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
207 descriptor->stack_parameter_count_ = a0; 218 descriptor->stack_parameter_count_ = a0;
219 descriptor->register_param_count_ = 2;
220 descriptor->register_params_ = registers_variable_args;
208 } 221 }
222
209 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 223 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
210 descriptor->register_params_ = registers;
211 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 224 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
212 descriptor->deoptimization_handler_ = 225 descriptor->deoptimization_handler_ =
213 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; 226 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
214 } 227 }
215 228
216 229
217 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 230 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
218 Isolate* isolate, 231 Isolate* isolate,
219 CodeStubInterfaceDescriptor* descriptor) { 232 CodeStubInterfaceDescriptor* descriptor) {
220 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); 233 InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
(...skipping 6005 matching lines...) Expand 10 before | Expand all | Expand 10 after
6226 __ bind(&fast_elements_case); 6239 __ bind(&fast_elements_case);
6227 GenerateCase(masm, FAST_ELEMENTS); 6240 GenerateCase(masm, FAST_ELEMENTS);
6228 } 6241 }
6229 6242
6230 6243
6231 #undef __ 6244 #undef __
6232 6245
6233 } } // namespace v8::internal 6246 } } // namespace v8::internal
6234 6247
6235 #endif // V8_TARGET_ARCH_MIPS 6248 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698