OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
34 #include "codegen.h" | 34 #include "codegen.h" |
35 #include "regexp-macro-assembler.h" | 35 #include "regexp-macro-assembler.h" |
36 #include "stub-cache.h" | 36 #include "stub-cache.h" |
37 | 37 |
38 namespace v8 { | 38 namespace v8 { |
39 namespace internal { | 39 namespace internal { |
40 | 40 |
41 | 41 |
42 void FastNewClosureStub::InitializeInterfaceDescriptor( | 42 void FastNewClosureStub::InitializeInterfaceDescriptor( |
43 Isolate* isolate, | |
44 CodeStubInterfaceDescriptor* descriptor) { | 43 CodeStubInterfaceDescriptor* descriptor) { |
45 static Register registers[] = { a2 }; | 44 static Register registers[] = { a2 }; |
46 descriptor->register_param_count_ = 1; | 45 descriptor->register_param_count_ = 1; |
47 descriptor->register_params_ = registers; | 46 descriptor->register_params_ = registers; |
48 descriptor->deoptimization_handler_ = | 47 descriptor->deoptimization_handler_ = |
49 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | 48 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; |
50 } | 49 } |
51 | 50 |
52 | 51 |
53 void FastNewContextStub::InitializeInterfaceDescriptor( | 52 void FastNewContextStub::InitializeInterfaceDescriptor( |
54 Isolate* isolate, | |
55 CodeStubInterfaceDescriptor* descriptor) { | 53 CodeStubInterfaceDescriptor* descriptor) { |
56 static Register registers[] = { a1 }; | 54 static Register registers[] = { a1 }; |
57 descriptor->register_param_count_ = 1; | 55 descriptor->register_param_count_ = 1; |
58 descriptor->register_params_ = registers; | 56 descriptor->register_params_ = registers; |
59 descriptor->deoptimization_handler_ = NULL; | 57 descriptor->deoptimization_handler_ = NULL; |
60 } | 58 } |
61 | 59 |
62 | 60 |
63 void ToNumberStub::InitializeInterfaceDescriptor( | 61 void ToNumberStub::InitializeInterfaceDescriptor( |
64 Isolate* isolate, | |
65 CodeStubInterfaceDescriptor* descriptor) { | 62 CodeStubInterfaceDescriptor* descriptor) { |
66 static Register registers[] = { a0 }; | 63 static Register registers[] = { a0 }; |
67 descriptor->register_param_count_ = 1; | 64 descriptor->register_param_count_ = 1; |
68 descriptor->register_params_ = registers; | 65 descriptor->register_params_ = registers; |
69 descriptor->deoptimization_handler_ = NULL; | 66 descriptor->deoptimization_handler_ = NULL; |
70 } | 67 } |
71 | 68 |
72 | 69 |
73 void NumberToStringStub::InitializeInterfaceDescriptor( | 70 void NumberToStringStub::InitializeInterfaceDescriptor( |
74 Isolate* isolate, | |
75 CodeStubInterfaceDescriptor* descriptor) { | 71 CodeStubInterfaceDescriptor* descriptor) { |
76 static Register registers[] = { a0 }; | 72 static Register registers[] = { a0 }; |
77 descriptor->register_param_count_ = 1; | 73 descriptor->register_param_count_ = 1; |
78 descriptor->register_params_ = registers; | 74 descriptor->register_params_ = registers; |
79 descriptor->deoptimization_handler_ = | 75 descriptor->deoptimization_handler_ = |
80 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | 76 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
81 } | 77 } |
82 | 78 |
83 | 79 |
84 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 80 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
85 Isolate* isolate, | |
86 CodeStubInterfaceDescriptor* descriptor) { | 81 CodeStubInterfaceDescriptor* descriptor) { |
87 static Register registers[] = { a3, a2, a1 }; | 82 static Register registers[] = { a3, a2, a1 }; |
88 descriptor->register_param_count_ = 3; | 83 descriptor->register_param_count_ = 3; |
89 descriptor->register_params_ = registers; | 84 descriptor->register_params_ = registers; |
90 descriptor->deoptimization_handler_ = | 85 descriptor->deoptimization_handler_ = |
91 Runtime::FunctionForId( | 86 Runtime::FunctionForId( |
92 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 87 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
93 } | 88 } |
94 | 89 |
95 | 90 |
96 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 91 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
97 Isolate* isolate, | |
98 CodeStubInterfaceDescriptor* descriptor) { | 92 CodeStubInterfaceDescriptor* descriptor) { |
99 static Register registers[] = { a3, a2, a1, a0 }; | 93 static Register registers[] = { a3, a2, a1, a0 }; |
100 descriptor->register_param_count_ = 4; | 94 descriptor->register_param_count_ = 4; |
101 descriptor->register_params_ = registers; | 95 descriptor->register_params_ = registers; |
102 descriptor->deoptimization_handler_ = | 96 descriptor->deoptimization_handler_ = |
103 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | 97 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; |
104 } | 98 } |
105 | 99 |
106 | 100 |
107 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 101 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
108 Isolate* isolate, | |
109 CodeStubInterfaceDescriptor* descriptor) { | 102 CodeStubInterfaceDescriptor* descriptor) { |
110 static Register registers[] = { a2, a3 }; | 103 static Register registers[] = { a2, a3 }; |
111 descriptor->register_param_count_ = 2; | 104 descriptor->register_param_count_ = 2; |
112 descriptor->register_params_ = registers; | 105 descriptor->register_params_ = registers; |
113 descriptor->deoptimization_handler_ = NULL; | 106 descriptor->deoptimization_handler_ = NULL; |
114 } | 107 } |
115 | 108 |
116 | 109 |
117 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | 110 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( |
118 Isolate* isolate, | |
119 CodeStubInterfaceDescriptor* descriptor) { | 111 CodeStubInterfaceDescriptor* descriptor) { |
120 static Register registers[] = { a1, a0 }; | 112 static Register registers[] = { a1, a0 }; |
121 descriptor->register_param_count_ = 2; | 113 descriptor->register_param_count_ = 2; |
122 descriptor->register_params_ = registers; | 114 descriptor->register_params_ = registers; |
123 descriptor->deoptimization_handler_ = | 115 descriptor->deoptimization_handler_ = |
124 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | 116 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
125 } | 117 } |
126 | 118 |
127 | 119 |
128 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( | 120 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( |
129 Isolate* isolate, | |
130 CodeStubInterfaceDescriptor* descriptor) { | 121 CodeStubInterfaceDescriptor* descriptor) { |
131 static Register registers[] = {a1, a0 }; | 122 static Register registers[] = {a1, a0 }; |
132 descriptor->register_param_count_ = 2; | 123 descriptor->register_param_count_ = 2; |
133 descriptor->register_params_ = registers; | 124 descriptor->register_params_ = registers; |
134 descriptor->deoptimization_handler_ = | 125 descriptor->deoptimization_handler_ = |
135 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | 126 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
136 } | 127 } |
137 | 128 |
138 | 129 |
139 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 130 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
140 Isolate* isolate, | |
141 CodeStubInterfaceDescriptor* descriptor) { | 131 CodeStubInterfaceDescriptor* descriptor) { |
142 static Register registers[] = { a2, a1, a0 }; | 132 static Register registers[] = { a2, a1, a0 }; |
143 descriptor->register_param_count_ = 3; | 133 descriptor->register_param_count_ = 3; |
144 descriptor->register_params_ = registers; | 134 descriptor->register_params_ = registers; |
145 descriptor->deoptimization_handler_ = | 135 descriptor->deoptimization_handler_ = |
146 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | 136 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; |
147 } | 137 } |
148 | 138 |
149 | 139 |
150 void LoadFieldStub::InitializeInterfaceDescriptor( | 140 void LoadFieldStub::InitializeInterfaceDescriptor( |
151 Isolate* isolate, | |
152 CodeStubInterfaceDescriptor* descriptor) { | 141 CodeStubInterfaceDescriptor* descriptor) { |
153 static Register registers[] = { a0 }; | 142 static Register registers[] = { a0 }; |
154 descriptor->register_param_count_ = 1; | 143 descriptor->register_param_count_ = 1; |
155 descriptor->register_params_ = registers; | 144 descriptor->register_params_ = registers; |
156 descriptor->deoptimization_handler_ = NULL; | 145 descriptor->deoptimization_handler_ = NULL; |
157 } | 146 } |
158 | 147 |
159 | 148 |
160 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 149 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
161 Isolate* isolate, | |
162 CodeStubInterfaceDescriptor* descriptor) { | 150 CodeStubInterfaceDescriptor* descriptor) { |
163 static Register registers[] = { a1 }; | 151 static Register registers[] = { a1 }; |
164 descriptor->register_param_count_ = 1; | 152 descriptor->register_param_count_ = 1; |
165 descriptor->register_params_ = registers; | 153 descriptor->register_params_ = registers; |
166 descriptor->deoptimization_handler_ = NULL; | 154 descriptor->deoptimization_handler_ = NULL; |
167 } | 155 } |
168 | 156 |
169 | 157 |
170 void StringLengthStub::InitializeInterfaceDescriptor( | 158 void StringLengthStub::InitializeInterfaceDescriptor( |
171 Isolate* isolate, | |
172 CodeStubInterfaceDescriptor* descriptor) { | 159 CodeStubInterfaceDescriptor* descriptor) { |
173 static Register registers[] = { a0, a2 }; | 160 static Register registers[] = { a0, a2 }; |
174 descriptor->register_param_count_ = 2; | 161 descriptor->register_param_count_ = 2; |
175 descriptor->register_params_ = registers; | 162 descriptor->register_params_ = registers; |
176 descriptor->deoptimization_handler_ = NULL; | 163 descriptor->deoptimization_handler_ = NULL; |
177 } | 164 } |
178 | 165 |
179 | 166 |
180 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 167 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
181 Isolate* isolate, | |
182 CodeStubInterfaceDescriptor* descriptor) { | 168 CodeStubInterfaceDescriptor* descriptor) { |
183 static Register registers[] = { a1, a0 }; | 169 static Register registers[] = { a1, a0 }; |
184 descriptor->register_param_count_ = 2; | 170 descriptor->register_param_count_ = 2; |
185 descriptor->register_params_ = registers; | 171 descriptor->register_params_ = registers; |
186 descriptor->deoptimization_handler_ = NULL; | 172 descriptor->deoptimization_handler_ = NULL; |
187 } | 173 } |
188 | 174 |
189 | 175 |
190 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 176 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
191 Isolate* isolate, | |
192 CodeStubInterfaceDescriptor* descriptor) { | 177 CodeStubInterfaceDescriptor* descriptor) { |
193 static Register registers[] = { a2, a1, a0 }; | 178 static Register registers[] = { a2, a1, a0 }; |
194 descriptor->register_param_count_ = 3; | 179 descriptor->register_param_count_ = 3; |
195 descriptor->register_params_ = registers; | 180 descriptor->register_params_ = registers; |
196 descriptor->deoptimization_handler_ = | 181 descriptor->deoptimization_handler_ = |
197 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 182 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
198 } | 183 } |
199 | 184 |
200 | 185 |
201 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 186 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
202 Isolate* isolate, | |
203 CodeStubInterfaceDescriptor* descriptor) { | 187 CodeStubInterfaceDescriptor* descriptor) { |
204 static Register registers[] = { a0, a1 }; | 188 static Register registers[] = { a0, a1 }; |
205 descriptor->register_param_count_ = 2; | 189 descriptor->register_param_count_ = 2; |
206 descriptor->register_params_ = registers; | 190 descriptor->register_params_ = registers; |
207 Address entry = | 191 Address entry = |
208 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 192 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
209 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); | 193 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); |
210 } | 194 } |
211 | 195 |
212 | 196 |
213 void CompareNilICStub::InitializeInterfaceDescriptor( | 197 void CompareNilICStub::InitializeInterfaceDescriptor( |
214 Isolate* isolate, | |
215 CodeStubInterfaceDescriptor* descriptor) { | 198 CodeStubInterfaceDescriptor* descriptor) { |
216 static Register registers[] = { a0 }; | 199 static Register registers[] = { a0 }; |
217 descriptor->register_param_count_ = 1; | 200 descriptor->register_param_count_ = 1; |
218 descriptor->register_params_ = registers; | 201 descriptor->register_params_ = registers; |
219 descriptor->deoptimization_handler_ = | 202 descriptor->deoptimization_handler_ = |
220 FUNCTION_ADDR(CompareNilIC_Miss); | 203 FUNCTION_ADDR(CompareNilIC_Miss); |
221 descriptor->SetMissHandler( | 204 descriptor->SetMissHandler( |
222 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate)); | 205 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
223 } | 206 } |
224 | 207 |
225 | 208 |
226 static void InitializeArrayConstructorDescriptor( | 209 static void InitializeArrayConstructorDescriptor( |
227 Isolate* isolate, | |
228 CodeStubInterfaceDescriptor* descriptor, | 210 CodeStubInterfaceDescriptor* descriptor, |
229 int constant_stack_parameter_count) { | 211 int constant_stack_parameter_count) { |
230 // register state | 212 // register state |
231 // a0 -- number of arguments | 213 // a0 -- number of arguments |
232 // a1 -- function | 214 // a1 -- function |
233 // a2 -- allocation site with elements kind | 215 // a2 -- allocation site with elements kind |
234 static Register registers_variable_args[] = { a1, a2, a0 }; | 216 static Register registers_variable_args[] = { a1, a2, a0 }; |
235 static Register registers_no_args[] = { a1, a2 }; | 217 static Register registers_no_args[] = { a1, a2 }; |
236 | 218 |
237 if (constant_stack_parameter_count == 0) { | 219 if (constant_stack_parameter_count == 0) { |
238 descriptor->register_param_count_ = 2; | 220 descriptor->register_param_count_ = 2; |
239 descriptor->register_params_ = registers_no_args; | 221 descriptor->register_params_ = registers_no_args; |
240 } else { | 222 } else { |
241 // stack param count needs (constructor pointer, and single argument) | 223 // stack param count needs (constructor pointer, and single argument) |
242 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 224 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
243 descriptor->stack_parameter_count_ = a0; | 225 descriptor->stack_parameter_count_ = a0; |
244 descriptor->register_param_count_ = 3; | 226 descriptor->register_param_count_ = 3; |
245 descriptor->register_params_ = registers_variable_args; | 227 descriptor->register_params_ = registers_variable_args; |
246 } | 228 } |
247 | 229 |
248 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 230 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
249 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 231 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
250 descriptor->deoptimization_handler_ = | 232 descriptor->deoptimization_handler_ = |
251 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | 233 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
252 } | 234 } |
253 | 235 |
254 | 236 |
255 static void InitializeInternalArrayConstructorDescriptor( | 237 static void InitializeInternalArrayConstructorDescriptor( |
256 Isolate* isolate, | |
257 CodeStubInterfaceDescriptor* descriptor, | 238 CodeStubInterfaceDescriptor* descriptor, |
258 int constant_stack_parameter_count) { | 239 int constant_stack_parameter_count) { |
259 // register state | 240 // register state |
260 // a0 -- number of arguments | 241 // a0 -- number of arguments |
261 // a1 -- constructor function | 242 // a1 -- constructor function |
262 static Register registers_variable_args[] = { a1, a0 }; | 243 static Register registers_variable_args[] = { a1, a0 }; |
263 static Register registers_no_args[] = { a1 }; | 244 static Register registers_no_args[] = { a1 }; |
264 | 245 |
265 if (constant_stack_parameter_count == 0) { | 246 if (constant_stack_parameter_count == 0) { |
266 descriptor->register_param_count_ = 1; | 247 descriptor->register_param_count_ = 1; |
267 descriptor->register_params_ = registers_no_args; | 248 descriptor->register_params_ = registers_no_args; |
268 } else { | 249 } else { |
269 // stack param count needs (constructor pointer, and single argument) | 250 // stack param count needs (constructor pointer, and single argument) |
270 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 251 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
271 descriptor->stack_parameter_count_ = a0; | 252 descriptor->stack_parameter_count_ = a0; |
272 descriptor->register_param_count_ = 2; | 253 descriptor->register_param_count_ = 2; |
273 descriptor->register_params_ = registers_variable_args; | 254 descriptor->register_params_ = registers_variable_args; |
274 } | 255 } |
275 | 256 |
276 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 257 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
277 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 258 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
278 descriptor->deoptimization_handler_ = | 259 descriptor->deoptimization_handler_ = |
279 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | 260 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
280 } | 261 } |
281 | 262 |
282 | 263 |
283 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 264 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
284 Isolate* isolate, | |
285 CodeStubInterfaceDescriptor* descriptor) { | 265 CodeStubInterfaceDescriptor* descriptor) { |
286 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 266 InitializeArrayConstructorDescriptor(descriptor, 0); |
287 } | 267 } |
288 | 268 |
289 | 269 |
290 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 270 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
291 Isolate* isolate, | |
292 CodeStubInterfaceDescriptor* descriptor) { | 271 CodeStubInterfaceDescriptor* descriptor) { |
293 InitializeArrayConstructorDescriptor(isolate, descriptor, 1); | 272 InitializeArrayConstructorDescriptor(descriptor, 1); |
294 } | 273 } |
295 | 274 |
296 | 275 |
297 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 276 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
298 Isolate* isolate, | |
299 CodeStubInterfaceDescriptor* descriptor) { | 277 CodeStubInterfaceDescriptor* descriptor) { |
300 InitializeArrayConstructorDescriptor(isolate, descriptor, -1); | 278 InitializeArrayConstructorDescriptor(descriptor, -1); |
301 } | 279 } |
302 | 280 |
303 | 281 |
304 void ToBooleanStub::InitializeInterfaceDescriptor( | 282 void ToBooleanStub::InitializeInterfaceDescriptor( |
305 Isolate* isolate, | |
306 CodeStubInterfaceDescriptor* descriptor) { | 283 CodeStubInterfaceDescriptor* descriptor) { |
307 static Register registers[] = { a0 }; | 284 static Register registers[] = { a0 }; |
308 descriptor->register_param_count_ = 1; | 285 descriptor->register_param_count_ = 1; |
309 descriptor->register_params_ = registers; | 286 descriptor->register_params_ = registers; |
310 descriptor->deoptimization_handler_ = | 287 descriptor->deoptimization_handler_ = |
311 FUNCTION_ADDR(ToBooleanIC_Miss); | 288 FUNCTION_ADDR(ToBooleanIC_Miss); |
312 descriptor->SetMissHandler( | 289 descriptor->SetMissHandler( |
313 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate)); | 290 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
314 } | 291 } |
315 | 292 |
316 | 293 |
317 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 294 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
318 Isolate* isolate, | |
319 CodeStubInterfaceDescriptor* descriptor) { | 295 CodeStubInterfaceDescriptor* descriptor) { |
320 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0); | 296 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
321 } | 297 } |
322 | 298 |
323 | 299 |
324 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 300 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
325 Isolate* isolate, | |
326 CodeStubInterfaceDescriptor* descriptor) { | 301 CodeStubInterfaceDescriptor* descriptor) { |
327 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1); | 302 InitializeInternalArrayConstructorDescriptor(descriptor, 1); |
328 } | 303 } |
329 | 304 |
330 | 305 |
331 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 306 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
332 Isolate* isolate, | |
333 CodeStubInterfaceDescriptor* descriptor) { | 307 CodeStubInterfaceDescriptor* descriptor) { |
334 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1); | 308 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
335 } | 309 } |
336 | 310 |
337 | 311 |
338 void StoreGlobalStub::InitializeInterfaceDescriptor( | 312 void StoreGlobalStub::InitializeInterfaceDescriptor( |
339 Isolate* isolate, | |
340 CodeStubInterfaceDescriptor* descriptor) { | 313 CodeStubInterfaceDescriptor* descriptor) { |
341 static Register registers[] = { a1, a2, a0 }; | 314 static Register registers[] = { a1, a2, a0 }; |
342 descriptor->register_param_count_ = 3; | 315 descriptor->register_param_count_ = 3; |
343 descriptor->register_params_ = registers; | 316 descriptor->register_params_ = registers; |
344 descriptor->deoptimization_handler_ = | 317 descriptor->deoptimization_handler_ = |
345 FUNCTION_ADDR(StoreIC_MissFromStubFailure); | 318 FUNCTION_ADDR(StoreIC_MissFromStubFailure); |
346 } | 319 } |
347 | 320 |
348 | 321 |
349 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 322 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
350 Isolate* isolate, | |
351 CodeStubInterfaceDescriptor* descriptor) { | 323 CodeStubInterfaceDescriptor* descriptor) { |
352 static Register registers[] = { a0, a3, a1, a2 }; | 324 static Register registers[] = { a0, a3, a1, a2 }; |
353 descriptor->register_param_count_ = 4; | 325 descriptor->register_param_count_ = 4; |
354 descriptor->register_params_ = registers; | 326 descriptor->register_params_ = registers; |
355 descriptor->deoptimization_handler_ = | 327 descriptor->deoptimization_handler_ = |
356 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); | 328 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); |
357 } | 329 } |
358 | 330 |
359 | 331 |
360 void BinaryOpICStub::InitializeInterfaceDescriptor( | 332 void BinaryOpICStub::InitializeInterfaceDescriptor( |
361 Isolate* isolate, | |
362 CodeStubInterfaceDescriptor* descriptor) { | 333 CodeStubInterfaceDescriptor* descriptor) { |
363 static Register registers[] = { a1, a0 }; | 334 static Register registers[] = { a1, a0 }; |
364 descriptor->register_param_count_ = 2; | 335 descriptor->register_param_count_ = 2; |
365 descriptor->register_params_ = registers; | 336 descriptor->register_params_ = registers; |
366 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | 337 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
367 descriptor->SetMissHandler( | 338 descriptor->SetMissHandler( |
368 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); | 339 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
369 } | 340 } |
370 | 341 |
371 | 342 |
372 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 343 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
373 Isolate* isolate, | |
374 CodeStubInterfaceDescriptor* descriptor) { | 344 CodeStubInterfaceDescriptor* descriptor) { |
375 static Register registers[] = { a2, a1, a0 }; | 345 static Register registers[] = { a2, a1, a0 }; |
376 descriptor->register_param_count_ = 3; | 346 descriptor->register_param_count_ = 3; |
377 descriptor->register_params_ = registers; | 347 descriptor->register_params_ = registers; |
378 descriptor->deoptimization_handler_ = | 348 descriptor->deoptimization_handler_ = |
379 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); | 349 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); |
380 } | 350 } |
381 | 351 |
382 | 352 |
383 void StringAddStub::InitializeInterfaceDescriptor( | 353 void StringAddStub::InitializeInterfaceDescriptor( |
384 Isolate* isolate, | |
385 CodeStubInterfaceDescriptor* descriptor) { | 354 CodeStubInterfaceDescriptor* descriptor) { |
386 static Register registers[] = { a1, a0 }; | 355 static Register registers[] = { a1, a0 }; |
387 descriptor->register_param_count_ = 2; | 356 descriptor->register_param_count_ = 2; |
388 descriptor->register_params_ = registers; | 357 descriptor->register_params_ = registers; |
389 descriptor->deoptimization_handler_ = | 358 descriptor->deoptimization_handler_ = |
390 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | 359 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; |
391 } | 360 } |
392 | 361 |
393 | 362 |
394 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 363 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 bool strict); | 458 bool strict); |
490 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, | 459 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, |
491 Register lhs, | 460 Register lhs, |
492 Register rhs); | 461 Register rhs); |
493 | 462 |
494 | 463 |
495 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 464 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
496 // Update the static counter each time a new code stub is generated. | 465 // Update the static counter each time a new code stub is generated. |
497 isolate()->counters()->code_stubs()->Increment(); | 466 isolate()->counters()->code_stubs()->Increment(); |
498 | 467 |
499 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate()); | 468 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
500 int param_count = descriptor->register_param_count_; | 469 int param_count = descriptor->register_param_count_; |
501 { | 470 { |
502 // Call the runtime system in a fresh internal frame. | 471 // Call the runtime system in a fresh internal frame. |
503 FrameScope scope(masm, StackFrame::INTERNAL); | 472 FrameScope scope(masm, StackFrame::INTERNAL); |
504 ASSERT(descriptor->register_param_count_ == 0 || | 473 ASSERT(descriptor->register_param_count_ == 0 || |
505 a0.is(descriptor->register_params_[param_count - 1])); | 474 a0.is(descriptor->register_params_[param_count - 1])); |
506 // Push arguments, adjust sp. | 475 // Push arguments, adjust sp. |
507 __ Subu(sp, sp, Operand(param_count * kPointerSize)); | 476 __ Subu(sp, sp, Operand(param_count * kPointerSize)); |
508 for (int i = 0; i < param_count; ++i) { | 477 for (int i = 0; i < param_count; ++i) { |
509 // Store argument to stack. | 478 // Store argument to stack. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 726 |
758 __ Pop(scratch, scratch2, scratch3); | 727 __ Pop(scratch, scratch2, scratch3); |
759 __ Ret(); | 728 __ Ret(); |
760 } | 729 } |
761 | 730 |
762 | 731 |
763 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( | 732 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( |
764 Isolate* isolate) { | 733 Isolate* isolate) { |
765 WriteInt32ToHeapNumberStub stub1(isolate, a1, v0, a2, a3); | 734 WriteInt32ToHeapNumberStub stub1(isolate, a1, v0, a2, a3); |
766 WriteInt32ToHeapNumberStub stub2(isolate, a2, v0, a3, a0); | 735 WriteInt32ToHeapNumberStub stub2(isolate, a2, v0, a3, a0); |
767 stub1.GetCode(isolate); | 736 stub1.GetCode(); |
768 stub2.GetCode(isolate); | 737 stub2.GetCode(); |
769 } | 738 } |
770 | 739 |
771 | 740 |
772 // See comment for class, this does NOT work for int32's that are in Smi range. | 741 // See comment for class, this does NOT work for int32's that are in Smi range. |
773 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { | 742 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { |
774 Label max_negative_int; | 743 Label max_negative_int; |
775 // the_int_ has the answer which is a signed int32 but not a Smi. | 744 // the_int_ has the answer which is a signed int32 but not a Smi. |
776 // We test for the special value that has a different exponent. | 745 // We test for the special value that has a different exponent. |
777 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); | 746 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); |
778 // Test sign, and save for later conditionals. | 747 // Test sign, and save for later conditionals. |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 BinaryOpICStub::GenerateAheadOfTime(isolate); | 1530 BinaryOpICStub::GenerateAheadOfTime(isolate); |
1562 StoreRegistersStateStub::GenerateAheadOfTime(isolate); | 1531 StoreRegistersStateStub::GenerateAheadOfTime(isolate); |
1563 RestoreRegistersStateStub::GenerateAheadOfTime(isolate); | 1532 RestoreRegistersStateStub::GenerateAheadOfTime(isolate); |
1564 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); | 1533 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); |
1565 } | 1534 } |
1566 | 1535 |
1567 | 1536 |
1568 void StoreRegistersStateStub::GenerateAheadOfTime( | 1537 void StoreRegistersStateStub::GenerateAheadOfTime( |
1569 Isolate* isolate) { | 1538 Isolate* isolate) { |
1570 StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); | 1539 StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); |
1571 stub1.GetCode(isolate); | 1540 stub1.GetCode(); |
1572 // Hydrogen code stubs need stub2 at snapshot time. | 1541 // Hydrogen code stubs need stub2 at snapshot time. |
1573 StoreRegistersStateStub stub2(isolate, kSaveFPRegs); | 1542 StoreRegistersStateStub stub2(isolate, kSaveFPRegs); |
1574 stub2.GetCode(isolate); | 1543 stub2.GetCode(); |
1575 } | 1544 } |
1576 | 1545 |
1577 | 1546 |
1578 void RestoreRegistersStateStub::GenerateAheadOfTime( | 1547 void RestoreRegistersStateStub::GenerateAheadOfTime( |
1579 Isolate* isolate) { | 1548 Isolate* isolate) { |
1580 RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); | 1549 RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); |
1581 stub1.GetCode(isolate); | 1550 stub1.GetCode(); |
1582 // Hydrogen code stubs need stub2 at snapshot time. | 1551 // Hydrogen code stubs need stub2 at snapshot time. |
1583 RestoreRegistersStateStub stub2(isolate, kSaveFPRegs); | 1552 RestoreRegistersStateStub stub2(isolate, kSaveFPRegs); |
1584 stub2.GetCode(isolate); | 1553 stub2.GetCode(); |
1585 } | 1554 } |
1586 | 1555 |
1587 | 1556 |
1588 void CodeStub::GenerateFPStubs(Isolate* isolate) { | 1557 void CodeStub::GenerateFPStubs(Isolate* isolate) { |
1589 SaveFPRegsMode mode = kSaveFPRegs; | 1558 SaveFPRegsMode mode = kSaveFPRegs; |
1590 CEntryStub save_doubles(isolate, 1, mode); | 1559 CEntryStub save_doubles(isolate, 1, mode); |
1591 StoreBufferOverflowStub stub(isolate, mode); | 1560 StoreBufferOverflowStub stub(isolate, mode); |
1592 // These stubs might already be in the snapshot, detect that and don't | 1561 // These stubs might already be in the snapshot, detect that and don't |
1593 // regenerate, which would lead to code stub initialization state being messed | 1562 // regenerate, which would lead to code stub initialization state being messed |
1594 // up. | 1563 // up. |
1595 Code* save_doubles_code; | 1564 Code* save_doubles_code; |
1596 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) { | 1565 if (!save_doubles.FindCodeInCache(&save_doubles_code)) { |
1597 save_doubles_code = *save_doubles.GetCode(isolate); | 1566 save_doubles_code = *save_doubles.GetCode(); |
1598 } | 1567 } |
1599 Code* store_buffer_overflow_code; | 1568 Code* store_buffer_overflow_code; |
1600 if (!stub.FindCodeInCache(&store_buffer_overflow_code, isolate)) { | 1569 if (!stub.FindCodeInCache(&store_buffer_overflow_code)) { |
1601 store_buffer_overflow_code = *stub.GetCode(isolate); | 1570 store_buffer_overflow_code = *stub.GetCode(); |
1602 } | 1571 } |
1603 isolate->set_fp_stubs_generated(true); | 1572 isolate->set_fp_stubs_generated(true); |
1604 } | 1573 } |
1605 | 1574 |
1606 | 1575 |
1607 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { | 1576 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { |
1608 CEntryStub stub(isolate, 1, kDontSaveFPRegs); | 1577 CEntryStub stub(isolate, 1, kDontSaveFPRegs); |
1609 stub.GetCode(isolate); | 1578 stub.GetCode(); |
1610 } | 1579 } |
1611 | 1580 |
1612 | 1581 |
1613 void CEntryStub::Generate(MacroAssembler* masm) { | 1582 void CEntryStub::Generate(MacroAssembler* masm) { |
1614 // Called from JavaScript; parameters are on stack as if calling JS function | 1583 // Called from JavaScript; parameters are on stack as if calling JS function |
1615 // s0: number of arguments including receiver | 1584 // s0: number of arguments including receiver |
1616 // s1: size of arguments excluding receiver | 1585 // s1: size of arguments excluding receiver |
1617 // s2: pointer to builtin function | 1586 // s2: pointer to builtin function |
1618 // fp: frame pointer (restored after C call) | 1587 // fp: frame pointer (restored after C call) |
1619 // sp: stack pointer (restored as callee's sp after C call) | 1588 // sp: stack pointer (restored as callee's sp after C call) |
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4055 __ li(v0, Operand(EQUAL)); | 4024 __ li(v0, Operand(EQUAL)); |
4056 | 4025 |
4057 __ bind(&fpu_lt); | 4026 __ bind(&fpu_lt); |
4058 __ Ret(USE_DELAY_SLOT); | 4027 __ Ret(USE_DELAY_SLOT); |
4059 __ li(v0, Operand(LESS)); | 4028 __ li(v0, Operand(LESS)); |
4060 | 4029 |
4061 __ bind(&unordered); | 4030 __ bind(&unordered); |
4062 __ bind(&generic_stub); | 4031 __ bind(&generic_stub); |
4063 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, | 4032 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, |
4064 CompareIC::GENERIC); | 4033 CompareIC::GENERIC); |
4065 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); | 4034 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
4066 | 4035 |
4067 __ bind(&maybe_undefined1); | 4036 __ bind(&maybe_undefined1); |
4068 if (Token::IsOrderedRelationalCompareOp(op_)) { | 4037 if (Token::IsOrderedRelationalCompareOp(op_)) { |
4069 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 4038 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
4070 __ Branch(&miss, ne, a0, Operand(at)); | 4039 __ Branch(&miss, ne, a0, Operand(at)); |
4071 __ JumpIfSmi(a1, &unordered); | 4040 __ JumpIfSmi(a1, &unordered); |
4072 __ GetObjectType(a1, a2, a2); | 4041 __ GetObjectType(a1, a2, a2); |
4073 __ Branch(&maybe_undefined2, ne, a2, Operand(HEAP_NUMBER_TYPE)); | 4042 __ Branch(&maybe_undefined2, ne, a2, Operand(HEAP_NUMBER_TYPE)); |
4074 __ jmp(&unordered); | 4043 __ jmp(&unordered); |
4075 } | 4044 } |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4334 __ Assert(ne, kReceivedInvalidReturnAddress, t0, | 4303 __ Assert(ne, kReceivedInvalidReturnAddress, t0, |
4335 Operand(reinterpret_cast<uint32_t>(kZapValue))); | 4304 Operand(reinterpret_cast<uint32_t>(kZapValue))); |
4336 } | 4305 } |
4337 __ Jump(t9); | 4306 __ Jump(t9); |
4338 } | 4307 } |
4339 | 4308 |
4340 | 4309 |
4341 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, | 4310 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, |
4342 Register target) { | 4311 Register target) { |
4343 intptr_t loc = | 4312 intptr_t loc = |
4344 reinterpret_cast<intptr_t>(GetCode(isolate()).location()); | 4313 reinterpret_cast<intptr_t>(GetCode().location()); |
4345 __ Move(t9, target); | 4314 __ Move(t9, target); |
4346 __ li(ra, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE); | 4315 __ li(ra, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE); |
4347 __ Call(ra); | 4316 __ Call(ra); |
4348 } | 4317 } |
4349 | 4318 |
4350 | 4319 |
4351 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 4320 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
4352 Label* miss, | 4321 Label* miss, |
4353 Label* done, | 4322 Label* done, |
4354 Register receiver, | 4323 Register receiver, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4597 | 4566 |
4598 __ bind(¬_in_dictionary); | 4567 __ bind(¬_in_dictionary); |
4599 __ Ret(USE_DELAY_SLOT); | 4568 __ Ret(USE_DELAY_SLOT); |
4600 __ mov(result, zero_reg); | 4569 __ mov(result, zero_reg); |
4601 } | 4570 } |
4602 | 4571 |
4603 | 4572 |
4604 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( | 4573 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( |
4605 Isolate* isolate) { | 4574 Isolate* isolate) { |
4606 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs); | 4575 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs); |
4607 stub1.GetCode(isolate); | 4576 stub1.GetCode(); |
4608 // Hydrogen code stubs need stub2 at snapshot time. | 4577 // Hydrogen code stubs need stub2 at snapshot time. |
4609 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs); | 4578 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs); |
4610 stub2.GetCode(isolate); | 4579 stub2.GetCode(); |
4611 } | 4580 } |
4612 | 4581 |
4613 | 4582 |
4614 bool CodeStub::CanUseFPRegisters() { | 4583 bool CodeStub::CanUseFPRegisters() { |
4615 return true; // FPU is a base requirement for V8. | 4584 return true; // FPU is a base requirement for V8. |
4616 } | 4585 } |
4617 | 4586 |
4618 | 4587 |
4619 // Takes the input in 3 registers: address_ value_ and object_. A pointer to | 4588 // Takes the input in 3 registers: address_ value_ and object_. A pointer to |
4620 // the value has just been written into the object, now this stub makes sure | 4589 // the value has just been written into the object, now this stub makes sure |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4867 __ bind(&double_elements); | 4836 __ bind(&double_elements); |
4868 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); | 4837 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); |
4869 __ StoreNumberToDoubleElements(a0, a3, t1, t3, t5, a2, &slow_elements); | 4838 __ StoreNumberToDoubleElements(a0, a3, t1, t3, t5, a2, &slow_elements); |
4870 __ Ret(USE_DELAY_SLOT); | 4839 __ Ret(USE_DELAY_SLOT); |
4871 __ mov(v0, a0); | 4840 __ mov(v0, a0); |
4872 } | 4841 } |
4873 | 4842 |
4874 | 4843 |
4875 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 4844 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
4876 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | 4845 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); |
4877 __ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); | 4846 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); |
4878 int parameter_count_offset = | 4847 int parameter_count_offset = |
4879 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 4848 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; |
4880 __ lw(a1, MemOperand(fp, parameter_count_offset)); | 4849 __ lw(a1, MemOperand(fp, parameter_count_offset)); |
4881 if (function_mode_ == JS_FUNCTION_STUB_MODE) { | 4850 if (function_mode_ == JS_FUNCTION_STUB_MODE) { |
4882 __ Addu(a1, a1, Operand(1)); | 4851 __ Addu(a1, a1, Operand(1)); |
4883 } | 4852 } |
4884 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 4853 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
4885 __ sll(a1, a1, kPointerSizeLog2); | 4854 __ sll(a1, a1, kPointerSizeLog2); |
4886 __ Ret(USE_DELAY_SLOT); | 4855 __ Ret(USE_DELAY_SLOT); |
4887 __ Addu(sp, sp, a1); | 4856 __ Addu(sp, sp, a1); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5060 } | 5029 } |
5061 | 5030 |
5062 | 5031 |
5063 template<class T> | 5032 template<class T> |
5064 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { | 5033 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { |
5065 int to_index = GetSequenceIndexFromFastElementsKind( | 5034 int to_index = GetSequenceIndexFromFastElementsKind( |
5066 TERMINAL_FAST_ELEMENTS_KIND); | 5035 TERMINAL_FAST_ELEMENTS_KIND); |
5067 for (int i = 0; i <= to_index; ++i) { | 5036 for (int i = 0; i <= to_index; ++i) { |
5068 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5037 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
5069 T stub(isolate, kind); | 5038 T stub(isolate, kind); |
5070 stub.GetCode(isolate); | 5039 stub.GetCode(); |
5071 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { | 5040 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { |
5072 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); | 5041 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); |
5073 stub1.GetCode(isolate); | 5042 stub1.GetCode(); |
5074 } | 5043 } |
5075 } | 5044 } |
5076 } | 5045 } |
5077 | 5046 |
5078 | 5047 |
5079 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 5048 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
5080 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 5049 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
5081 isolate); | 5050 isolate); |
5082 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 5051 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
5083 isolate); | 5052 isolate); |
5084 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( | 5053 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
5085 isolate); | 5054 isolate); |
5086 } | 5055 } |
5087 | 5056 |
5088 | 5057 |
5089 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( | 5058 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( |
5090 Isolate* isolate) { | 5059 Isolate* isolate) { |
5091 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; | 5060 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; |
5092 for (int i = 0; i < 2; i++) { | 5061 for (int i = 0; i < 2; i++) { |
5093 // For internal arrays we only need a few things. | 5062 // For internal arrays we only need a few things. |
5094 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); | 5063 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); |
5095 stubh1.GetCode(isolate); | 5064 stubh1.GetCode(); |
5096 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); | 5065 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); |
5097 stubh2.GetCode(isolate); | 5066 stubh2.GetCode(); |
5098 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); | 5067 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); |
5099 stubh3.GetCode(isolate); | 5068 stubh3.GetCode(); |
5100 } | 5069 } |
5101 } | 5070 } |
5102 | 5071 |
5103 | 5072 |
5104 void ArrayConstructorStub::GenerateDispatchToArrayStub( | 5073 void ArrayConstructorStub::GenerateDispatchToArrayStub( |
5105 MacroAssembler* masm, | 5074 MacroAssembler* masm, |
5106 AllocationSiteOverrideMode mode) { | 5075 AllocationSiteOverrideMode mode) { |
5107 if (argument_count_ == ANY) { | 5076 if (argument_count_ == ANY) { |
5108 Label not_zero_case, not_one_case; | 5077 Label not_zero_case, not_one_case; |
5109 __ And(at, a0, a0); | 5078 __ And(at, a0, a0); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5384 MemOperand(fp, 6 * kPointerSize), | 5353 MemOperand(fp, 6 * kPointerSize), |
5385 NULL); | 5354 NULL); |
5386 } | 5355 } |
5387 | 5356 |
5388 | 5357 |
5389 #undef __ | 5358 #undef __ |
5390 | 5359 |
5391 } } // namespace v8::internal | 5360 } } // namespace v8::internal |
5392 | 5361 |
5393 #endif // V8_TARGET_ARCH_MIPS | 5362 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |