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

Side by Side Diff: src/ia32/code-stubs-ia32.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 | « src/hydrogen.cc ('k') | src/ia32/full-codegen-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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 descriptor->deoptimization_handler_ = 79 descriptor->deoptimization_handler_ =
80 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 80 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
81 } 81 }
82 82
83 83
84 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 84 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
85 CodeStubInterfaceDescriptor* descriptor) { 85 CodeStubInterfaceDescriptor* descriptor) {
86 static Register registers[] = { eax, ebx, ecx }; 86 static Register registers[] = { eax, ebx, ecx };
87 descriptor->register_param_count_ = 3; 87 descriptor->register_param_count_ = 3;
88 descriptor->register_params_ = registers; 88 descriptor->register_params_ = registers;
89 static Representation representations[] = {
90 Representation::Tagged(),
91 Representation::Smi(),
92 Representation::Tagged() };
93 descriptor->register_param_representations_ = representations;
89 descriptor->deoptimization_handler_ = 94 descriptor->deoptimization_handler_ =
90 Runtime::FunctionForId( 95 Runtime::FunctionForId(
91 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 96 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
92 } 97 }
93 98
94 99
95 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 100 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
96 CodeStubInterfaceDescriptor* descriptor) { 101 CodeStubInterfaceDescriptor* descriptor) {
97 static Register registers[] = { eax, ebx, ecx, edx }; 102 static Register registers[] = { eax, ebx, ecx, edx };
98 descriptor->register_param_count_ = 4; 103 descriptor->register_param_count_ = 4;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 215
211 if (constant_stack_parameter_count == 0) { 216 if (constant_stack_parameter_count == 0) {
212 descriptor->register_param_count_ = 2; 217 descriptor->register_param_count_ = 2;
213 descriptor->register_params_ = registers_no_args; 218 descriptor->register_params_ = registers_no_args;
214 } else { 219 } else {
215 // stack param count needs (constructor pointer, and single argument) 220 // stack param count needs (constructor pointer, and single argument)
216 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 221 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
217 descriptor->stack_parameter_count_ = eax; 222 descriptor->stack_parameter_count_ = eax;
218 descriptor->register_param_count_ = 3; 223 descriptor->register_param_count_ = 3;
219 descriptor->register_params_ = registers_variable_args; 224 descriptor->register_params_ = registers_variable_args;
225 static Representation representations[] = {
226 Representation::Tagged(),
227 Representation::Tagged(),
228 Representation::Integer32() };
229 descriptor->register_param_representations_ = representations;
220 } 230 }
221 231
222 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 232 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
223 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 233 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
224 descriptor->deoptimization_handler_ = 234 descriptor->deoptimization_handler_ =
225 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 235 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
226 } 236 }
227 237
228 238
229 static void InitializeInternalArrayConstructorDescriptor( 239 static void InitializeInternalArrayConstructorDescriptor(
230 CodeStubInterfaceDescriptor* descriptor, 240 CodeStubInterfaceDescriptor* descriptor,
231 int constant_stack_parameter_count) { 241 int constant_stack_parameter_count) {
232 // register state 242 // register state
233 // eax -- number of arguments 243 // eax -- number of arguments
234 // edi -- constructor function 244 // edi -- constructor function
235 static Register registers_variable_args[] = { edi, eax }; 245 static Register registers_variable_args[] = { edi, eax };
236 static Register registers_no_args[] = { edi }; 246 static Register registers_no_args[] = { edi };
237 247
238 if (constant_stack_parameter_count == 0) { 248 if (constant_stack_parameter_count == 0) {
239 descriptor->register_param_count_ = 1; 249 descriptor->register_param_count_ = 1;
240 descriptor->register_params_ = registers_no_args; 250 descriptor->register_params_ = registers_no_args;
241 } else { 251 } else {
242 // stack param count needs (constructor pointer, and single argument) 252 // stack param count needs (constructor pointer, and single argument)
243 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 253 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
244 descriptor->stack_parameter_count_ = eax; 254 descriptor->stack_parameter_count_ = eax;
245 descriptor->register_param_count_ = 2; 255 descriptor->register_param_count_ = 2;
246 descriptor->register_params_ = registers_variable_args; 256 descriptor->register_params_ = registers_variable_args;
257 static Representation representations[] = {
258 Representation::Tagged(),
259 Representation::Integer32() };
260 descriptor->register_param_representations_ = representations;
247 } 261 }
248 262
249 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 263 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
250 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 264 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
251 descriptor->deoptimization_handler_ = 265 descriptor->deoptimization_handler_ =
252 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 266 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
253 } 267 }
254 268
255 269
256 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 270 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4787 matching lines...) Expand 10 before | Expand all | Expand 10 after
5044 Operand(ebp, 7 * kPointerSize), 5058 Operand(ebp, 7 * kPointerSize),
5045 NULL); 5059 NULL);
5046 } 5060 }
5047 5061
5048 5062
5049 #undef __ 5063 #undef __
5050 5064
5051 } } // namespace v8::internal 5065 } } // namespace v8::internal
5052 5066
5053 #endif // V8_TARGET_ARCH_IA32 5067 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698