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

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

Issue 257563004: Unify and simplify the FastCloneShallowArrayStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 6 years, 8 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 | « no previous file | src/arm/full-codegen-arm.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 descriptor->deoptimization_handler_ = 74 descriptor->deoptimization_handler_ =
75 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 75 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
76 } 76 }
77 77
78 78
79 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 79 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
80 CodeStubInterfaceDescriptor* descriptor) { 80 CodeStubInterfaceDescriptor* descriptor) {
81 static Register registers[] = { r3, r2, r1 }; 81 static Register registers[] = { r3, r2, r1 };
82 descriptor->register_param_count_ = 3; 82 descriptor->register_param_count_ = 3;
83 descriptor->register_params_ = registers; 83 descriptor->register_params_ = registers;
84 static Representation representations[] = {
85 Representation::Tagged(),
86 Representation::Smi(),
87 Representation::Tagged() };
88 descriptor->register_param_representations_ = representations;
84 descriptor->deoptimization_handler_ = 89 descriptor->deoptimization_handler_ =
85 Runtime::FunctionForId( 90 Runtime::FunctionForId(
86 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 91 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
87 } 92 }
88 93
89 94
90 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 95 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
91 CodeStubInterfaceDescriptor* descriptor) { 96 CodeStubInterfaceDescriptor* descriptor) {
92 static Register registers[] = { r3, r2, r1, r0 }; 97 static Register registers[] = { r3, r2, r1, r0 };
93 descriptor->register_param_count_ = 4; 98 descriptor->register_param_count_ = 4;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 222
218 if (constant_stack_parameter_count == 0) { 223 if (constant_stack_parameter_count == 0) {
219 descriptor->register_param_count_ = 2; 224 descriptor->register_param_count_ = 2;
220 descriptor->register_params_ = registers_no_args; 225 descriptor->register_params_ = registers_no_args;
221 } else { 226 } else {
222 // stack param count needs (constructor pointer, and single argument) 227 // stack param count needs (constructor pointer, and single argument)
223 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 228 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
224 descriptor->stack_parameter_count_ = r0; 229 descriptor->stack_parameter_count_ = r0;
225 descriptor->register_param_count_ = 3; 230 descriptor->register_param_count_ = 3;
226 descriptor->register_params_ = registers_variable_args; 231 descriptor->register_params_ = registers_variable_args;
232 static Representation representations[] = {
233 Representation::Tagged(),
234 Representation::Tagged(),
235 Representation::Integer32() };
236 descriptor->register_param_representations_ = representations;
227 } 237 }
228 238
229 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 239 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
230 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 240 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
231 descriptor->deoptimization_handler_ = 241 descriptor->deoptimization_handler_ =
232 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 242 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
233 } 243 }
234 244
235 245
236 static void InitializeInternalArrayConstructorDescriptor( 246 static void InitializeInternalArrayConstructorDescriptor(
237 CodeStubInterfaceDescriptor* descriptor, 247 CodeStubInterfaceDescriptor* descriptor,
238 int constant_stack_parameter_count) { 248 int constant_stack_parameter_count) {
239 // register state 249 // register state
240 // r0 -- number of arguments 250 // r0 -- number of arguments
241 // r1 -- constructor function 251 // r1 -- constructor function
242 static Register registers_variable_args[] = { r1, r0 }; 252 static Register registers_variable_args[] = { r1, r0 };
243 static Register registers_no_args[] = { r1 }; 253 static Register registers_no_args[] = { r1 };
244 254
245 if (constant_stack_parameter_count == 0) { 255 if (constant_stack_parameter_count == 0) {
246 descriptor->register_param_count_ = 1; 256 descriptor->register_param_count_ = 1;
247 descriptor->register_params_ = registers_no_args; 257 descriptor->register_params_ = registers_no_args;
248 } else { 258 } else {
249 // stack param count needs (constructor pointer, and single argument) 259 // stack param count needs (constructor pointer, and single argument)
250 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 260 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
251 descriptor->stack_parameter_count_ = r0; 261 descriptor->stack_parameter_count_ = r0;
252 descriptor->register_param_count_ = 2; 262 descriptor->register_param_count_ = 2;
253 descriptor->register_params_ = registers_variable_args; 263 descriptor->register_params_ = registers_variable_args;
264 static Representation representations[] = {
265 Representation::Tagged(),
266 Representation::Integer32() };
267 descriptor->register_param_representations_ = representations;
254 } 268 }
255 269
256 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 270 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
257 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 271 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
258 descriptor->deoptimization_handler_ = 272 descriptor->deoptimization_handler_ =
259 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 273 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
260 } 274 }
261 275
262 276
263 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 277 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4891 matching lines...) Expand 10 before | Expand all | Expand 10 after
5155 MemOperand(fp, 6 * kPointerSize), 5169 MemOperand(fp, 6 * kPointerSize),
5156 NULL); 5170 NULL);
5157 } 5171 }
5158 5172
5159 5173
5160 #undef __ 5174 #undef __
5161 5175
5162 } } // namespace v8::internal 5176 } } // namespace v8::internal
5163 5177
5164 #endif // V8_TARGET_ARCH_ARM 5178 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698