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

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

Issue 517993002: Refactoring InterfaceDescriptors away from code-stubs.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 3 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/isolate.cc ('k') | src/x64/interface-descriptors-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 // 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void TransitionElementsKindStub::InitializeInterfaceDescriptor( 116 void TransitionElementsKindStub::InitializeInterfaceDescriptor(
117 CodeStubInterfaceDescriptor* descriptor) { 117 CodeStubInterfaceDescriptor* descriptor) {
118 Register registers[] = { rsi, rax, rbx }; 118 Register registers[] = { rsi, rax, rbx };
119 descriptor->Initialize( 119 descriptor->Initialize(
120 MajorKey(), arraysize(registers), registers, 120 MajorKey(), arraysize(registers), registers,
121 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); 121 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry);
122 } 122 }
123 123
124 124
125 const Register InterfaceDescriptor::ContextRegister() { return rsi; }
126
127
128 static void InitializeArrayConstructorDescriptor( 125 static void InitializeArrayConstructorDescriptor(
129 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, 126 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor,
130 int constant_stack_parameter_count) { 127 int constant_stack_parameter_count) {
131 // register state 128 // register state
132 // rax -- number of arguments 129 // rax -- number of arguments
133 // rdi -- function 130 // rdi -- function
134 // rbx -- allocation site with elements kind 131 // rbx -- allocation site with elements kind
135 Address deopt_handler = Runtime::FunctionForId( 132 Address deopt_handler = Runtime::FunctionForId(
136 Runtime::kArrayConstructor)->entry; 133 Runtime::kArrayConstructor)->entry;
137 134
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 258
262 259
263 void StringAddStub::InitializeInterfaceDescriptor( 260 void StringAddStub::InitializeInterfaceDescriptor(
264 CodeStubInterfaceDescriptor* descriptor) { 261 CodeStubInterfaceDescriptor* descriptor) {
265 Register registers[] = { rsi, rdx, rax }; 262 Register registers[] = { rsi, rdx, rax };
266 descriptor->Initialize(MajorKey(), arraysize(registers), registers, 263 descriptor->Initialize(MajorKey(), arraysize(registers), registers,
267 Runtime::FunctionForId(Runtime::kStringAdd)->entry); 264 Runtime::FunctionForId(Runtime::kStringAdd)->entry);
268 } 265 }
269 266
270 267
271 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
272 {
273 CallInterfaceDescriptor* descriptor =
274 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
275 Register registers[] = { rsi, // context
276 rdi, // JSFunction
277 rax, // actual number of arguments
278 rbx, // expected number of arguments
279 };
280 Representation representations[] = {
281 Representation::Tagged(), // context
282 Representation::Tagged(), // JSFunction
283 Representation::Integer32(), // actual number of arguments
284 Representation::Integer32(), // expected number of arguments
285 };
286 descriptor->Initialize(arraysize(registers), registers, representations);
287 }
288 {
289 CallInterfaceDescriptor* descriptor =
290 isolate->call_descriptor(Isolate::KeyedCall);
291 Register registers[] = { rsi, // context
292 rcx, // key
293 };
294 Representation representations[] = {
295 Representation::Tagged(), // context
296 Representation::Tagged(), // key
297 };
298 descriptor->Initialize(arraysize(registers), registers, representations);
299 }
300 {
301 CallInterfaceDescriptor* descriptor =
302 isolate->call_descriptor(Isolate::NamedCall);
303 Register registers[] = { rsi, // context
304 rcx, // name
305 };
306 Representation representations[] = {
307 Representation::Tagged(), // context
308 Representation::Tagged(), // name
309 };
310 descriptor->Initialize(arraysize(registers), registers, representations);
311 }
312 {
313 CallInterfaceDescriptor* descriptor =
314 isolate->call_descriptor(Isolate::CallHandler);
315 Register registers[] = { rsi, // context
316 rdx, // receiver
317 };
318 Representation representations[] = {
319 Representation::Tagged(), // context
320 Representation::Tagged(), // receiver
321 };
322 descriptor->Initialize(arraysize(registers), registers, representations);
323 }
324 {
325 CallInterfaceDescriptor* descriptor =
326 isolate->call_descriptor(Isolate::ApiFunctionCall);
327 Register registers[] = { rsi, // context
328 rax, // callee
329 rbx, // call_data
330 rcx, // holder
331 rdx, // api_function_address
332 };
333 Representation representations[] = {
334 Representation::Tagged(), // context
335 Representation::Tagged(), // callee
336 Representation::Tagged(), // call_data
337 Representation::Tagged(), // holder
338 Representation::External(), // api_function_address
339 };
340 descriptor->Initialize(arraysize(registers), registers, representations);
341 }
342 }
343
344
345 #define __ ACCESS_MASM(masm) 268 #define __ ACCESS_MASM(masm)
346 269
347 270
348 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { 271 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
349 // Update the static counter each time a new code stub is generated. 272 // Update the static counter each time a new code stub is generated.
350 isolate()->counters()->code_stubs()->Increment(); 273 isolate()->counters()->code_stubs()->Increment();
351 274
352 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); 275 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
353 int param_count = descriptor->GetEnvironmentParameterCount(); 276 int param_count = descriptor->GetEnvironmentParameterCount();
354 { 277 {
(...skipping 4634 matching lines...) Expand 10 before | Expand all | Expand 10 after
4989 return_value_operand, 4912 return_value_operand,
4990 NULL); 4913 NULL);
4991 } 4914 }
4992 4915
4993 4916
4994 #undef __ 4917 #undef __
4995 4918
4996 } } // namespace v8::internal 4919 } } // namespace v8::internal
4997 4920
4998 #endif // V8_TARGET_ARCH_X64 4921 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698