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

Side by Side Diff: src/x64/code-stubs-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 descriptor->deoptimization_handler_ = 52 descriptor->deoptimization_handler_ =
53 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 53 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
54 } 54 }
55 55
56 56
57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
58 CodeStubInterfaceDescriptor* descriptor) { 58 CodeStubInterfaceDescriptor* descriptor) {
59 static Register registers[] = { rax, rbx, rcx }; 59 static Register registers[] = { rax, rbx, rcx };
60 descriptor->register_param_count_ = 3; 60 descriptor->register_param_count_ = 3;
61 descriptor->register_params_ = registers; 61 descriptor->register_params_ = registers;
62 static Representation representations[] = {
63 Representation::Tagged(),
64 Representation::Smi(),
65 Representation::Tagged() };
66 descriptor->register_param_representations_ = representations;
62 descriptor->deoptimization_handler_ = 67 descriptor->deoptimization_handler_ =
63 Runtime::FunctionForId( 68 Runtime::FunctionForId(
64 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 69 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
65 } 70 }
66 71
67 72
68 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 73 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
69 CodeStubInterfaceDescriptor* descriptor) { 74 CodeStubInterfaceDescriptor* descriptor) {
70 static Register registers[] = { rax, rbx, rcx, rdx }; 75 static Register registers[] = { rax, rbx, rcx, rdx };
71 descriptor->register_param_count_ = 4; 76 descriptor->register_param_count_ = 4;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 static Register registers_no_args[] = { rdi, rbx }; 186 static Register registers_no_args[] = { rdi, rbx };
182 187
183 if (constant_stack_parameter_count == 0) { 188 if (constant_stack_parameter_count == 0) {
184 descriptor->register_param_count_ = 2; 189 descriptor->register_param_count_ = 2;
185 descriptor->register_params_ = registers_no_args; 190 descriptor->register_params_ = registers_no_args;
186 } else { 191 } else {
187 // stack param count needs (constructor pointer, and single argument) 192 // stack param count needs (constructor pointer, and single argument)
188 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 193 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
189 descriptor->stack_parameter_count_ = rax; 194 descriptor->stack_parameter_count_ = rax;
190 descriptor->register_param_count_ = 3; 195 descriptor->register_param_count_ = 3;
196 static Representation representations[] = {
197 Representation::Tagged(),
198 Representation::Tagged(),
199 Representation::Integer32() };
200 descriptor->register_param_representations_ = representations;
191 descriptor->register_params_ = registers_variable_args; 201 descriptor->register_params_ = registers_variable_args;
192 } 202 }
193 203
194 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 204 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
195 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 205 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
196 descriptor->deoptimization_handler_ = 206 descriptor->deoptimization_handler_ =
197 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 207 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
198 } 208 }
199 209
200 210
201 static void InitializeInternalArrayConstructorDescriptor( 211 static void InitializeInternalArrayConstructorDescriptor(
202 CodeStubInterfaceDescriptor* descriptor, 212 CodeStubInterfaceDescriptor* descriptor,
203 int constant_stack_parameter_count) { 213 int constant_stack_parameter_count) {
204 // register state 214 // register state
205 // rax -- number of arguments 215 // rax -- number of arguments
206 // rdi -- constructor function 216 // rdi -- constructor function
207 static Register registers_variable_args[] = { rdi, rax }; 217 static Register registers_variable_args[] = { rdi, rax };
208 static Register registers_no_args[] = { rdi }; 218 static Register registers_no_args[] = { rdi };
209 219
210 if (constant_stack_parameter_count == 0) { 220 if (constant_stack_parameter_count == 0) {
211 descriptor->register_param_count_ = 1; 221 descriptor->register_param_count_ = 1;
212 descriptor->register_params_ = registers_no_args; 222 descriptor->register_params_ = registers_no_args;
213 } else { 223 } else {
214 // stack param count needs (constructor pointer, and single argument) 224 // stack param count needs (constructor pointer, and single argument)
215 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 225 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
216 descriptor->stack_parameter_count_ = rax; 226 descriptor->stack_parameter_count_ = rax;
217 descriptor->register_param_count_ = 2; 227 descriptor->register_param_count_ = 2;
218 descriptor->register_params_ = registers_variable_args; 228 descriptor->register_params_ = registers_variable_args;
229 static Representation representations[] = {
230 Representation::Tagged(),
231 Representation::Integer32() };
232 descriptor->register_param_representations_ = representations;
219 } 233 }
220 234
221 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 235 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
222 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 236 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
223 descriptor->deoptimization_handler_ = 237 descriptor->deoptimization_handler_ =
224 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 238 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
225 } 239 }
226 240
227 241
228 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 242 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after
5022 return_value_operand, 5036 return_value_operand,
5023 NULL); 5037 NULL);
5024 } 5038 }
5025 5039
5026 5040
5027 #undef __ 5041 #undef __
5028 5042
5029 } } // namespace v8::internal 5043 } } // namespace v8::internal
5030 5044
5031 #endif // V8_TARGET_ARCH_X64 5045 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698