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

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

Issue 354863002: MIPS: The IC exposes a register definition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « no previous file | src/mips/deoptimizer-mips.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
11 #include "src/codegen.h" 11 #include "src/codegen.h"
12 #include "src/regexp-macro-assembler.h" 12 #include "src/regexp-macro-assembler.h"
13 #include "src/stub-cache.h" 13 #include "src/stub-cache.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 17
18 18
19 void FastNewClosureStub::InitializeInterfaceDescriptor( 19 void FastNewClosureStub::InitializeInterfaceDescriptor(
20 CodeStubInterfaceDescriptor* descriptor) { 20 CodeStubInterfaceDescriptor* descriptor) {
21 static Register registers[] = { a2 }; 21 Register registers[] = { a2 };
22 descriptor->register_param_count_ = 1; 22 descriptor->Initialize(
23 descriptor->register_params_ = registers; 23 ARRAY_SIZE(registers), registers,
24 descriptor->deoptimization_handler_ = 24 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry);
25 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry;
26 } 25 }
27 26
28 27
29 void FastNewContextStub::InitializeInterfaceDescriptor( 28 void FastNewContextStub::InitializeInterfaceDescriptor(
30 CodeStubInterfaceDescriptor* descriptor) { 29 CodeStubInterfaceDescriptor* descriptor) {
31 static Register registers[] = { a1 }; 30 Register registers[] = { a1 };
32 descriptor->register_param_count_ = 1; 31 descriptor->Initialize(ARRAY_SIZE(registers), registers);
33 descriptor->register_params_ = registers;
34 descriptor->deoptimization_handler_ = NULL;
35 } 32 }
36 33
37 34
38 void ToNumberStub::InitializeInterfaceDescriptor( 35 void ToNumberStub::InitializeInterfaceDescriptor(
39 CodeStubInterfaceDescriptor* descriptor) { 36 CodeStubInterfaceDescriptor* descriptor) {
40 static Register registers[] = { a0 }; 37 Register registers[] = { a0 };
41 descriptor->register_param_count_ = 1; 38 descriptor->Initialize(ARRAY_SIZE(registers), registers);
42 descriptor->register_params_ = registers;
43 descriptor->deoptimization_handler_ = NULL;
44 } 39 }
45 40
46 41
47 void NumberToStringStub::InitializeInterfaceDescriptor( 42 void NumberToStringStub::InitializeInterfaceDescriptor(
48 CodeStubInterfaceDescriptor* descriptor) { 43 CodeStubInterfaceDescriptor* descriptor) {
49 static Register registers[] = { a0 }; 44 Register registers[] = { a0 };
50 descriptor->register_param_count_ = 1; 45 descriptor->Initialize(
51 descriptor->register_params_ = registers; 46 ARRAY_SIZE(registers), registers,
52 descriptor->deoptimization_handler_ = 47 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry);
53 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry;
54 } 48 }
55 49
56 50
57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 51 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
58 CodeStubInterfaceDescriptor* descriptor) { 52 CodeStubInterfaceDescriptor* descriptor) {
59 static Register registers[] = { a3, a2, a1 }; 53 Register registers[] = { a3, a2, a1 };
60 descriptor->register_param_count_ = 3; 54 Representation representations[] = {
61 descriptor->register_params_ = registers;
62 static Representation representations[] = {
63 Representation::Tagged(), 55 Representation::Tagged(),
64 Representation::Smi(), 56 Representation::Smi(),
65 Representation::Tagged() }; 57 Representation::Tagged() };
66 descriptor->register_param_representations_ = representations; 58 descriptor->Initialize(
67 descriptor->deoptimization_handler_ = 59 ARRAY_SIZE(registers), registers,
68 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry; 60 Runtime::FunctionForId(
61 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry,
62 representations);
69 } 63 }
70 64
71 65
72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 66 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
73 CodeStubInterfaceDescriptor* descriptor) { 67 CodeStubInterfaceDescriptor* descriptor) {
74 static Register registers[] = { a3, a2, a1, a0 }; 68 Register registers[] = { a3, a2, a1, a0 };
75 descriptor->register_param_count_ = 4; 69 descriptor->Initialize(
76 descriptor->register_params_ = registers; 70 ARRAY_SIZE(registers), registers,
77 descriptor->deoptimization_handler_ = 71 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry);
78 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry;
79 } 72 }
80 73
81 74
82 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( 75 void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
83 CodeStubInterfaceDescriptor* descriptor) { 76 CodeStubInterfaceDescriptor* descriptor) {
84 static Register registers[] = { a2, a3 }; 77 Register registers[] = { a2, a3 };
85 descriptor->register_param_count_ = 2; 78 descriptor->Initialize(ARRAY_SIZE(registers), registers);
86 descriptor->register_params_ = registers;
87 descriptor->deoptimization_handler_ = NULL;
88 }
89
90
91 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
92 CodeStubInterfaceDescriptor* descriptor) {
93 static Register registers[] = { a1, a0 };
94 descriptor->register_param_count_ = 2;
95 descriptor->register_params_ = registers;
96 descriptor->deoptimization_handler_ =
97 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
98 }
99
100
101 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
102 CodeStubInterfaceDescriptor* descriptor) {
103 static Register registers[] = {a1, a0 };
104 descriptor->register_param_count_ = 2;
105 descriptor->register_params_ = registers;
106 descriptor->deoptimization_handler_ =
107 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
108 } 79 }
109 80
110 81
111 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 82 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
112 CodeStubInterfaceDescriptor* descriptor) { 83 CodeStubInterfaceDescriptor* descriptor) {
113 static Register registers[] = { a2, a1, a0 }; 84 Register registers[] = { a2, a1, a0 };
114 descriptor->register_param_count_ = 3; 85 descriptor->Initialize(
115 descriptor->register_params_ = registers; 86 ARRAY_SIZE(registers), registers,
116 descriptor->deoptimization_handler_ = 87 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry);
117 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry;
118 }
119
120
121 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor(
122 CodeStubInterfaceDescriptor* descriptor) {
123 static Register registers[] = { a1, a0 };
124 descriptor->register_param_count_ = 2;
125 descriptor->register_params_ = registers;
126 descriptor->deoptimization_handler_ =
127 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry;
128 } 88 }
129 89
130 90
131 void LoadFieldStub::InitializeInterfaceDescriptor( 91 void LoadFieldStub::InitializeInterfaceDescriptor(
132 CodeStubInterfaceDescriptor* descriptor) { 92 CodeStubInterfaceDescriptor* descriptor) {
133 static Register registers[] = { a0 }; 93 Register registers[] = { a0 };
134 descriptor->register_param_count_ = 1; 94 descriptor->Initialize(ARRAY_SIZE(registers), registers);
135 descriptor->register_params_ = registers;
136 descriptor->deoptimization_handler_ = NULL;
137 } 95 }
138 96
139 97
140 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 98 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
141 CodeStubInterfaceDescriptor* descriptor) { 99 CodeStubInterfaceDescriptor* descriptor) {
142 static Register registers[] = { a1 }; 100 Register registers[] = { a1 };
143 descriptor->register_param_count_ = 1; 101 descriptor->Initialize(ARRAY_SIZE(registers), registers);
144 descriptor->register_params_ = registers;
145 descriptor->deoptimization_handler_ = NULL;
146 } 102 }
147 103
148 104
149 void StringLengthStub::InitializeInterfaceDescriptor( 105 void StringLengthStub::InitializeInterfaceDescriptor(
150 CodeStubInterfaceDescriptor* descriptor) { 106 CodeStubInterfaceDescriptor* descriptor) {
151 static Register registers[] = { a0, a2 }; 107 Register registers[] = { a0, a2 };
152 descriptor->register_param_count_ = 2; 108 descriptor->Initialize(ARRAY_SIZE(registers), registers);
153 descriptor->register_params_ = registers;
154 descriptor->deoptimization_handler_ = NULL;
155 } 109 }
156 110
157 111
158 void KeyedStringLengthStub::InitializeInterfaceDescriptor( 112 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
159 CodeStubInterfaceDescriptor* descriptor) { 113 CodeStubInterfaceDescriptor* descriptor) {
160 static Register registers[] = { a1, a0 }; 114 Register registers[] = { a1, a0 };
161 descriptor->register_param_count_ = 2; 115 descriptor->Initialize(ARRAY_SIZE(registers), registers);
162 descriptor->register_params_ = registers;
163 descriptor->deoptimization_handler_ = NULL;
164 } 116 }
165 117
166 118
167 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 119 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
168 CodeStubInterfaceDescriptor* descriptor) { 120 CodeStubInterfaceDescriptor* descriptor) {
169 static Register registers[] = { a2, a1, a0 }; 121 Register registers[] = { a2, a1, a0 };
170 descriptor->register_param_count_ = 3; 122 descriptor->Initialize(
171 descriptor->register_params_ = registers; 123 ARRAY_SIZE(registers), registers,
172 descriptor->deoptimization_handler_ = 124 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
173 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
174 } 125 }
175 126
176 127
177 void TransitionElementsKindStub::InitializeInterfaceDescriptor( 128 void TransitionElementsKindStub::InitializeInterfaceDescriptor(
178 CodeStubInterfaceDescriptor* descriptor) { 129 CodeStubInterfaceDescriptor* descriptor) {
179 static Register registers[] = { a0, a1 }; 130 Register registers[] = { a0, a1 };
180 descriptor->register_param_count_ = 2;
181 descriptor->register_params_ = registers;
182 Address entry = 131 Address entry =
183 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; 132 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
184 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); 133 descriptor->Initialize(ARRAY_SIZE(registers), registers,
134 FUNCTION_ADDR(entry));
185 } 135 }
186 136
187 137
188 void CompareNilICStub::InitializeInterfaceDescriptor( 138 void CompareNilICStub::InitializeInterfaceDescriptor(
189 CodeStubInterfaceDescriptor* descriptor) { 139 CodeStubInterfaceDescriptor* descriptor) {
190 static Register registers[] = { a0 }; 140 Register registers[] = { a0 };
191 descriptor->register_param_count_ = 1; 141 descriptor->Initialize(ARRAY_SIZE(registers), registers,
192 descriptor->register_params_ = registers; 142 FUNCTION_ADDR(CompareNilIC_Miss));
193 descriptor->deoptimization_handler_ =
194 FUNCTION_ADDR(CompareNilIC_Miss);
195 descriptor->SetMissHandler( 143 descriptor->SetMissHandler(
196 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); 144 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
197 } 145 }
198 146
199 147
200 static void InitializeArrayConstructorDescriptor( 148 static void InitializeArrayConstructorDescriptor(
201 CodeStubInterfaceDescriptor* descriptor, 149 CodeStubInterfaceDescriptor* descriptor,
202 int constant_stack_parameter_count) { 150 int constant_stack_parameter_count) {
203 // register state 151 // register state
204 // a0 -- number of arguments 152 // a0 -- number of arguments
205 // a1 -- function 153 // a1 -- function
206 // a2 -- allocation site with elements kind 154 // a2 -- allocation site with elements kind
207 static Register registers_variable_args[] = { a1, a2, a0 }; 155 Address deopt_handler = Runtime::FunctionForId(
208 static Register registers_no_args[] = { a1, a2 }; 156 Runtime::kHiddenArrayConstructor)->entry;
209 157
210 if (constant_stack_parameter_count == 0) { 158 if (constant_stack_parameter_count == 0) {
211 descriptor->register_param_count_ = 2; 159 Register registers[] = { a1, a2 };
212 descriptor->register_params_ = registers_no_args; 160 descriptor->Initialize(ARRAY_SIZE(registers), registers,
161 deopt_handler,
162 NULL,
163 constant_stack_parameter_count,
164 JS_FUNCTION_STUB_MODE);
213 } else { 165 } else {
214 // stack param count needs (constructor pointer, and single argument) 166 // stack param count needs (constructor pointer, and single argument)
215 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 167 Register registers[] = { a1, a2, a0 };
216 descriptor->stack_parameter_count_ = a0; 168 Representation representations[] = {
217 descriptor->register_param_count_ = 3;
218 descriptor->register_params_ = registers_variable_args;
219 static Representation representations[] = {
220 Representation::Tagged(), 169 Representation::Tagged(),
221 Representation::Tagged(), 170 Representation::Tagged(),
222 Representation::Integer32() }; 171 Representation::Integer32() };
223 descriptor->register_param_representations_ = representations; 172 descriptor->Initialize(ARRAY_SIZE(registers), registers,
173 a0,
174 deopt_handler,
175 representations,
176 constant_stack_parameter_count,
177 JS_FUNCTION_STUB_MODE,
178 PASS_ARGUMENTS);
224 } 179 }
225
226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
228 descriptor->deoptimization_handler_ =
229 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
230 } 180 }
231 181
232 182
233 static void InitializeInternalArrayConstructorDescriptor( 183 static void InitializeInternalArrayConstructorDescriptor(
234 CodeStubInterfaceDescriptor* descriptor, 184 CodeStubInterfaceDescriptor* descriptor,
235 int constant_stack_parameter_count) { 185 int constant_stack_parameter_count) {
236 // register state 186 // register state
237 // a0 -- number of arguments 187 // a0 -- number of arguments
238 // a1 -- constructor function 188 // a1 -- constructor function
239 static Register registers_variable_args[] = { a1, a0 }; 189 Address deopt_handler = Runtime::FunctionForId(
240 static Register registers_no_args[] = { a1 }; 190 Runtime::kHiddenInternalArrayConstructor)->entry;
241 191
242 if (constant_stack_parameter_count == 0) { 192 if (constant_stack_parameter_count == 0) {
243 descriptor->register_param_count_ = 1; 193 Register registers[] = { a1 };
244 descriptor->register_params_ = registers_no_args; 194 descriptor->Initialize(ARRAY_SIZE(registers), registers,
195 deopt_handler,
196 NULL,
197 constant_stack_parameter_count,
198 JS_FUNCTION_STUB_MODE);
245 } else { 199 } else {
246 // stack param count needs (constructor pointer, and single argument) 200 // stack param count needs (constructor pointer, and single argument)
247 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 201 Register registers[] = { a1, a0 };
248 descriptor->stack_parameter_count_ = a0; 202 Representation representations[] = {
249 descriptor->register_param_count_ = 2;
250 descriptor->register_params_ = registers_variable_args;
251 static Representation representations[] = {
252 Representation::Tagged(), 203 Representation::Tagged(),
253 Representation::Integer32() }; 204 Representation::Integer32() };
254 descriptor->register_param_representations_ = representations; 205 descriptor->Initialize(ARRAY_SIZE(registers), registers,
206 a0,
207 deopt_handler,
208 representations,
209 constant_stack_parameter_count,
210 JS_FUNCTION_STUB_MODE,
211 PASS_ARGUMENTS);
255 } 212 }
256
257 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
258 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
259 descriptor->deoptimization_handler_ =
260 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
261 } 213 }
262 214
263 215
264 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 216 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
265 CodeStubInterfaceDescriptor* descriptor) { 217 CodeStubInterfaceDescriptor* descriptor) {
266 InitializeArrayConstructorDescriptor(descriptor, 0); 218 InitializeArrayConstructorDescriptor(descriptor, 0);
267 } 219 }
268 220
269 221
270 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 222 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
271 CodeStubInterfaceDescriptor* descriptor) { 223 CodeStubInterfaceDescriptor* descriptor) {
272 InitializeArrayConstructorDescriptor(descriptor, 1); 224 InitializeArrayConstructorDescriptor(descriptor, 1);
273 } 225 }
274 226
275 227
276 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 228 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
277 CodeStubInterfaceDescriptor* descriptor) { 229 CodeStubInterfaceDescriptor* descriptor) {
278 InitializeArrayConstructorDescriptor(descriptor, -1); 230 InitializeArrayConstructorDescriptor(descriptor, -1);
279 } 231 }
280 232
281 233
282 void ToBooleanStub::InitializeInterfaceDescriptor( 234 void ToBooleanStub::InitializeInterfaceDescriptor(
283 CodeStubInterfaceDescriptor* descriptor) { 235 CodeStubInterfaceDescriptor* descriptor) {
284 static Register registers[] = { a0 }; 236 Register registers[] = { a0 };
285 descriptor->register_param_count_ = 1; 237 descriptor->Initialize(ARRAY_SIZE(registers), registers,
286 descriptor->register_params_ = registers; 238 FUNCTION_ADDR(ToBooleanIC_Miss));
287 descriptor->deoptimization_handler_ =
288 FUNCTION_ADDR(ToBooleanIC_Miss);
289 descriptor->SetMissHandler( 239 descriptor->SetMissHandler(
290 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); 240 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
291 } 241 }
292 242
293 243
294 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 244 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
295 CodeStubInterfaceDescriptor* descriptor) { 245 CodeStubInterfaceDescriptor* descriptor) {
296 InitializeInternalArrayConstructorDescriptor(descriptor, 0); 246 InitializeInternalArrayConstructorDescriptor(descriptor, 0);
297 } 247 }
298 248
299 249
300 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 250 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
301 CodeStubInterfaceDescriptor* descriptor) { 251 CodeStubInterfaceDescriptor* descriptor) {
302 InitializeInternalArrayConstructorDescriptor(descriptor, 1); 252 InitializeInternalArrayConstructorDescriptor(descriptor, 1);
303 } 253 }
304 254
305 255
306 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 256 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
307 CodeStubInterfaceDescriptor* descriptor) { 257 CodeStubInterfaceDescriptor* descriptor) {
308 InitializeInternalArrayConstructorDescriptor(descriptor, -1); 258 InitializeInternalArrayConstructorDescriptor(descriptor, -1);
309 } 259 }
310 260
311 261
312 void StoreGlobalStub::InitializeInterfaceDescriptor( 262 void StoreGlobalStub::InitializeInterfaceDescriptor(
313 CodeStubInterfaceDescriptor* descriptor) { 263 CodeStubInterfaceDescriptor* descriptor) {
314 static Register registers[] = { a1, a2, a0 }; 264 Register registers[] = { a1, a2, a0 };
315 descriptor->register_param_count_ = 3; 265 descriptor->Initialize(ARRAY_SIZE(registers), registers,
316 descriptor->register_params_ = registers; 266 FUNCTION_ADDR(StoreIC_MissFromStubFailure));
317 descriptor->deoptimization_handler_ =
318 FUNCTION_ADDR(StoreIC_MissFromStubFailure);
319 } 267 }
320 268
321 269
322 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( 270 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
323 CodeStubInterfaceDescriptor* descriptor) { 271 CodeStubInterfaceDescriptor* descriptor) {
324 static Register registers[] = { a0, a3, a1, a2 }; 272 Register registers[] = { a0, a3, a1, a2 };
325 descriptor->register_param_count_ = 4; 273 descriptor->Initialize(ARRAY_SIZE(registers), registers,
326 descriptor->register_params_ = registers; 274 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
327 descriptor->deoptimization_handler_ =
328 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
329 } 275 }
330 276
331 277
332 void BinaryOpICStub::InitializeInterfaceDescriptor( 278 void BinaryOpICStub::InitializeInterfaceDescriptor(
333 CodeStubInterfaceDescriptor* descriptor) { 279 CodeStubInterfaceDescriptor* descriptor) {
334 static Register registers[] = { a1, a0 }; 280 Register registers[] = { a1, a0 };
335 descriptor->register_param_count_ = 2; 281 descriptor->Initialize(ARRAY_SIZE(registers), registers,
336 descriptor->register_params_ = registers; 282 FUNCTION_ADDR(BinaryOpIC_Miss));
337 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
338 descriptor->SetMissHandler( 283 descriptor->SetMissHandler(
339 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); 284 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
340 } 285 }
341 286
342 287
343 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( 288 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
344 CodeStubInterfaceDescriptor* descriptor) { 289 CodeStubInterfaceDescriptor* descriptor) {
345 static Register registers[] = { a2, a1, a0 }; 290 Register registers[] = { a2, a1, a0 };
346 descriptor->register_param_count_ = 3; 291 descriptor->Initialize(ARRAY_SIZE(registers), registers,
347 descriptor->register_params_ = registers; 292 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
348 descriptor->deoptimization_handler_ =
349 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite);
350 } 293 }
351 294
352 295
353 void StringAddStub::InitializeInterfaceDescriptor( 296 void StringAddStub::InitializeInterfaceDescriptor(
354 CodeStubInterfaceDescriptor* descriptor) { 297 CodeStubInterfaceDescriptor* descriptor) {
355 static Register registers[] = { a1, a0 }; 298 Register registers[] = { a1, a0 };
356 descriptor->register_param_count_ = 2; 299 descriptor->Initialize(
357 descriptor->register_params_ = registers; 300 ARRAY_SIZE(registers), registers,
358 descriptor->deoptimization_handler_ = 301 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry);
359 Runtime::FunctionForId(Runtime::kStringAdd)->entry;
360 } 302 }
361 303
362 304
363 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 305 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
364 { 306 {
365 CallInterfaceDescriptor* descriptor = 307 CallInterfaceDescriptor* descriptor =
366 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); 308 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
367 static Register registers[] = { a1, // JSFunction 309 static Register registers[] = { a1, // JSFunction
368 cp, // context 310 cp, // context
369 a0, // actual number of arguments 311 a0, // actual number of arguments
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, 401 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
460 Register lhs, 402 Register lhs,
461 Register rhs); 403 Register rhs);
462 404
463 405
464 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { 406 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
465 // Update the static counter each time a new code stub is generated. 407 // Update the static counter each time a new code stub is generated.
466 isolate()->counters()->code_stubs()->Increment(); 408 isolate()->counters()->code_stubs()->Increment();
467 409
468 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); 410 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
469 int param_count = descriptor->register_param_count_; 411 int param_count = descriptor->register_param_count();
470 { 412 {
471 // Call the runtime system in a fresh internal frame. 413 // Call the runtime system in a fresh internal frame.
472 FrameScope scope(masm, StackFrame::INTERNAL); 414 FrameScope scope(masm, StackFrame::INTERNAL);
473 ASSERT(descriptor->register_param_count_ == 0 || 415 ASSERT(descriptor->register_param_count() == 0 ||
474 a0.is(descriptor->register_params_[param_count - 1])); 416 a0.is(descriptor->GetParameterRegister(param_count - 1)));
475 // Push arguments, adjust sp. 417 // Push arguments, adjust sp.
476 __ Subu(sp, sp, Operand(param_count * kPointerSize)); 418 __ Subu(sp, sp, Operand(param_count * kPointerSize));
477 for (int i = 0; i < param_count; ++i) { 419 for (int i = 0; i < param_count; ++i) {
478 // Store argument to stack. 420 // Store argument to stack.
479 __ sw(descriptor->register_params_[i], 421 __ sw(descriptor->GetParameterRegister(i),
480 MemOperand(sp, (param_count-1-i) * kPointerSize)); 422 MemOperand(sp, (param_count-1-i) * kPointerSize));
481 } 423 }
482 ExternalReference miss = descriptor->miss_handler(); 424 ExternalReference miss = descriptor->miss_handler();
483 __ CallExternalReference(miss, descriptor->register_param_count_); 425 __ CallExternalReference(miss, descriptor->register_param_count());
484 } 426 }
485 427
486 __ Ret(); 428 __ Ret();
487 } 429 }
488 430
489 431
490 // Takes a Smi and converts to an IEEE 64 bit floating point value in two 432 // Takes a Smi and converts to an IEEE 64 bit floating point value in two
491 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and 433 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and
492 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a 434 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a
493 // scratch register. Destroys the source register. No GC occurs during this 435 // scratch register. Destroys the source register. No GC occurs during this
(...skipping 4912 matching lines...) Expand 10 before | Expand all | Expand 10 after
5406 MemOperand(fp, 6 * kPointerSize), 5348 MemOperand(fp, 6 * kPointerSize),
5407 NULL); 5349 NULL);
5408 } 5350 }
5409 5351
5410 5352
5411 #undef __ 5353 #undef __
5412 5354
5413 } } // namespace v8::internal 5355 } } // namespace v8::internal
5414 5356
5415 #endif // V8_TARGET_ARCH_MIPS 5357 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698