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

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: Fix arm64 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 84 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
85 } 85 }
86 86
87 87
88 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 88 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
89 Isolate* isolate, 89 Isolate* isolate,
90 CodeStubInterfaceDescriptor* descriptor) { 90 CodeStubInterfaceDescriptor* descriptor) {
91 static Register registers[] = { eax, ebx, ecx }; 91 static Register registers[] = { eax, ebx, ecx };
92 descriptor->register_param_count_ = 3; 92 descriptor->register_param_count_ = 3;
93 descriptor->register_params_ = registers; 93 descriptor->register_params_ = registers;
94 static Representation representations[] = {
95 Representation::Tagged(),
96 Representation::Smi(),
97 Representation::Tagged() };
98 descriptor->register_param_representations_ = representations;
94 descriptor->deoptimization_handler_ = 99 descriptor->deoptimization_handler_ =
95 Runtime::FunctionForId( 100 Runtime::FunctionForId(
96 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 101 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
97 } 102 }
98 103
99 104
100 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 105 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
101 Isolate* isolate, 106 Isolate* isolate,
102 CodeStubInterfaceDescriptor* descriptor) { 107 CodeStubInterfaceDescriptor* descriptor) {
103 static Register registers[] = { eax, ebx, ecx, edx }; 108 static Register registers[] = { eax, ebx, ecx, edx };
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 231
227 if (constant_stack_parameter_count == 0) { 232 if (constant_stack_parameter_count == 0) {
228 descriptor->register_param_count_ = 2; 233 descriptor->register_param_count_ = 2;
229 descriptor->register_params_ = registers_no_args; 234 descriptor->register_params_ = registers_no_args;
230 } else { 235 } else {
231 // stack param count needs (constructor pointer, and single argument) 236 // stack param count needs (constructor pointer, and single argument)
232 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 237 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
233 descriptor->stack_parameter_count_ = eax; 238 descriptor->stack_parameter_count_ = eax;
234 descriptor->register_param_count_ = 3; 239 descriptor->register_param_count_ = 3;
235 descriptor->register_params_ = registers_variable_args; 240 descriptor->register_params_ = registers_variable_args;
241 static Representation representations[] = {
242 Representation::Tagged(),
243 Representation::Tagged(),
244 Representation::Integer32() };
245 descriptor->register_param_representations_ = representations;
236 } 246 }
237 247
238 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 248 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
239 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 249 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
240 descriptor->deoptimization_handler_ = 250 descriptor->deoptimization_handler_ =
241 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 251 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
242 } 252 }
243 253
244 254
245 static void InitializeInternalArrayConstructorDescriptor( 255 static void InitializeInternalArrayConstructorDescriptor(
246 Isolate* isolate, 256 Isolate* isolate,
247 CodeStubInterfaceDescriptor* descriptor, 257 CodeStubInterfaceDescriptor* descriptor,
248 int constant_stack_parameter_count) { 258 int constant_stack_parameter_count) {
249 // register state 259 // register state
250 // eax -- number of arguments 260 // eax -- number of arguments
251 // edi -- constructor function 261 // edi -- constructor function
252 static Register registers_variable_args[] = { edi, eax }; 262 static Register registers_variable_args[] = { edi, eax };
253 static Register registers_no_args[] = { edi }; 263 static Register registers_no_args[] = { edi };
254 264
255 if (constant_stack_parameter_count == 0) { 265 if (constant_stack_parameter_count == 0) {
256 descriptor->register_param_count_ = 1; 266 descriptor->register_param_count_ = 1;
257 descriptor->register_params_ = registers_no_args; 267 descriptor->register_params_ = registers_no_args;
258 } else { 268 } else {
259 // stack param count needs (constructor pointer, and single argument) 269 // stack param count needs (constructor pointer, and single argument)
260 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 270 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
261 descriptor->stack_parameter_count_ = eax; 271 descriptor->stack_parameter_count_ = eax;
262 descriptor->register_param_count_ = 2; 272 descriptor->register_param_count_ = 2;
263 descriptor->register_params_ = registers_variable_args; 273 descriptor->register_params_ = registers_variable_args;
274 static Representation representations[] = {
275 Representation::Tagged(),
276 Representation::Integer32() };
277 descriptor->register_param_representations_ = representations;
264 } 278 }
265 279
266 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 280 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
267 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 281 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
268 descriptor->deoptimization_handler_ = 282 descriptor->deoptimization_handler_ =
269 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 283 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
270 } 284 }
271 285
272 286
273 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 287 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4811 matching lines...) Expand 10 before | Expand all | Expand 10 after
5085 Operand(ebp, 7 * kPointerSize), 5099 Operand(ebp, 7 * kPointerSize),
5086 NULL); 5100 NULL);
5087 } 5101 }
5088 5102
5089 5103
5090 #undef __ 5104 #undef __
5091 5105
5092 } } // namespace v8::internal 5106 } } // namespace v8::internal
5093 5107
5094 #endif // V8_TARGET_ARCH_IA32 5108 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « 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