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

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

Issue 272513004: Reland r20974: Unify and simplify the FastCloneShallowArrayStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: This time it will work! Created 6 years, 7 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 descriptor->deoptimization_handler_ = 56 descriptor->deoptimization_handler_ =
57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
58 } 58 }
59 59
60 60
61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
62 CodeStubInterfaceDescriptor* descriptor) { 62 CodeStubInterfaceDescriptor* descriptor) {
63 static Register registers[] = { eax, ebx, ecx }; 63 static Register registers[] = { eax, ebx, ecx };
64 descriptor->register_param_count_ = 3; 64 descriptor->register_param_count_ = 3;
65 descriptor->register_params_ = registers; 65 descriptor->register_params_ = registers;
66 static Representation representations[] = {
67 Representation::Tagged(),
68 Representation::Smi(),
69 Representation::Tagged() };
70 descriptor->register_param_representations_ = representations;
66 descriptor->deoptimization_handler_ = 71 descriptor->deoptimization_handler_ =
67 Runtime::FunctionForId( 72 Runtime::FunctionForId(
68 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 73 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
69 } 74 }
70 75
71 76
72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 77 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
73 CodeStubInterfaceDescriptor* descriptor) { 78 CodeStubInterfaceDescriptor* descriptor) {
74 static Register registers[] = { eax, ebx, ecx, edx }; 79 static Register registers[] = { eax, ebx, ecx, edx };
75 descriptor->register_param_count_ = 4; 80 descriptor->register_param_count_ = 4;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 192
188 if (constant_stack_parameter_count == 0) { 193 if (constant_stack_parameter_count == 0) {
189 descriptor->register_param_count_ = 2; 194 descriptor->register_param_count_ = 2;
190 descriptor->register_params_ = registers_no_args; 195 descriptor->register_params_ = registers_no_args;
191 } else { 196 } else {
192 // stack param count needs (constructor pointer, and single argument) 197 // stack param count needs (constructor pointer, and single argument)
193 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 198 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
194 descriptor->stack_parameter_count_ = eax; 199 descriptor->stack_parameter_count_ = eax;
195 descriptor->register_param_count_ = 3; 200 descriptor->register_param_count_ = 3;
196 descriptor->register_params_ = registers_variable_args; 201 descriptor->register_params_ = registers_variable_args;
202 static Representation representations[] = {
203 Representation::Tagged(),
204 Representation::Tagged(),
205 Representation::Integer32() };
206 descriptor->register_param_representations_ = representations;
197 } 207 }
198 208
199 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 209 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
200 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 210 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
201 descriptor->deoptimization_handler_ = 211 descriptor->deoptimization_handler_ =
202 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 212 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
203 } 213 }
204 214
205 215
206 static void InitializeInternalArrayConstructorDescriptor( 216 static void InitializeInternalArrayConstructorDescriptor(
207 CodeStubInterfaceDescriptor* descriptor, 217 CodeStubInterfaceDescriptor* descriptor,
208 int constant_stack_parameter_count) { 218 int constant_stack_parameter_count) {
209 // register state 219 // register state
210 // eax -- number of arguments 220 // eax -- number of arguments
211 // edi -- constructor function 221 // edi -- constructor function
212 static Register registers_variable_args[] = { edi, eax }; 222 static Register registers_variable_args[] = { edi, eax };
213 static Register registers_no_args[] = { edi }; 223 static Register registers_no_args[] = { edi };
214 224
215 if (constant_stack_parameter_count == 0) { 225 if (constant_stack_parameter_count == 0) {
216 descriptor->register_param_count_ = 1; 226 descriptor->register_param_count_ = 1;
217 descriptor->register_params_ = registers_no_args; 227 descriptor->register_params_ = registers_no_args;
218 } else { 228 } else {
219 // stack param count needs (constructor pointer, and single argument) 229 // stack param count needs (constructor pointer, and single argument)
220 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 230 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
221 descriptor->stack_parameter_count_ = eax; 231 descriptor->stack_parameter_count_ = eax;
222 descriptor->register_param_count_ = 2; 232 descriptor->register_param_count_ = 2;
223 descriptor->register_params_ = registers_variable_args; 233 descriptor->register_params_ = registers_variable_args;
234 static Representation representations[] = {
235 Representation::Tagged(),
236 Representation::Integer32() };
237 descriptor->register_param_representations_ = representations;
224 } 238 }
225 239
226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 240 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 241 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
228 descriptor->deoptimization_handler_ = 242 descriptor->deoptimization_handler_ =
229 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 243 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
230 } 244 }
231 245
232 246
233 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 247 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4880 matching lines...) Expand 10 before | Expand all | Expand 10 after
5114 Operand(ebp, 7 * kPointerSize), 5128 Operand(ebp, 7 * kPointerSize),
5115 NULL); 5129 NULL);
5116 } 5130 }
5117 5131
5118 5132
5119 #undef __ 5133 #undef __
5120 5134
5121 } } // namespace v8::internal 5135 } } // namespace v8::internal
5122 5136
5123 #endif // V8_TARGET_ARCH_IA32 5137 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698