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

Side by Side Diff: src/mips64/interface-descriptors-mips64.cc

Issue 538573002: MIPS: Make concrete classes for individual call descriptors. - internal (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: mips64 port added. 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/mips64/full-codegen-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.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 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/interface-descriptors.h" 9 #include "src/interface-descriptors.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 const Register CallInterfaceDescriptor::ContextRegister() { return cp; } 14 const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
15 15
16 16
17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 17 const Register LoadDescriptor::ReceiverRegister() { return a1; }
18 InitializeForIsolateAllPlatforms(isolate); 18 const Register LoadDescriptor::NameRegister() { return a2; }
19 19
20 { 20
21 CallInterfaceDescriptor* descriptor = 21 const Register VectorLoadICDescriptor::ReceiverRegister() {
22 isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); 22 return LoadDescriptor::ReceiverRegister();
23 Register registers[] = {cp, a2}; 23 }
24 descriptor->Initialize(arraysize(registers), registers, NULL); 24
25 } 25
26 { 26 const Register VectorLoadICDescriptor::NameRegister() {
27 CallInterfaceDescriptor* descriptor = 27 return LoadDescriptor::NameRegister();
28 isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); 28 }
29 Register registers[] = {cp, a1}; 29
30 descriptor->Initialize(arraysize(registers), registers, NULL); 30
31 } 31 const Register VectorLoadICDescriptor::SlotRegister() { return a0; }
32 { 32 const Register VectorLoadICDescriptor::VectorRegister() { return a3; }
33 CallInterfaceDescriptor* descriptor = 33
34 isolate->call_descriptor(CallDescriptorKey::ToNumberCall); 34
35 Register registers[] = {cp, a0}; 35 const Register StoreDescriptor::ReceiverRegister() { return a1; }
36 descriptor->Initialize(arraysize(registers), registers, NULL); 36 const Register StoreDescriptor::NameRegister() { return a2; }
37 } 37 const Register StoreDescriptor::ValueRegister() { return a0; }
38 { 38
39 CallInterfaceDescriptor* descriptor = 39
40 isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); 40 const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() {
41 Register registers[] = {cp, a0}; 41 return StoreDescriptor::ReceiverRegister();
42 descriptor->Initialize(arraysize(registers), registers, NULL); 42 }
43 } 43
44 { 44
45 CallInterfaceDescriptor* descriptor = 45 const Register ElementTransitionAndStoreDescriptor::NameRegister() {
46 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); 46 return StoreDescriptor::NameRegister();
47 Register registers[] = {cp, a3, a2, a1}; 47 }
48 Representation representations[] = { 48
49 Representation::Tagged(), Representation::Tagged(), 49
50 Representation::Smi(), Representation::Tagged()}; 50 const Register ElementTransitionAndStoreDescriptor::ValueRegister() {
51 descriptor->Initialize(arraysize(registers), registers, representations); 51 return StoreDescriptor::ValueRegister();
52 } 52 }
53 { 53
54 CallInterfaceDescriptor* descriptor = 54
55 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); 55 const Register ElementTransitionAndStoreDescriptor::MapRegister() { return a3; }
56 Register registers[] = {cp, a3, a2, a1, a0}; 56
57 descriptor->Initialize(arraysize(registers), registers, NULL); 57
58 } 58 const Register InstanceofDescriptor::left() { return a0; }
59 { 59 const Register InstanceofDescriptor::right() { return a1; }
60 CallInterfaceDescriptor* descriptor = 60
61 isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); 61
62 Register registers[] = {cp, a2, a3}; 62 void FastNewClosureDescriptor::Initialize(Isolate* isolate) {
63 descriptor->Initialize(arraysize(registers), registers, NULL); 63 Register registers[] = {cp, a2};
64 } 64 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
65 { 65 }
66 CallInterfaceDescriptor* descriptor = 66
67 isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); 67
68 Register registers[] = {cp, a2, a1, a0}; 68 void FastNewContextDescriptor::Initialize(Isolate* isolate) {
69 descriptor->Initialize(arraysize(registers), registers, NULL); 69 Register registers[] = {cp, a1};
70 } 70 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
71 { 71 }
72 CallInterfaceDescriptor* descriptor = 72
73 isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); 73
74 Register registers[] = {cp, a0, a1}; 74 void ToNumberDescriptor::Initialize(Isolate* isolate) {
75 descriptor->Initialize(arraysize(registers), registers, NULL); 75 Register registers[] = {cp, a0};
76 } 76 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
77 { 77 }
78 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( 78
79 CallDescriptorKey::ArrayConstructorConstantArgCountCall); 79
80 // register state 80 void NumberToStringDescriptor::Initialize(Isolate* isolate) {
81 // cp -- context 81 Register registers[] = {cp, a0};
82 // a0 -- number of arguments 82 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
83 // a1 -- function 83 }
84 // a2 -- allocation site with elements kind 84
85 Register registers[] = {cp, a1, a2}; 85
86 descriptor->Initialize(arraysize(registers), registers, NULL); 86 void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) {
87 } 87 Register registers[] = {cp, a3, a2, a1};
88 { 88 Representation representations[] = {
89 CallInterfaceDescriptor* descriptor = 89 Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
90 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); 90 Representation::Tagged()};
91 // stack param count needs (constructor pointer, and single argument) 91 InitializeData(isolate, key(), arraysize(registers), registers,
92 Register registers[] = {cp, a1, a2, a0}; 92 representations);
93 Representation representations[] = { 93 }
94 Representation::Tagged(), Representation::Tagged(), 94
95 Representation::Tagged(), Representation::Integer32()}; 95
96 descriptor->Initialize(arraysize(registers), registers, representations); 96 void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) {
97 } 97 Register registers[] = {cp, a3, a2, a1, a0};
98 { 98 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
99 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( 99 }
100 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); 100
101 // register state 101
102 // cp -- context 102 void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) {
103 // a0 -- number of arguments 103 Register registers[] = {cp, a2, a3};
104 // a1 -- constructor function 104 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
105 Register registers[] = {cp, a1}; 105 }
106 descriptor->Initialize(arraysize(registers), registers, NULL); 106
107 } 107
108 { 108 void CallFunctionDescriptor::Initialize(Isolate* isolate) {
109 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( 109 Register registers[] = {cp, a1};
110 CallDescriptorKey::InternalArrayConstructorCall); 110 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
111 // stack param count needs (constructor pointer, and single argument) 111 }
112 Register registers[] = {cp, a1, a0}; 112
113 Representation representations[] = {Representation::Tagged(), 113
114 Representation::Tagged(), 114 void CallConstructDescriptor::Initialize(Isolate* isolate) {
115 Representation::Integer32()}; 115 // a0 : number of arguments
116 descriptor->Initialize(arraysize(registers), registers, representations); 116 // a1 : the function to call
117 } 117 // a2 : feedback vector
118 { 118 // a3 : (only if a2 is not the megamorphic symbol) slot in feedback
119 CallInterfaceDescriptor* descriptor = 119 // vector (Smi)
120 isolate->call_descriptor(CallDescriptorKey::CompareNilCall); 120 // TODO(turbofan): So far we don't gather type feedback and hence skip the
121 Register registers[] = {cp, a0}; 121 // slot parameter, but ArrayConstructStub needs the vector to be undefined.
122 descriptor->Initialize(arraysize(registers), registers, NULL); 122 Register registers[] = {cp, a0, a1, a2};
123 } 123 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
124 { 124 }
125 CallInterfaceDescriptor* descriptor = 125
126 isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); 126
127 Register registers[] = {cp, a0}; 127 void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) {
128 descriptor->Initialize(arraysize(registers), registers, NULL); 128 Register registers[] = {cp, a2, a1, a0};
129 } 129 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
130 { 130 }
131 CallInterfaceDescriptor* descriptor = 131
132 isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); 132
133 Register registers[] = {cp, a1, a0}; 133 void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) {
134 descriptor->Initialize(arraysize(registers), registers, NULL); 134 Register registers[] = {cp, a0, a1};
135 } 135 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
136 { 136 }
137 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( 137
138 CallDescriptorKey::BinaryOpWithAllocationSiteCall); 138
139 Register registers[] = {cp, a2, a1, a0}; 139 void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) {
140 descriptor->Initialize(arraysize(registers), registers, NULL); 140 // register state
141 } 141 // cp -- context
142 { 142 // a0 -- number of arguments
143 CallInterfaceDescriptor* descriptor = 143 // a1 -- function
144 isolate->call_descriptor(CallDescriptorKey::StringAddCall); 144 // a2 -- allocation site with elements kind
145 Register registers[] = {cp, a1, a0}; 145 Register registers[] = {cp, a1, a2};
146 descriptor->Initialize(arraysize(registers), registers, NULL); 146 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
147 } 147 }
148 148
149 { 149
150 CallInterfaceDescriptor* descriptor = 150 void ArrayConstructorDescriptor::Initialize(Isolate* isolate) {
151 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); 151 // stack param count needs (constructor pointer, and single argument)
152 Register registers[] = { cp, // context 152 Register registers[] = {cp, a1, a2, a0};
153 a1, // JSFunction 153 Representation representations[] = {
154 a0, // actual number of arguments 154 Representation::Tagged(), Representation::Tagged(),
155 a2, // expected number of arguments 155 Representation::Tagged(), Representation::Integer32()};
156 }; 156 InitializeData(isolate, key(), arraysize(registers), registers,
157 Representation representations[] = { 157 representations);
158 Representation::Tagged(), // context 158 }
159 Representation::Tagged(), // JSFunction 159
160 Representation::Integer32(), // actual number of arguments 160
161 Representation::Integer32(), // expected number of arguments 161 void InternalArrayConstructorConstantArgCountDescriptor::Initialize(
162 }; 162 Isolate* isolate) {
163 descriptor->Initialize(arraysize(registers), registers, representations); 163 // register state
164 } 164 // cp -- context
165 { 165 // a0 -- number of arguments
166 CallInterfaceDescriptor* descriptor = 166 // a1 -- constructor function
167 isolate->call_descriptor(CallDescriptorKey::KeyedCall); 167 Register registers[] = {cp, a1};
168 Register registers[] = { cp, // context 168 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
169 a2, // key 169 }
170 }; 170
171 Representation representations[] = { 171
172 Representation::Tagged(), // context 172 void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) {
173 Representation::Tagged(), // key 173 // stack param count needs (constructor pointer, and single argument)
174 }; 174 Register registers[] = {cp, a1, a0};
175 descriptor->Initialize(arraysize(registers), registers, representations); 175 Representation representations[] = {Representation::Tagged(),
176 } 176 Representation::Tagged(),
177 { 177 Representation::Integer32()};
178 CallInterfaceDescriptor* descriptor = 178 InitializeData(isolate, key(), arraysize(registers), registers,
179 isolate->call_descriptor(CallDescriptorKey::NamedCall); 179 representations);
180 Register registers[] = { cp, // context 180 }
181 a2, // name 181
182 }; 182
183 Representation representations[] = { 183 void CompareNilDescriptor::Initialize(Isolate* isolate) {
184 Representation::Tagged(), // context 184 Register registers[] = {cp, a0};
185 Representation::Tagged(), // name 185 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
186 }; 186 }
187 descriptor->Initialize(arraysize(registers), registers, representations); 187
188 } 188
189 { 189 void ToBooleanDescriptor::Initialize(Isolate* isolate) {
190 CallInterfaceDescriptor* descriptor = 190 Register registers[] = {cp, a0};
191 isolate->call_descriptor(CallDescriptorKey::CallHandler); 191 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
192 Register registers[] = { cp, // context 192 }
193 a0, // receiver 193
194 }; 194
195 Representation representations[] = { 195 void BinaryOpDescriptor::Initialize(Isolate* isolate) {
196 Representation::Tagged(), // context 196 Register registers[] = {cp, a1, a0};
197 Representation::Tagged(), // receiver 197 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
198 }; 198 }
199 descriptor->Initialize(arraysize(registers), registers, representations); 199
200 } 200
201 { 201 void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) {
202 CallInterfaceDescriptor* descriptor = 202 Register registers[] = {cp, a2, a1, a0};
203 isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); 203 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
204 Register registers[] = { cp, // context 204 }
205 a0, // callee 205
206 a4, // call_data 206
207 a2, // holder 207 void StringAddDescriptor::Initialize(Isolate* isolate) {
208 a1, // api_function_address 208 Register registers[] = {cp, a1, a0};
209 }; 209 InitializeData(isolate, key(), arraysize(registers), registers, NULL);
210 Representation representations[] = { 210 }
211 Representation::Tagged(), // context 211
212 Representation::Tagged(), // callee 212
213 Representation::Tagged(), // call_data 213 void KeyedDescriptor::Initialize(Isolate* isolate) {
214 Representation::Tagged(), // holder 214 Register registers[] = {
215 Representation::External(), // api_function_address 215 cp, // context
216 }; 216 a2, // key
217 descriptor->Initialize(arraysize(registers), registers, representations); 217 };
218 } 218 Representation representations[] = {
219 Representation::Tagged(), // context
220 Representation::Tagged(), // key
221 };
222 InitializeData(isolate, key(), arraysize(registers), registers,
223 representations);
224 }
225
226
227 void NamedDescriptor::Initialize(Isolate* isolate) {
228 Register registers[] = {
229 cp, // context
230 a2, // name
231 };
232 Representation representations[] = {
233 Representation::Tagged(), // context
234 Representation::Tagged(), // name
235 };
236 InitializeData(isolate, key(), arraysize(registers), registers,
237 representations);
238 }
239
240
241 void CallHandlerDescriptor::Initialize(Isolate* isolate) {
242 Register registers[] = {
243 cp, // context
244 a0, // receiver
245 };
246 Representation representations[] = {
247 Representation::Tagged(), // context
248 Representation::Tagged(), // receiver
249 };
250 InitializeData(isolate, key(), arraysize(registers), registers,
251 representations);
252 }
253
254
255 void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) {
256 Register registers[] = {
257 cp, // context
258 a1, // JSFunction
259 a0, // actual number of arguments
260 a2, // expected number of arguments
261 };
262 Representation representations[] = {
263 Representation::Tagged(), // context
264 Representation::Tagged(), // JSFunction
265 Representation::Integer32(), // actual number of arguments
266 Representation::Integer32(), // expected number of arguments
267 };
268 InitializeData(isolate, key(), arraysize(registers), registers,
269 representations);
270 }
271
272
273 void ApiFunctionDescriptor::Initialize(Isolate* isolate) {
274 Register registers[] = {
275 cp, // context
276 a0, // callee
277 a4, // call_data
278 a2, // holder
279 a1, // api_function_address
280 };
281 Representation representations[] = {
282 Representation::Tagged(), // context
283 Representation::Tagged(), // callee
284 Representation::Tagged(), // call_data
285 Representation::Tagged(), // holder
286 Representation::External(), // api_function_address
287 };
288 InitializeData(isolate, key(), arraysize(registers), registers,
289 representations);
219 } 290 }
220 } 291 }
221 } // namespace v8::internal 292 } // namespace v8::internal
222 293
223 #endif // V8_TARGET_ARCH_MIPS64 294 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698