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

Side by Side Diff: src/compiler/ia32/linkage-ia32.cc

Issue 530783002: Convert Linkage to use MachineSignature. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/assembler.h" 7 #include "src/assembler.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/linkage-impl.h" 10 #include "src/compiler/linkage-impl.h"
11 #include "src/zone.h" 11 #include "src/zone.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 namespace compiler { 15 namespace compiler {
16 16
17 struct LinkageHelperTraits { 17 struct IA32LinkageHelperTraits {
18 static Register ReturnValueReg() { return eax; } 18 static Register ReturnValueReg() { return eax; }
19 static Register ReturnValue2Reg() { return edx; } 19 static Register ReturnValue2Reg() { return edx; }
20 static Register JSCallFunctionReg() { return edi; } 20 static Register JSCallFunctionReg() { return edi; }
21 static Register ContextReg() { return esi; } 21 static Register ContextReg() { return esi; }
22 static Register RuntimeCallFunctionReg() { return ebx; } 22 static Register RuntimeCallFunctionReg() { return ebx; }
23 static Register RuntimeCallArgCountReg() { return eax; } 23 static Register RuntimeCallArgCountReg() { return eax; }
24 static RegList CCalleeSaveRegisters() { 24 static RegList CCalleeSaveRegisters() {
25 return esi.bit() | edi.bit() | ebx.bit(); 25 return esi.bit() | edi.bit() | ebx.bit();
26 } 26 }
27 static Register CRegisterParameter(int i) { return no_reg; } 27 static Register CRegisterParameter(int i) { return no_reg; }
28 static int CRegisterParametersLength() { return 0; } 28 static int CRegisterParametersLength() { return 0; }
29 }; 29 };
30 30
31 typedef LinkageHelper<IA32LinkageHelperTraits> LH;
31 32
32 CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone) { 33 CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone) {
33 return LinkageHelper::GetJSCallDescriptor<LinkageHelperTraits>( 34 return LH::GetJSCallDescriptor(zone, parameter_count);
34 zone, parameter_count);
35 } 35 }
36 36
37 37
38 CallDescriptor* Linkage::GetRuntimeCallDescriptor(Runtime::FunctionId function, 38 CallDescriptor* Linkage::GetRuntimeCallDescriptor(Runtime::FunctionId function,
39 int parameter_count, 39 int parameter_count,
40 Operator::Property properties, 40 Operator::Property properties,
41 CallDescriptor::Flags flags, 41 CallDescriptor::Flags flags,
42 Zone* zone) { 42 Zone* zone) {
43 return LinkageHelper::GetRuntimeCallDescriptor<LinkageHelperTraits>( 43 return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
44 zone, function, parameter_count, properties, flags); 44 properties, flags);
45 } 45 }
46 46
47 47
48 CallDescriptor* Linkage::GetStubCallDescriptor( 48 CallDescriptor* Linkage::GetStubCallDescriptor(
49 CodeStubInterfaceDescriptor* descriptor, int stack_parameter_count, 49 CodeStubInterfaceDescriptor* descriptor, int stack_parameter_count,
50 CallDescriptor::Flags flags, Zone* zone) { 50 CallDescriptor::Flags flags, Zone* zone) {
51 return LinkageHelper::GetStubCallDescriptor<LinkageHelperTraits>( 51 return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
52 zone, descriptor, stack_parameter_count, flags); 52 flags);
53 } 53 }
54 54
55 55
56 CallDescriptor* Linkage::GetSimplifiedCDescriptor( 56 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
57 Zone* zone, int num_params, MachineType return_type, 57 MachineSignature* sig) {
58 const MachineType* param_types) { 58 return LH::GetSimplifiedCDescriptor(zone, sig);
59 return LinkageHelper::GetSimplifiedCDescriptor<LinkageHelperTraits>(
60 zone, num_params, return_type, param_types);
61 } 59 }
62 60
63 } // namespace compiler 61 } // namespace compiler
64 } // namespace internal 62 } // namespace internal
65 } // namespace v8 63 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698