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 21 matching lines...) Expand all Loading... |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
34 #include "regexp-macro-assembler.h" | 34 #include "regexp-macro-assembler.h" |
35 #include "stub-cache.h" | 35 #include "stub-cache.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 | 40 |
41 void FastNewClosureStub::InitializeInterfaceDescriptor( | 41 void FastNewClosureStub::InitializeInterfaceDescriptor( |
42 Isolate* isolate, | |
43 CodeStubInterfaceDescriptor* descriptor) { | 42 CodeStubInterfaceDescriptor* descriptor) { |
44 static Register registers[] = { r2 }; | 43 static Register registers[] = { r2 }; |
45 descriptor->register_param_count_ = 1; | 44 descriptor->register_param_count_ = 1; |
46 descriptor->register_params_ = registers; | 45 descriptor->register_params_ = registers; |
47 descriptor->deoptimization_handler_ = | 46 descriptor->deoptimization_handler_ = |
48 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | 47 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; |
49 } | 48 } |
50 | 49 |
51 | 50 |
52 void FastNewContextStub::InitializeInterfaceDescriptor( | 51 void FastNewContextStub::InitializeInterfaceDescriptor( |
53 Isolate* isolate, | |
54 CodeStubInterfaceDescriptor* descriptor) { | 52 CodeStubInterfaceDescriptor* descriptor) { |
55 static Register registers[] = { r1 }; | 53 static Register registers[] = { r1 }; |
56 descriptor->register_param_count_ = 1; | 54 descriptor->register_param_count_ = 1; |
57 descriptor->register_params_ = registers; | 55 descriptor->register_params_ = registers; |
58 descriptor->deoptimization_handler_ = NULL; | 56 descriptor->deoptimization_handler_ = NULL; |
59 } | 57 } |
60 | 58 |
61 | 59 |
62 void ToNumberStub::InitializeInterfaceDescriptor( | 60 void ToNumberStub::InitializeInterfaceDescriptor( |
63 Isolate* isolate, | |
64 CodeStubInterfaceDescriptor* descriptor) { | 61 CodeStubInterfaceDescriptor* descriptor) { |
65 static Register registers[] = { r0 }; | 62 static Register registers[] = { r0 }; |
66 descriptor->register_param_count_ = 1; | 63 descriptor->register_param_count_ = 1; |
67 descriptor->register_params_ = registers; | 64 descriptor->register_params_ = registers; |
68 descriptor->deoptimization_handler_ = NULL; | 65 descriptor->deoptimization_handler_ = NULL; |
69 } | 66 } |
70 | 67 |
71 | 68 |
72 void NumberToStringStub::InitializeInterfaceDescriptor( | 69 void NumberToStringStub::InitializeInterfaceDescriptor( |
73 Isolate* isolate, | |
74 CodeStubInterfaceDescriptor* descriptor) { | 70 CodeStubInterfaceDescriptor* descriptor) { |
75 static Register registers[] = { r0 }; | 71 static Register registers[] = { r0 }; |
76 descriptor->register_param_count_ = 1; | 72 descriptor->register_param_count_ = 1; |
77 descriptor->register_params_ = registers; | 73 descriptor->register_params_ = registers; |
78 descriptor->deoptimization_handler_ = | 74 descriptor->deoptimization_handler_ = |
79 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | 75 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
80 } | 76 } |
81 | 77 |
82 | 78 |
83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 79 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
84 Isolate* isolate, | |
85 CodeStubInterfaceDescriptor* descriptor) { | 80 CodeStubInterfaceDescriptor* descriptor) { |
86 static Register registers[] = { r3, r2, r1 }; | 81 static Register registers[] = { r3, r2, r1 }; |
87 descriptor->register_param_count_ = 3; | 82 descriptor->register_param_count_ = 3; |
88 descriptor->register_params_ = registers; | 83 descriptor->register_params_ = registers; |
89 descriptor->deoptimization_handler_ = | 84 descriptor->deoptimization_handler_ = |
90 Runtime::FunctionForId( | 85 Runtime::FunctionForId( |
91 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 86 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
92 } | 87 } |
93 | 88 |
94 | 89 |
95 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 90 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
96 Isolate* isolate, | |
97 CodeStubInterfaceDescriptor* descriptor) { | 91 CodeStubInterfaceDescriptor* descriptor) { |
98 static Register registers[] = { r3, r2, r1, r0 }; | 92 static Register registers[] = { r3, r2, r1, r0 }; |
99 descriptor->register_param_count_ = 4; | 93 descriptor->register_param_count_ = 4; |
100 descriptor->register_params_ = registers; | 94 descriptor->register_params_ = registers; |
101 descriptor->deoptimization_handler_ = | 95 descriptor->deoptimization_handler_ = |
102 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | 96 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; |
103 } | 97 } |
104 | 98 |
105 | 99 |
106 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 100 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
107 Isolate* isolate, | |
108 CodeStubInterfaceDescriptor* descriptor) { | 101 CodeStubInterfaceDescriptor* descriptor) { |
109 static Register registers[] = { r2, r3 }; | 102 static Register registers[] = { r2, r3 }; |
110 descriptor->register_param_count_ = 2; | 103 descriptor->register_param_count_ = 2; |
111 descriptor->register_params_ = registers; | 104 descriptor->register_params_ = registers; |
112 descriptor->deoptimization_handler_ = NULL; | 105 descriptor->deoptimization_handler_ = NULL; |
113 } | 106 } |
114 | 107 |
115 | 108 |
116 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | 109 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( |
117 Isolate* isolate, | |
118 CodeStubInterfaceDescriptor* descriptor) { | 110 CodeStubInterfaceDescriptor* descriptor) { |
119 static Register registers[] = { r1, r0 }; | 111 static Register registers[] = { r1, r0 }; |
120 descriptor->register_param_count_ = 2; | 112 descriptor->register_param_count_ = 2; |
121 descriptor->register_params_ = registers; | 113 descriptor->register_params_ = registers; |
122 descriptor->deoptimization_handler_ = | 114 descriptor->deoptimization_handler_ = |
123 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | 115 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
124 } | 116 } |
125 | 117 |
126 | 118 |
127 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( | 119 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( |
128 Isolate* isolate, | |
129 CodeStubInterfaceDescriptor* descriptor) { | 120 CodeStubInterfaceDescriptor* descriptor) { |
130 static Register registers[] = { r1, r0 }; | 121 static Register registers[] = { r1, r0 }; |
131 descriptor->register_param_count_ = 2; | 122 descriptor->register_param_count_ = 2; |
132 descriptor->register_params_ = registers; | 123 descriptor->register_params_ = registers; |
133 descriptor->deoptimization_handler_ = | 124 descriptor->deoptimization_handler_ = |
134 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | 125 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); |
135 } | 126 } |
136 | 127 |
137 | 128 |
138 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 129 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
139 Isolate* isolate, | |
140 CodeStubInterfaceDescriptor* descriptor) { | 130 CodeStubInterfaceDescriptor* descriptor) { |
141 static Register registers[] = { r2, r1, r0 }; | 131 static Register registers[] = { r2, r1, r0 }; |
142 descriptor->register_param_count_ = 3; | 132 descriptor->register_param_count_ = 3; |
143 descriptor->register_params_ = registers; | 133 descriptor->register_params_ = registers; |
144 descriptor->deoptimization_handler_ = | 134 descriptor->deoptimization_handler_ = |
145 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | 135 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; |
146 } | 136 } |
147 | 137 |
148 | 138 |
149 void LoadFieldStub::InitializeInterfaceDescriptor( | 139 void LoadFieldStub::InitializeInterfaceDescriptor( |
150 Isolate* isolate, | |
151 CodeStubInterfaceDescriptor* descriptor) { | 140 CodeStubInterfaceDescriptor* descriptor) { |
152 static Register registers[] = { r0 }; | 141 static Register registers[] = { r0 }; |
153 descriptor->register_param_count_ = 1; | 142 descriptor->register_param_count_ = 1; |
154 descriptor->register_params_ = registers; | 143 descriptor->register_params_ = registers; |
155 descriptor->deoptimization_handler_ = NULL; | 144 descriptor->deoptimization_handler_ = NULL; |
156 } | 145 } |
157 | 146 |
158 | 147 |
159 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 148 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
160 Isolate* isolate, | |
161 CodeStubInterfaceDescriptor* descriptor) { | 149 CodeStubInterfaceDescriptor* descriptor) { |
162 static Register registers[] = { r1 }; | 150 static Register registers[] = { r1 }; |
163 descriptor->register_param_count_ = 1; | 151 descriptor->register_param_count_ = 1; |
164 descriptor->register_params_ = registers; | 152 descriptor->register_params_ = registers; |
165 descriptor->deoptimization_handler_ = NULL; | 153 descriptor->deoptimization_handler_ = NULL; |
166 } | 154 } |
167 | 155 |
168 | 156 |
169 void StringLengthStub::InitializeInterfaceDescriptor( | 157 void StringLengthStub::InitializeInterfaceDescriptor( |
170 Isolate* isolate, | |
171 CodeStubInterfaceDescriptor* descriptor) { | 158 CodeStubInterfaceDescriptor* descriptor) { |
172 static Register registers[] = { r0, r2 }; | 159 static Register registers[] = { r0, r2 }; |
173 descriptor->register_param_count_ = 2; | 160 descriptor->register_param_count_ = 2; |
174 descriptor->register_params_ = registers; | 161 descriptor->register_params_ = registers; |
175 descriptor->deoptimization_handler_ = NULL; | 162 descriptor->deoptimization_handler_ = NULL; |
176 } | 163 } |
177 | 164 |
178 | 165 |
179 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 166 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
180 Isolate* isolate, | |
181 CodeStubInterfaceDescriptor* descriptor) { | 167 CodeStubInterfaceDescriptor* descriptor) { |
182 static Register registers[] = { r1, r0 }; | 168 static Register registers[] = { r1, r0 }; |
183 descriptor->register_param_count_ = 2; | 169 descriptor->register_param_count_ = 2; |
184 descriptor->register_params_ = registers; | 170 descriptor->register_params_ = registers; |
185 descriptor->deoptimization_handler_ = NULL; | 171 descriptor->deoptimization_handler_ = NULL; |
186 } | 172 } |
187 | 173 |
188 | 174 |
189 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 175 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
190 Isolate* isolate, | |
191 CodeStubInterfaceDescriptor* descriptor) { | 176 CodeStubInterfaceDescriptor* descriptor) { |
192 static Register registers[] = { r2, r1, r0 }; | 177 static Register registers[] = { r2, r1, r0 }; |
193 descriptor->register_param_count_ = 3; | 178 descriptor->register_param_count_ = 3; |
194 descriptor->register_params_ = registers; | 179 descriptor->register_params_ = registers; |
195 descriptor->deoptimization_handler_ = | 180 descriptor->deoptimization_handler_ = |
196 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | 181 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); |
197 } | 182 } |
198 | 183 |
199 | 184 |
200 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 185 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
201 Isolate* isolate, | |
202 CodeStubInterfaceDescriptor* descriptor) { | 186 CodeStubInterfaceDescriptor* descriptor) { |
203 static Register registers[] = { r0, r1 }; | 187 static Register registers[] = { r0, r1 }; |
204 descriptor->register_param_count_ = 2; | 188 descriptor->register_param_count_ = 2; |
205 descriptor->register_params_ = registers; | 189 descriptor->register_params_ = registers; |
206 Address entry = | 190 Address entry = |
207 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 191 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
208 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); | 192 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); |
209 } | 193 } |
210 | 194 |
211 | 195 |
212 void CompareNilICStub::InitializeInterfaceDescriptor( | 196 void CompareNilICStub::InitializeInterfaceDescriptor( |
213 Isolate* isolate, | |
214 CodeStubInterfaceDescriptor* descriptor) { | 197 CodeStubInterfaceDescriptor* descriptor) { |
215 static Register registers[] = { r0 }; | 198 static Register registers[] = { r0 }; |
216 descriptor->register_param_count_ = 1; | 199 descriptor->register_param_count_ = 1; |
217 descriptor->register_params_ = registers; | 200 descriptor->register_params_ = registers; |
218 descriptor->deoptimization_handler_ = | 201 descriptor->deoptimization_handler_ = |
219 FUNCTION_ADDR(CompareNilIC_Miss); | 202 FUNCTION_ADDR(CompareNilIC_Miss); |
220 descriptor->SetMissHandler( | 203 descriptor->SetMissHandler( |
221 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate)); | 204 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
222 } | 205 } |
223 | 206 |
224 | 207 |
225 static void InitializeArrayConstructorDescriptor( | 208 static void InitializeArrayConstructorDescriptor( |
226 Isolate* isolate, | |
227 CodeStubInterfaceDescriptor* descriptor, | 209 CodeStubInterfaceDescriptor* descriptor, |
228 int constant_stack_parameter_count) { | 210 int constant_stack_parameter_count) { |
229 // register state | 211 // register state |
230 // r0 -- number of arguments | 212 // r0 -- number of arguments |
231 // r1 -- function | 213 // r1 -- function |
232 // r2 -- allocation site with elements kind | 214 // r2 -- allocation site with elements kind |
233 static Register registers_variable_args[] = { r1, r2, r0 }; | 215 static Register registers_variable_args[] = { r1, r2, r0 }; |
234 static Register registers_no_args[] = { r1, r2 }; | 216 static Register registers_no_args[] = { r1, r2 }; |
235 | 217 |
236 if (constant_stack_parameter_count == 0) { | 218 if (constant_stack_parameter_count == 0) { |
237 descriptor->register_param_count_ = 2; | 219 descriptor->register_param_count_ = 2; |
238 descriptor->register_params_ = registers_no_args; | 220 descriptor->register_params_ = registers_no_args; |
239 } else { | 221 } else { |
240 // stack param count needs (constructor pointer, and single argument) | 222 // stack param count needs (constructor pointer, and single argument) |
241 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 223 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
242 descriptor->stack_parameter_count_ = r0; | 224 descriptor->stack_parameter_count_ = r0; |
243 descriptor->register_param_count_ = 3; | 225 descriptor->register_param_count_ = 3; |
244 descriptor->register_params_ = registers_variable_args; | 226 descriptor->register_params_ = registers_variable_args; |
245 } | 227 } |
246 | 228 |
247 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 229 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
248 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 230 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
249 descriptor->deoptimization_handler_ = | 231 descriptor->deoptimization_handler_ = |
250 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | 232 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
251 } | 233 } |
252 | 234 |
253 | 235 |
254 static void InitializeInternalArrayConstructorDescriptor( | 236 static void InitializeInternalArrayConstructorDescriptor( |
255 Isolate* isolate, | |
256 CodeStubInterfaceDescriptor* descriptor, | 237 CodeStubInterfaceDescriptor* descriptor, |
257 int constant_stack_parameter_count) { | 238 int constant_stack_parameter_count) { |
258 // register state | 239 // register state |
259 // r0 -- number of arguments | 240 // r0 -- number of arguments |
260 // r1 -- constructor function | 241 // r1 -- constructor function |
261 static Register registers_variable_args[] = { r1, r0 }; | 242 static Register registers_variable_args[] = { r1, r0 }; |
262 static Register registers_no_args[] = { r1 }; | 243 static Register registers_no_args[] = { r1 }; |
263 | 244 |
264 if (constant_stack_parameter_count == 0) { | 245 if (constant_stack_parameter_count == 0) { |
265 descriptor->register_param_count_ = 1; | 246 descriptor->register_param_count_ = 1; |
266 descriptor->register_params_ = registers_no_args; | 247 descriptor->register_params_ = registers_no_args; |
267 } else { | 248 } else { |
268 // stack param count needs (constructor pointer, and single argument) | 249 // stack param count needs (constructor pointer, and single argument) |
269 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 250 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
270 descriptor->stack_parameter_count_ = r0; | 251 descriptor->stack_parameter_count_ = r0; |
271 descriptor->register_param_count_ = 2; | 252 descriptor->register_param_count_ = 2; |
272 descriptor->register_params_ = registers_variable_args; | 253 descriptor->register_params_ = registers_variable_args; |
273 } | 254 } |
274 | 255 |
275 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 256 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
276 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 257 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
277 descriptor->deoptimization_handler_ = | 258 descriptor->deoptimization_handler_ = |
278 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | 259 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
279 } | 260 } |
280 | 261 |
281 | 262 |
282 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 263 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
283 Isolate* isolate, | |
284 CodeStubInterfaceDescriptor* descriptor) { | 264 CodeStubInterfaceDescriptor* descriptor) { |
285 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 265 InitializeArrayConstructorDescriptor(descriptor, 0); |
286 } | 266 } |
287 | 267 |
288 | 268 |
289 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 269 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
290 Isolate* isolate, | |
291 CodeStubInterfaceDescriptor* descriptor) { | 270 CodeStubInterfaceDescriptor* descriptor) { |
292 InitializeArrayConstructorDescriptor(isolate, descriptor, 1); | 271 InitializeArrayConstructorDescriptor(descriptor, 1); |
293 } | 272 } |
294 | 273 |
295 | 274 |
296 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 275 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
297 Isolate* isolate, | |
298 CodeStubInterfaceDescriptor* descriptor) { | 276 CodeStubInterfaceDescriptor* descriptor) { |
299 InitializeArrayConstructorDescriptor(isolate, descriptor, -1); | 277 InitializeArrayConstructorDescriptor(descriptor, -1); |
300 } | 278 } |
301 | 279 |
302 | 280 |
303 void ToBooleanStub::InitializeInterfaceDescriptor( | 281 void ToBooleanStub::InitializeInterfaceDescriptor( |
304 Isolate* isolate, | |
305 CodeStubInterfaceDescriptor* descriptor) { | 282 CodeStubInterfaceDescriptor* descriptor) { |
306 static Register registers[] = { r0 }; | 283 static Register registers[] = { r0 }; |
307 descriptor->register_param_count_ = 1; | 284 descriptor->register_param_count_ = 1; |
308 descriptor->register_params_ = registers; | 285 descriptor->register_params_ = registers; |
309 descriptor->deoptimization_handler_ = | 286 descriptor->deoptimization_handler_ = |
310 FUNCTION_ADDR(ToBooleanIC_Miss); | 287 FUNCTION_ADDR(ToBooleanIC_Miss); |
311 descriptor->SetMissHandler( | 288 descriptor->SetMissHandler( |
312 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate)); | 289 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
313 } | 290 } |
314 | 291 |
315 | 292 |
316 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 293 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
317 Isolate* isolate, | |
318 CodeStubInterfaceDescriptor* descriptor) { | 294 CodeStubInterfaceDescriptor* descriptor) { |
319 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0); | 295 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
320 } | 296 } |
321 | 297 |
322 | 298 |
323 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 299 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
324 Isolate* isolate, | |
325 CodeStubInterfaceDescriptor* descriptor) { | 300 CodeStubInterfaceDescriptor* descriptor) { |
326 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1); | 301 InitializeInternalArrayConstructorDescriptor(descriptor, 1); |
327 } | 302 } |
328 | 303 |
329 | 304 |
330 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 305 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
331 Isolate* isolate, | |
332 CodeStubInterfaceDescriptor* descriptor) { | 306 CodeStubInterfaceDescriptor* descriptor) { |
333 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1); | 307 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
334 } | 308 } |
335 | 309 |
336 | 310 |
337 void StoreGlobalStub::InitializeInterfaceDescriptor( | 311 void StoreGlobalStub::InitializeInterfaceDescriptor( |
338 Isolate* isolate, | |
339 CodeStubInterfaceDescriptor* descriptor) { | 312 CodeStubInterfaceDescriptor* descriptor) { |
340 static Register registers[] = { r1, r2, r0 }; | 313 static Register registers[] = { r1, r2, r0 }; |
341 descriptor->register_param_count_ = 3; | 314 descriptor->register_param_count_ = 3; |
342 descriptor->register_params_ = registers; | 315 descriptor->register_params_ = registers; |
343 descriptor->deoptimization_handler_ = | 316 descriptor->deoptimization_handler_ = |
344 FUNCTION_ADDR(StoreIC_MissFromStubFailure); | 317 FUNCTION_ADDR(StoreIC_MissFromStubFailure); |
345 } | 318 } |
346 | 319 |
347 | 320 |
348 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 321 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
349 Isolate* isolate, | |
350 CodeStubInterfaceDescriptor* descriptor) { | 322 CodeStubInterfaceDescriptor* descriptor) { |
351 static Register registers[] = { r0, r3, r1, r2 }; | 323 static Register registers[] = { r0, r3, r1, r2 }; |
352 descriptor->register_param_count_ = 4; | 324 descriptor->register_param_count_ = 4; |
353 descriptor->register_params_ = registers; | 325 descriptor->register_params_ = registers; |
354 descriptor->deoptimization_handler_ = | 326 descriptor->deoptimization_handler_ = |
355 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); | 327 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); |
356 } | 328 } |
357 | 329 |
358 | 330 |
359 void BinaryOpICStub::InitializeInterfaceDescriptor( | 331 void BinaryOpICStub::InitializeInterfaceDescriptor( |
360 Isolate* isolate, | |
361 CodeStubInterfaceDescriptor* descriptor) { | 332 CodeStubInterfaceDescriptor* descriptor) { |
362 static Register registers[] = { r1, r0 }; | 333 static Register registers[] = { r1, r0 }; |
363 descriptor->register_param_count_ = 2; | 334 descriptor->register_param_count_ = 2; |
364 descriptor->register_params_ = registers; | 335 descriptor->register_params_ = registers; |
365 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | 336 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
366 descriptor->SetMissHandler( | 337 descriptor->SetMissHandler( |
367 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); | 338 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
368 } | 339 } |
369 | 340 |
370 | 341 |
371 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 342 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
372 Isolate* isolate, | |
373 CodeStubInterfaceDescriptor* descriptor) { | 343 CodeStubInterfaceDescriptor* descriptor) { |
374 static Register registers[] = { r2, r1, r0 }; | 344 static Register registers[] = { r2, r1, r0 }; |
375 descriptor->register_param_count_ = 3; | 345 descriptor->register_param_count_ = 3; |
376 descriptor->register_params_ = registers; | 346 descriptor->register_params_ = registers; |
377 descriptor->deoptimization_handler_ = | 347 descriptor->deoptimization_handler_ = |
378 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); | 348 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); |
379 } | 349 } |
380 | 350 |
381 | 351 |
382 void StringAddStub::InitializeInterfaceDescriptor( | 352 void StringAddStub::InitializeInterfaceDescriptor( |
383 Isolate* isolate, | |
384 CodeStubInterfaceDescriptor* descriptor) { | 353 CodeStubInterfaceDescriptor* descriptor) { |
385 static Register registers[] = { r1, r0 }; | 354 static Register registers[] = { r1, r0 }; |
386 descriptor->register_param_count_ = 2; | 355 descriptor->register_param_count_ = 2; |
387 descriptor->register_params_ = registers; | 356 descriptor->register_params_ = registers; |
388 descriptor->deoptimization_handler_ = | 357 descriptor->deoptimization_handler_ = |
389 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | 358 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; |
390 } | 359 } |
391 | 360 |
392 | 361 |
393 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 362 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 bool strict); | 468 bool strict); |
500 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, | 469 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, |
501 Register lhs, | 470 Register lhs, |
502 Register rhs); | 471 Register rhs); |
503 | 472 |
504 | 473 |
505 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 474 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
506 // Update the static counter each time a new code stub is generated. | 475 // Update the static counter each time a new code stub is generated. |
507 isolate()->counters()->code_stubs()->Increment(); | 476 isolate()->counters()->code_stubs()->Increment(); |
508 | 477 |
509 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate()); | 478 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
510 int param_count = descriptor->register_param_count_; | 479 int param_count = descriptor->register_param_count_; |
511 { | 480 { |
512 // Call the runtime system in a fresh internal frame. | 481 // Call the runtime system in a fresh internal frame. |
513 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 482 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
514 ASSERT(descriptor->register_param_count_ == 0 || | 483 ASSERT(descriptor->register_param_count_ == 0 || |
515 r0.is(descriptor->register_params_[param_count - 1])); | 484 r0.is(descriptor->register_params_[param_count - 1])); |
516 // Push arguments | 485 // Push arguments |
517 for (int i = 0; i < param_count; ++i) { | 486 for (int i = 0; i < param_count; ++i) { |
518 __ push(descriptor->register_params_[i]); | 487 __ push(descriptor->register_params_[i]); |
519 } | 488 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 | 691 |
723 __ Pop(scratch_high, scratch_low, scratch); | 692 __ Pop(scratch_high, scratch_low, scratch); |
724 __ Ret(); | 693 __ Ret(); |
725 } | 694 } |
726 | 695 |
727 | 696 |
728 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( | 697 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( |
729 Isolate* isolate) { | 698 Isolate* isolate) { |
730 WriteInt32ToHeapNumberStub stub1(isolate, r1, r0, r2); | 699 WriteInt32ToHeapNumberStub stub1(isolate, r1, r0, r2); |
731 WriteInt32ToHeapNumberStub stub2(isolate, r2, r0, r3); | 700 WriteInt32ToHeapNumberStub stub2(isolate, r2, r0, r3); |
732 stub1.GetCode(isolate); | 701 stub1.GetCode(); |
733 stub2.GetCode(isolate); | 702 stub2.GetCode(); |
734 } | 703 } |
735 | 704 |
736 | 705 |
737 // See comment for class. | 706 // See comment for class. |
738 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { | 707 void WriteInt32ToHeapNumberStub::Generate(MacroAssembler* masm) { |
739 Label max_negative_int; | 708 Label max_negative_int; |
740 // the_int_ has the answer which is a signed int32 but not a Smi. | 709 // the_int_ has the answer which is a signed int32 but not a Smi. |
741 // We test for the special value that has a different exponent. This test | 710 // We test for the special value that has a different exponent. This test |
742 // has the neat side effect of setting the flags according to the sign. | 711 // has the neat side effect of setting the flags according to the sign. |
743 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); | 712 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 | 1448 |
1480 | 1449 |
1481 void CodeStub::GenerateFPStubs(Isolate* isolate) { | 1450 void CodeStub::GenerateFPStubs(Isolate* isolate) { |
1482 SaveFPRegsMode mode = kSaveFPRegs; | 1451 SaveFPRegsMode mode = kSaveFPRegs; |
1483 CEntryStub save_doubles(isolate, 1, mode); | 1452 CEntryStub save_doubles(isolate, 1, mode); |
1484 StoreBufferOverflowStub stub(isolate, mode); | 1453 StoreBufferOverflowStub stub(isolate, mode); |
1485 // These stubs might already be in the snapshot, detect that and don't | 1454 // These stubs might already be in the snapshot, detect that and don't |
1486 // regenerate, which would lead to code stub initialization state being messed | 1455 // regenerate, which would lead to code stub initialization state being messed |
1487 // up. | 1456 // up. |
1488 Code* save_doubles_code; | 1457 Code* save_doubles_code; |
1489 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) { | 1458 if (!save_doubles.FindCodeInCache(&save_doubles_code)) { |
1490 save_doubles_code = *save_doubles.GetCode(isolate); | 1459 save_doubles_code = *save_doubles.GetCode(); |
1491 } | 1460 } |
1492 Code* store_buffer_overflow_code; | 1461 Code* store_buffer_overflow_code; |
1493 if (!stub.FindCodeInCache(&store_buffer_overflow_code, isolate)) { | 1462 if (!stub.FindCodeInCache(&store_buffer_overflow_code)) { |
1494 store_buffer_overflow_code = *stub.GetCode(isolate); | 1463 store_buffer_overflow_code = *stub.GetCode(); |
1495 } | 1464 } |
1496 isolate->set_fp_stubs_generated(true); | 1465 isolate->set_fp_stubs_generated(true); |
1497 } | 1466 } |
1498 | 1467 |
1499 | 1468 |
1500 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { | 1469 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { |
1501 CEntryStub stub(isolate, 1, kDontSaveFPRegs); | 1470 CEntryStub stub(isolate, 1, kDontSaveFPRegs); |
1502 stub.GetCode(isolate); | 1471 stub.GetCode(); |
1503 } | 1472 } |
1504 | 1473 |
1505 | 1474 |
1506 void CEntryStub::Generate(MacroAssembler* masm) { | 1475 void CEntryStub::Generate(MacroAssembler* masm) { |
1507 // Called from JavaScript; parameters are on stack as if calling JS function. | 1476 // Called from JavaScript; parameters are on stack as if calling JS function. |
1508 // r0: number of arguments including receiver | 1477 // r0: number of arguments including receiver |
1509 // r1: pointer to builtin function | 1478 // r1: pointer to builtin function |
1510 // fp: frame pointer (restored after C call) | 1479 // fp: frame pointer (restored after C call) |
1511 // sp: stack pointer (restored as callee's sp after C call) | 1480 // sp: stack pointer (restored as callee's sp after C call) |
1512 // cp: current context (C callee-saved) | 1481 // cp: current context (C callee-saved) |
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3874 // Return a result of -1, 0, or 1, based on status bits. | 3843 // Return a result of -1, 0, or 1, based on status bits. |
3875 __ mov(r0, Operand(EQUAL), LeaveCC, eq); | 3844 __ mov(r0, Operand(EQUAL), LeaveCC, eq); |
3876 __ mov(r0, Operand(LESS), LeaveCC, lt); | 3845 __ mov(r0, Operand(LESS), LeaveCC, lt); |
3877 __ mov(r0, Operand(GREATER), LeaveCC, gt); | 3846 __ mov(r0, Operand(GREATER), LeaveCC, gt); |
3878 __ Ret(); | 3847 __ Ret(); |
3879 | 3848 |
3880 __ bind(&unordered); | 3849 __ bind(&unordered); |
3881 __ bind(&generic_stub); | 3850 __ bind(&generic_stub); |
3882 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, | 3851 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, |
3883 CompareIC::GENERIC); | 3852 CompareIC::GENERIC); |
3884 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); | 3853 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
3885 | 3854 |
3886 __ bind(&maybe_undefined1); | 3855 __ bind(&maybe_undefined1); |
3887 if (Token::IsOrderedRelationalCompareOp(op_)) { | 3856 if (Token::IsOrderedRelationalCompareOp(op_)) { |
3888 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); | 3857 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); |
3889 __ b(ne, &miss); | 3858 __ b(ne, &miss); |
3890 __ JumpIfSmi(r1, &unordered); | 3859 __ JumpIfSmi(r1, &unordered); |
3891 __ CompareObjectType(r1, r2, r2, HEAP_NUMBER_TYPE); | 3860 __ CompareObjectType(r1, r2, r2, HEAP_NUMBER_TYPE); |
3892 __ b(ne, &maybe_undefined2); | 3861 __ b(ne, &maybe_undefined2); |
3893 __ jmp(&unordered); | 3862 __ jmp(&unordered); |
3894 } | 3863 } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4129 __ str(lr, MemOperand(sp, 0)); | 4098 __ str(lr, MemOperand(sp, 0)); |
4130 __ blx(ip); // Call the C++ function. | 4099 __ blx(ip); // Call the C++ function. |
4131 __ VFPEnsureFPSCRState(r2); | 4100 __ VFPEnsureFPSCRState(r2); |
4132 __ ldr(pc, MemOperand(sp, 0)); | 4101 __ ldr(pc, MemOperand(sp, 0)); |
4133 } | 4102 } |
4134 | 4103 |
4135 | 4104 |
4136 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, | 4105 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, |
4137 Register target) { | 4106 Register target) { |
4138 intptr_t code = | 4107 intptr_t code = |
4139 reinterpret_cast<intptr_t>(GetCode(isolate()).location()); | 4108 reinterpret_cast<intptr_t>(GetCode().location()); |
4140 __ Move(ip, target); | 4109 __ Move(ip, target); |
4141 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); | 4110 __ mov(lr, Operand(code, RelocInfo::CODE_TARGET)); |
4142 __ blx(lr); // Call the stub. | 4111 __ blx(lr); // Call the stub. |
4143 } | 4112 } |
4144 | 4113 |
4145 | 4114 |
4146 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 4115 void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
4147 Label* miss, | 4116 Label* miss, |
4148 Label* done, | 4117 Label* done, |
4149 Register receiver, | 4118 Register receiver, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4386 | 4355 |
4387 __ bind(¬_in_dictionary); | 4356 __ bind(¬_in_dictionary); |
4388 __ mov(result, Operand::Zero()); | 4357 __ mov(result, Operand::Zero()); |
4389 __ Ret(); | 4358 __ Ret(); |
4390 } | 4359 } |
4391 | 4360 |
4392 | 4361 |
4393 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( | 4362 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( |
4394 Isolate* isolate) { | 4363 Isolate* isolate) { |
4395 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs); | 4364 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs); |
4396 stub1.GetCode(isolate); | 4365 stub1.GetCode(); |
4397 // Hydrogen code stubs need stub2 at snapshot time. | 4366 // Hydrogen code stubs need stub2 at snapshot time. |
4398 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs); | 4367 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs); |
4399 stub2.GetCode(isolate); | 4368 stub2.GetCode(); |
4400 } | 4369 } |
4401 | 4370 |
4402 | 4371 |
4403 bool CodeStub::CanUseFPRegisters() { | 4372 bool CodeStub::CanUseFPRegisters() { |
4404 return true; // VFP2 is a base requirement for V8 | 4373 return true; // VFP2 is a base requirement for V8 |
4405 } | 4374 } |
4406 | 4375 |
4407 | 4376 |
4408 // Takes the input in 3 registers: address_ value_ and object_. A pointer to | 4377 // Takes the input in 3 registers: address_ value_ and object_. A pointer to |
4409 // the value has just been written into the object, now this stub makes sure | 4378 // the value has just been written into the object, now this stub makes sure |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4654 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | 4623 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
4655 __ bind(&double_elements); | 4624 __ bind(&double_elements); |
4656 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); | 4625 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
4657 __ StoreNumberToDoubleElements(r0, r3, r5, r6, d0, &slow_elements); | 4626 __ StoreNumberToDoubleElements(r0, r3, r5, r6, d0, &slow_elements); |
4658 __ Ret(); | 4627 __ Ret(); |
4659 } | 4628 } |
4660 | 4629 |
4661 | 4630 |
4662 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 4631 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
4663 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); | 4632 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); |
4664 __ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); | 4633 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); |
4665 int parameter_count_offset = | 4634 int parameter_count_offset = |
4666 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 4635 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; |
4667 __ ldr(r1, MemOperand(fp, parameter_count_offset)); | 4636 __ ldr(r1, MemOperand(fp, parameter_count_offset)); |
4668 if (function_mode_ == JS_FUNCTION_STUB_MODE) { | 4637 if (function_mode_ == JS_FUNCTION_STUB_MODE) { |
4669 __ add(r1, r1, Operand(1)); | 4638 __ add(r1, r1, Operand(1)); |
4670 } | 4639 } |
4671 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 4640 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
4672 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); | 4641 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); |
4673 __ add(sp, sp, r1); | 4642 __ add(sp, sp, r1); |
4674 __ Ret(); | 4643 __ Ret(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4851 } | 4820 } |
4852 | 4821 |
4853 | 4822 |
4854 template<class T> | 4823 template<class T> |
4855 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { | 4824 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { |
4856 int to_index = GetSequenceIndexFromFastElementsKind( | 4825 int to_index = GetSequenceIndexFromFastElementsKind( |
4857 TERMINAL_FAST_ELEMENTS_KIND); | 4826 TERMINAL_FAST_ELEMENTS_KIND); |
4858 for (int i = 0; i <= to_index; ++i) { | 4827 for (int i = 0; i <= to_index; ++i) { |
4859 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 4828 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
4860 T stub(isolate, kind); | 4829 T stub(isolate, kind); |
4861 stub.GetCode(isolate); | 4830 stub.GetCode(); |
4862 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { | 4831 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { |
4863 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); | 4832 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); |
4864 stub1.GetCode(isolate); | 4833 stub1.GetCode(); |
4865 } | 4834 } |
4866 } | 4835 } |
4867 } | 4836 } |
4868 | 4837 |
4869 | 4838 |
4870 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 4839 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
4871 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 4840 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
4872 isolate); | 4841 isolate); |
4873 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 4842 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
4874 isolate); | 4843 isolate); |
4875 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( | 4844 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
4876 isolate); | 4845 isolate); |
4877 } | 4846 } |
4878 | 4847 |
4879 | 4848 |
4880 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( | 4849 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( |
4881 Isolate* isolate) { | 4850 Isolate* isolate) { |
4882 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; | 4851 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; |
4883 for (int i = 0; i < 2; i++) { | 4852 for (int i = 0; i < 2; i++) { |
4884 // For internal arrays we only need a few things | 4853 // For internal arrays we only need a few things |
4885 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); | 4854 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); |
4886 stubh1.GetCode(isolate); | 4855 stubh1.GetCode(); |
4887 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); | 4856 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); |
4888 stubh2.GetCode(isolate); | 4857 stubh2.GetCode(); |
4889 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); | 4858 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); |
4890 stubh3.GetCode(isolate); | 4859 stubh3.GetCode(); |
4891 } | 4860 } |
4892 } | 4861 } |
4893 | 4862 |
4894 | 4863 |
4895 void ArrayConstructorStub::GenerateDispatchToArrayStub( | 4864 void ArrayConstructorStub::GenerateDispatchToArrayStub( |
4896 MacroAssembler* masm, | 4865 MacroAssembler* masm, |
4897 AllocationSiteOverrideMode mode) { | 4866 AllocationSiteOverrideMode mode) { |
4898 if (argument_count_ == ANY) { | 4867 if (argument_count_ == ANY) { |
4899 Label not_zero_case, not_one_case; | 4868 Label not_zero_case, not_one_case; |
4900 __ tst(r0, r0); | 4869 __ tst(r0, r0); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5186 MemOperand(fp, 6 * kPointerSize), | 5155 MemOperand(fp, 6 * kPointerSize), |
5187 NULL); | 5156 NULL); |
5188 } | 5157 } |
5189 | 5158 |
5190 | 5159 |
5191 #undef __ | 5160 #undef __ |
5192 | 5161 |
5193 } } // namespace v8::internal | 5162 } } // namespace v8::internal |
5194 | 5163 |
5195 #endif // V8_TARGET_ARCH_ARM | 5164 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |