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/x64/code-stubs-x64.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/v8-counters.h ('k') | src/x64/full-codegen-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 descriptor->deoptimization_handler_ = 75 descriptor->deoptimization_handler_ =
76 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 76 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
77 } 77 }
78 78
79 79
80 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 80 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
81 CodeStubInterfaceDescriptor* descriptor) { 81 CodeStubInterfaceDescriptor* descriptor) {
82 static Register registers[] = { rax, rbx, rcx }; 82 static Register registers[] = { rax, rbx, rcx };
83 descriptor->register_param_count_ = 3; 83 descriptor->register_param_count_ = 3;
84 descriptor->register_params_ = registers; 84 descriptor->register_params_ = registers;
85 static Representation representations[] = {
86 Representation::Tagged(),
87 Representation::Smi(),
88 Representation::Tagged() };
89 descriptor->register_param_representations_ = representations;
85 descriptor->deoptimization_handler_ = 90 descriptor->deoptimization_handler_ =
86 Runtime::FunctionForId( 91 Runtime::FunctionForId(
87 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 92 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
88 } 93 }
89 94
90 95
91 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 96 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
92 CodeStubInterfaceDescriptor* descriptor) { 97 CodeStubInterfaceDescriptor* descriptor) {
93 static Register registers[] = { rax, rbx, rcx, rdx }; 98 static Register registers[] = { rax, rbx, rcx, rdx };
94 descriptor->register_param_count_ = 4; 99 descriptor->register_param_count_ = 4;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 static Register registers_no_args[] = { rdi, rbx }; 209 static Register registers_no_args[] = { rdi, rbx };
205 210
206 if (constant_stack_parameter_count == 0) { 211 if (constant_stack_parameter_count == 0) {
207 descriptor->register_param_count_ = 2; 212 descriptor->register_param_count_ = 2;
208 descriptor->register_params_ = registers_no_args; 213 descriptor->register_params_ = registers_no_args;
209 } else { 214 } else {
210 // stack param count needs (constructor pointer, and single argument) 215 // stack param count needs (constructor pointer, and single argument)
211 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 216 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
212 descriptor->stack_parameter_count_ = rax; 217 descriptor->stack_parameter_count_ = rax;
213 descriptor->register_param_count_ = 3; 218 descriptor->register_param_count_ = 3;
219 static Representation representations[] = {
220 Representation::Tagged(),
221 Representation::Tagged(),
222 Representation::Integer32() };
223 descriptor->register_param_representations_ = representations;
214 descriptor->register_params_ = registers_variable_args; 224 descriptor->register_params_ = registers_variable_args;
215 } 225 }
216 226
217 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 227 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
218 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 228 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
219 descriptor->deoptimization_handler_ = 229 descriptor->deoptimization_handler_ =
220 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 230 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
221 } 231 }
222 232
223 233
224 static void InitializeInternalArrayConstructorDescriptor( 234 static void InitializeInternalArrayConstructorDescriptor(
225 CodeStubInterfaceDescriptor* descriptor, 235 CodeStubInterfaceDescriptor* descriptor,
226 int constant_stack_parameter_count) { 236 int constant_stack_parameter_count) {
227 // register state 237 // register state
228 // rax -- number of arguments 238 // rax -- number of arguments
229 // rdi -- constructor function 239 // rdi -- constructor function
230 static Register registers_variable_args[] = { rdi, rax }; 240 static Register registers_variable_args[] = { rdi, rax };
231 static Register registers_no_args[] = { rdi }; 241 static Register registers_no_args[] = { rdi };
232 242
233 if (constant_stack_parameter_count == 0) { 243 if (constant_stack_parameter_count == 0) {
234 descriptor->register_param_count_ = 1; 244 descriptor->register_param_count_ = 1;
235 descriptor->register_params_ = registers_no_args; 245 descriptor->register_params_ = registers_no_args;
236 } else { 246 } else {
237 // stack param count needs (constructor pointer, and single argument) 247 // stack param count needs (constructor pointer, and single argument)
238 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 248 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
239 descriptor->stack_parameter_count_ = rax; 249 descriptor->stack_parameter_count_ = rax;
240 descriptor->register_param_count_ = 2; 250 descriptor->register_param_count_ = 2;
241 descriptor->register_params_ = registers_variable_args; 251 descriptor->register_params_ = registers_variable_args;
252 static Representation representations[] = {
253 Representation::Tagged(),
254 Representation::Integer32() };
255 descriptor->register_param_representations_ = representations;
242 } 256 }
243 257
244 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 258 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
245 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 259 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
246 descriptor->deoptimization_handler_ = 260 descriptor->deoptimization_handler_ =
247 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 261 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
248 } 262 }
249 263
250 264
251 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 265 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after
4920 return_value_operand, 4934 return_value_operand,
4921 NULL); 4935 NULL);
4922 } 4936 }
4923 4937
4924 4938
4925 #undef __ 4939 #undef __
4926 4940
4927 } } // namespace v8::internal 4941 } } // namespace v8::internal
4928 4942
4929 #endif // V8_TARGET_ARCH_X64 4943 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8-counters.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698