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

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

Issue 255543003: CodeStubs contain their corresponding Isolate* now. (part 2) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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
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 // x2: function info 43 // x2: function info
45 static Register registers[] = { x2 }; 44 static Register registers[] = { x2 };
46 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 45 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
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 // x1: function 54 // x1: function
57 static Register registers[] = { x1 }; 55 static Register registers[] = { x1 };
58 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 56 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
59 descriptor->register_params_ = registers; 57 descriptor->register_params_ = registers;
60 descriptor->deoptimization_handler_ = NULL; 58 descriptor->deoptimization_handler_ = NULL;
61 } 59 }
62 60
63 61
64 void ToNumberStub::InitializeInterfaceDescriptor( 62 void ToNumberStub::InitializeInterfaceDescriptor(
65 Isolate* isolate,
66 CodeStubInterfaceDescriptor* descriptor) { 63 CodeStubInterfaceDescriptor* descriptor) {
67 // x0: value 64 // x0: value
68 static Register registers[] = { x0 }; 65 static Register registers[] = { x0 };
69 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 66 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
70 descriptor->register_params_ = registers; 67 descriptor->register_params_ = registers;
71 descriptor->deoptimization_handler_ = NULL; 68 descriptor->deoptimization_handler_ = NULL;
72 } 69 }
73 70
74 71
75 void NumberToStringStub::InitializeInterfaceDescriptor( 72 void NumberToStringStub::InitializeInterfaceDescriptor(
76 Isolate* isolate,
77 CodeStubInterfaceDescriptor* descriptor) { 73 CodeStubInterfaceDescriptor* descriptor) {
78 // x0: value 74 // x0: value
79 static Register registers[] = { x0 }; 75 static Register registers[] = { x0 };
80 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 76 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
81 descriptor->register_params_ = registers; 77 descriptor->register_params_ = registers;
82 descriptor->deoptimization_handler_ = 78 descriptor->deoptimization_handler_ =
83 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 79 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
84 } 80 }
85 81
86 82
87 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
88 Isolate* isolate,
89 CodeStubInterfaceDescriptor* descriptor) { 84 CodeStubInterfaceDescriptor* descriptor) {
90 // x3: array literals array 85 // x3: array literals array
91 // x2: array literal index 86 // x2: array literal index
92 // x1: constant elements 87 // x1: constant elements
93 static Register registers[] = { x3, x2, x1 }; 88 static Register registers[] = { x3, x2, x1 };
94 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 89 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
95 descriptor->register_params_ = registers; 90 descriptor->register_params_ = registers;
96 descriptor->deoptimization_handler_ = 91 descriptor->deoptimization_handler_ =
97 Runtime::FunctionForId( 92 Runtime::FunctionForId(
98 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 93 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
99 } 94 }
100 95
101 96
102 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 97 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
103 Isolate* isolate,
104 CodeStubInterfaceDescriptor* descriptor) { 98 CodeStubInterfaceDescriptor* descriptor) {
105 // x3: object literals array 99 // x3: object literals array
106 // x2: object literal index 100 // x2: object literal index
107 // x1: constant properties 101 // x1: constant properties
108 // x0: object literal flags 102 // x0: object literal flags
109 static Register registers[] = { x3, x2, x1, x0 }; 103 static Register registers[] = { x3, x2, x1, x0 };
110 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 104 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
111 descriptor->register_params_ = registers; 105 descriptor->register_params_ = registers;
112 descriptor->deoptimization_handler_ = 106 descriptor->deoptimization_handler_ =
113 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; 107 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry;
114 } 108 }
115 109
116 110
117 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( 111 void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
118 Isolate* isolate,
119 CodeStubInterfaceDescriptor* descriptor) { 112 CodeStubInterfaceDescriptor* descriptor) {
120 // x2: feedback vector 113 // x2: feedback vector
121 // x3: call feedback slot 114 // x3: call feedback slot
122 static Register registers[] = { x2, x3 }; 115 static Register registers[] = { x2, x3 };
123 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 116 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
124 descriptor->register_params_ = registers; 117 descriptor->register_params_ = registers;
125 descriptor->deoptimization_handler_ = NULL; 118 descriptor->deoptimization_handler_ = NULL;
126 } 119 }
127 120
128 121
129 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( 122 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
130 Isolate* isolate,
131 CodeStubInterfaceDescriptor* descriptor) { 123 CodeStubInterfaceDescriptor* descriptor) {
132 // x1: receiver 124 // x1: receiver
133 // x0: key 125 // x0: key
134 static Register registers[] = { x1, x0 }; 126 static Register registers[] = { x1, x0 };
135 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 127 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
136 descriptor->register_params_ = registers; 128 descriptor->register_params_ = registers;
137 descriptor->deoptimization_handler_ = 129 descriptor->deoptimization_handler_ =
138 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); 130 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
139 } 131 }
140 132
141 133
142 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( 134 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
143 Isolate* isolate,
144 CodeStubInterfaceDescriptor* descriptor) { 135 CodeStubInterfaceDescriptor* descriptor) {
145 // x1: receiver 136 // x1: receiver
146 // x0: key 137 // x0: key
147 static Register registers[] = { x1, x0 }; 138 static Register registers[] = { x1, x0 };
148 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 139 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
149 descriptor->register_params_ = registers; 140 descriptor->register_params_ = registers;
150 descriptor->deoptimization_handler_ = 141 descriptor->deoptimization_handler_ =
151 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); 142 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
152 } 143 }
153 144
154 145
155 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 146 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
156 Isolate* isolate,
157 CodeStubInterfaceDescriptor* descriptor) { 147 CodeStubInterfaceDescriptor* descriptor) {
158 // x2: length 148 // x2: length
159 // x1: index (of last match) 149 // x1: index (of last match)
160 // x0: string 150 // x0: string
161 static Register registers[] = { x2, x1, x0 }; 151 static Register registers[] = { x2, x1, x0 };
162 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 152 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
163 descriptor->register_params_ = registers; 153 descriptor->register_params_ = registers;
164 descriptor->deoptimization_handler_ = 154 descriptor->deoptimization_handler_ =
165 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; 155 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry;
166 } 156 }
167 157
168 158
169 void LoadFieldStub::InitializeInterfaceDescriptor( 159 void LoadFieldStub::InitializeInterfaceDescriptor(
170 Isolate* isolate,
171 CodeStubInterfaceDescriptor* descriptor) { 160 CodeStubInterfaceDescriptor* descriptor) {
172 // x0: receiver 161 // x0: receiver
173 static Register registers[] = { x0 }; 162 static Register registers[] = { x0 };
174 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 163 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
175 descriptor->register_params_ = registers; 164 descriptor->register_params_ = registers;
176 descriptor->deoptimization_handler_ = NULL; 165 descriptor->deoptimization_handler_ = NULL;
177 } 166 }
178 167
179 168
180 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 169 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
181 Isolate* isolate,
182 CodeStubInterfaceDescriptor* descriptor) { 170 CodeStubInterfaceDescriptor* descriptor) {
183 // x1: receiver 171 // x1: receiver
184 static Register registers[] = { x1 }; 172 static Register registers[] = { x1 };
185 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 173 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
186 descriptor->register_params_ = registers; 174 descriptor->register_params_ = registers;
187 descriptor->deoptimization_handler_ = NULL; 175 descriptor->deoptimization_handler_ = NULL;
188 } 176 }
189 177
190 178
191 void StringLengthStub::InitializeInterfaceDescriptor( 179 void StringLengthStub::InitializeInterfaceDescriptor(
192 Isolate* isolate,
193 CodeStubInterfaceDescriptor* descriptor) { 180 CodeStubInterfaceDescriptor* descriptor) {
194 static Register registers[] = { x0, x2 }; 181 static Register registers[] = { x0, x2 };
195 descriptor->register_param_count_ = 2; 182 descriptor->register_param_count_ = 2;
196 descriptor->register_params_ = registers; 183 descriptor->register_params_ = registers;
197 descriptor->deoptimization_handler_ = NULL; 184 descriptor->deoptimization_handler_ = NULL;
198 } 185 }
199 186
200 187
201 void KeyedStringLengthStub::InitializeInterfaceDescriptor( 188 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
202 Isolate* isolate,
203 CodeStubInterfaceDescriptor* descriptor) { 189 CodeStubInterfaceDescriptor* descriptor) {
204 static Register registers[] = { x1, x0 }; 190 static Register registers[] = { x1, x0 };
205 descriptor->register_param_count_ = 2; 191 descriptor->register_param_count_ = 2;
206 descriptor->register_params_ = registers; 192 descriptor->register_params_ = registers;
207 descriptor->deoptimization_handler_ = NULL; 193 descriptor->deoptimization_handler_ = NULL;
208 } 194 }
209 195
210 196
211 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 197 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
212 Isolate* isolate,
213 CodeStubInterfaceDescriptor* descriptor) { 198 CodeStubInterfaceDescriptor* descriptor) {
214 // x2: receiver 199 // x2: receiver
215 // x1: key 200 // x1: key
216 // x0: value 201 // x0: value
217 static Register registers[] = { x2, x1, x0 }; 202 static Register registers[] = { x2, x1, x0 };
218 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 203 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
219 descriptor->register_params_ = registers; 204 descriptor->register_params_ = registers;
220 descriptor->deoptimization_handler_ = 205 descriptor->deoptimization_handler_ =
221 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 206 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
222 } 207 }
223 208
224 209
225 void TransitionElementsKindStub::InitializeInterfaceDescriptor( 210 void TransitionElementsKindStub::InitializeInterfaceDescriptor(
226 Isolate* isolate,
227 CodeStubInterfaceDescriptor* descriptor) { 211 CodeStubInterfaceDescriptor* descriptor) {
228 // x0: value (js_array) 212 // x0: value (js_array)
229 // x1: to_map 213 // x1: to_map
230 static Register registers[] = { x0, x1 }; 214 static Register registers[] = { x0, x1 };
231 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 215 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
232 descriptor->register_params_ = registers; 216 descriptor->register_params_ = registers;
233 Address entry = 217 Address entry =
234 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; 218 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
235 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); 219 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry);
236 } 220 }
237 221
238 222
239 void CompareNilICStub::InitializeInterfaceDescriptor( 223 void CompareNilICStub::InitializeInterfaceDescriptor(
240 Isolate* isolate,
241 CodeStubInterfaceDescriptor* descriptor) { 224 CodeStubInterfaceDescriptor* descriptor) {
242 // x0: value to compare 225 // x0: value to compare
243 static Register registers[] = { x0 }; 226 static Register registers[] = { x0 };
244 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 227 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
245 descriptor->register_params_ = registers; 228 descriptor->register_params_ = registers;
246 descriptor->deoptimization_handler_ = 229 descriptor->deoptimization_handler_ =
247 FUNCTION_ADDR(CompareNilIC_Miss); 230 FUNCTION_ADDR(CompareNilIC_Miss);
248 descriptor->SetMissHandler( 231 descriptor->SetMissHandler(
249 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate)); 232 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
250 } 233 }
251 234
252 235
253 static void InitializeArrayConstructorDescriptor( 236 static void InitializeArrayConstructorDescriptor(
254 Isolate* isolate,
255 CodeStubInterfaceDescriptor* descriptor, 237 CodeStubInterfaceDescriptor* descriptor,
256 int constant_stack_parameter_count) { 238 int constant_stack_parameter_count) {
257 // x1: function 239 // x1: function
258 // x2: allocation site with elements kind 240 // x2: allocation site with elements kind
259 // x0: number of arguments to the constructor function 241 // x0: number of arguments to the constructor function
260 static Register registers_variable_args[] = { x1, x2, x0 }; 242 static Register registers_variable_args[] = { x1, x2, x0 };
261 static Register registers_no_args[] = { x1, x2 }; 243 static Register registers_no_args[] = { x1, x2 };
262 244
263 if (constant_stack_parameter_count == 0) { 245 if (constant_stack_parameter_count == 0) {
264 descriptor->register_param_count_ = 246 descriptor->register_param_count_ =
265 sizeof(registers_no_args) / sizeof(registers_no_args[0]); 247 sizeof(registers_no_args) / sizeof(registers_no_args[0]);
266 descriptor->register_params_ = registers_no_args; 248 descriptor->register_params_ = registers_no_args;
267 } else { 249 } else {
268 // stack param count needs (constructor pointer, and single argument) 250 // stack param count needs (constructor pointer, and single argument)
269 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 251 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
270 descriptor->stack_parameter_count_ = x0; 252 descriptor->stack_parameter_count_ = x0;
271 descriptor->register_param_count_ = 253 descriptor->register_param_count_ =
272 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]); 254 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]);
273 descriptor->register_params_ = registers_variable_args; 255 descriptor->register_params_ = registers_variable_args;
274 } 256 }
275 257
276 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 258 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
277 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 259 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
278 descriptor->deoptimization_handler_ = 260 descriptor->deoptimization_handler_ =
279 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 261 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
280 } 262 }
281 263
282 264
283 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 265 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
284 Isolate* isolate,
285 CodeStubInterfaceDescriptor* descriptor) { 266 CodeStubInterfaceDescriptor* descriptor) {
286 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); 267 InitializeArrayConstructorDescriptor(descriptor, 0);
287 } 268 }
288 269
289 270
290 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 271 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
291 Isolate* isolate,
292 CodeStubInterfaceDescriptor* descriptor) { 272 CodeStubInterfaceDescriptor* descriptor) {
293 InitializeArrayConstructorDescriptor(isolate, descriptor, 1); 273 InitializeArrayConstructorDescriptor(descriptor, 1);
294 } 274 }
295 275
296 276
297 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 277 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
298 Isolate* isolate,
299 CodeStubInterfaceDescriptor* descriptor) { 278 CodeStubInterfaceDescriptor* descriptor) {
300 InitializeArrayConstructorDescriptor(isolate, descriptor, -1); 279 InitializeArrayConstructorDescriptor(descriptor, -1);
301 } 280 }
302 281
303 282
304 static void InitializeInternalArrayConstructorDescriptor( 283 static void InitializeInternalArrayConstructorDescriptor(
305 Isolate* isolate,
306 CodeStubInterfaceDescriptor* descriptor, 284 CodeStubInterfaceDescriptor* descriptor,
307 int constant_stack_parameter_count) { 285 int constant_stack_parameter_count) {
308 // x1: constructor function 286 // x1: constructor function
309 // x0: number of arguments to the constructor function 287 // x0: number of arguments to the constructor function
310 static Register registers_variable_args[] = { x1, x0 }; 288 static Register registers_variable_args[] = { x1, x0 };
311 static Register registers_no_args[] = { x1 }; 289 static Register registers_no_args[] = { x1 };
312 290
313 if (constant_stack_parameter_count == 0) { 291 if (constant_stack_parameter_count == 0) {
314 descriptor->register_param_count_ = 292 descriptor->register_param_count_ =
315 sizeof(registers_no_args) / sizeof(registers_no_args[0]); 293 sizeof(registers_no_args) / sizeof(registers_no_args[0]);
316 descriptor->register_params_ = registers_no_args; 294 descriptor->register_params_ = registers_no_args;
317 } else { 295 } else {
318 // stack param count needs (constructor pointer, and single argument) 296 // stack param count needs (constructor pointer, and single argument)
319 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; 297 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
320 descriptor->stack_parameter_count_ = x0; 298 descriptor->stack_parameter_count_ = x0;
321 descriptor->register_param_count_ = 299 descriptor->register_param_count_ =
322 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]); 300 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]);
323 descriptor->register_params_ = registers_variable_args; 301 descriptor->register_params_ = registers_variable_args;
324 } 302 }
325 303
326 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 304 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
327 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 305 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
328 descriptor->deoptimization_handler_ = 306 descriptor->deoptimization_handler_ =
329 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 307 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
330 } 308 }
331 309
332 310
333 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 311 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
334 Isolate* isolate,
335 CodeStubInterfaceDescriptor* descriptor) { 312 CodeStubInterfaceDescriptor* descriptor) {
336 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0); 313 InitializeInternalArrayConstructorDescriptor(descriptor, 0);
337 } 314 }
338 315
339 316
340 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 317 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
341 Isolate* isolate,
342 CodeStubInterfaceDescriptor* descriptor) { 318 CodeStubInterfaceDescriptor* descriptor) {
343 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1); 319 InitializeInternalArrayConstructorDescriptor(descriptor, 1);
344 } 320 }
345 321
346 322
347 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 323 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
348 Isolate* isolate,
349 CodeStubInterfaceDescriptor* descriptor) { 324 CodeStubInterfaceDescriptor* descriptor) {
350 InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1); 325 InitializeInternalArrayConstructorDescriptor(descriptor, -1);
351 } 326 }
352 327
353 328
354 void ToBooleanStub::InitializeInterfaceDescriptor( 329 void ToBooleanStub::InitializeInterfaceDescriptor(
355 Isolate* isolate,
356 CodeStubInterfaceDescriptor* descriptor) { 330 CodeStubInterfaceDescriptor* descriptor) {
357 // x0: value 331 // x0: value
358 static Register registers[] = { x0 }; 332 static Register registers[] = { x0 };
359 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 333 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
360 descriptor->register_params_ = registers; 334 descriptor->register_params_ = registers;
361 descriptor->deoptimization_handler_ = FUNCTION_ADDR(ToBooleanIC_Miss); 335 descriptor->deoptimization_handler_ = FUNCTION_ADDR(ToBooleanIC_Miss);
362 descriptor->SetMissHandler( 336 descriptor->SetMissHandler(
363 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate)); 337 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
364 } 338 }
365 339
366 340
367 void StoreGlobalStub::InitializeInterfaceDescriptor( 341 void StoreGlobalStub::InitializeInterfaceDescriptor(
368 Isolate* isolate,
369 CodeStubInterfaceDescriptor* descriptor) { 342 CodeStubInterfaceDescriptor* descriptor) {
370 // x1: receiver 343 // x1: receiver
371 // x2: key (unused) 344 // x2: key (unused)
372 // x0: value 345 // x0: value
373 static Register registers[] = { x1, x2, x0 }; 346 static Register registers[] = { x1, x2, x0 };
374 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 347 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
375 descriptor->register_params_ = registers; 348 descriptor->register_params_ = registers;
376 descriptor->deoptimization_handler_ = 349 descriptor->deoptimization_handler_ =
377 FUNCTION_ADDR(StoreIC_MissFromStubFailure); 350 FUNCTION_ADDR(StoreIC_MissFromStubFailure);
378 } 351 }
379 352
380 353
381 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( 354 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
382 Isolate* isolate,
383 CodeStubInterfaceDescriptor* descriptor) { 355 CodeStubInterfaceDescriptor* descriptor) {
384 // x0: value 356 // x0: value
385 // x3: target map 357 // x3: target map
386 // x1: key 358 // x1: key
387 // x2: receiver 359 // x2: receiver
388 static Register registers[] = { x0, x3, x1, x2 }; 360 static Register registers[] = { x0, x3, x1, x2 };
389 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 361 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
390 descriptor->register_params_ = registers; 362 descriptor->register_params_ = registers;
391 descriptor->deoptimization_handler_ = 363 descriptor->deoptimization_handler_ =
392 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); 364 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
393 } 365 }
394 366
395 367
396 void BinaryOpICStub::InitializeInterfaceDescriptor( 368 void BinaryOpICStub::InitializeInterfaceDescriptor(
397 Isolate* isolate,
398 CodeStubInterfaceDescriptor* descriptor) { 369 CodeStubInterfaceDescriptor* descriptor) {
399 // x1: left operand 370 // x1: left operand
400 // x0: right operand 371 // x0: right operand
401 static Register registers[] = { x1, x0 }; 372 static Register registers[] = { x1, x0 };
402 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 373 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
403 descriptor->register_params_ = registers; 374 descriptor->register_params_ = registers;
404 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); 375 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
405 descriptor->SetMissHandler( 376 descriptor->SetMissHandler(
406 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); 377 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
407 } 378 }
408 379
409 380
410 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( 381 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
411 Isolate* isolate,
412 CodeStubInterfaceDescriptor* descriptor) { 382 CodeStubInterfaceDescriptor* descriptor) {
413 // x2: allocation site 383 // x2: allocation site
414 // x1: left operand 384 // x1: left operand
415 // x0: right operand 385 // x0: right operand
416 static Register registers[] = { x2, x1, x0 }; 386 static Register registers[] = { x2, x1, x0 };
417 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 387 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
418 descriptor->register_params_ = registers; 388 descriptor->register_params_ = registers;
419 descriptor->deoptimization_handler_ = 389 descriptor->deoptimization_handler_ =
420 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); 390 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite);
421 } 391 }
422 392
423 393
424 void StringAddStub::InitializeInterfaceDescriptor( 394 void StringAddStub::InitializeInterfaceDescriptor(
425 Isolate* isolate,
426 CodeStubInterfaceDescriptor* descriptor) { 395 CodeStubInterfaceDescriptor* descriptor) {
427 // x1: left operand 396 // x1: left operand
428 // x0: right operand 397 // x0: right operand
429 static Register registers[] = { x1, x0 }; 398 static Register registers[] = { x1, x0 };
430 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); 399 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]);
431 descriptor->register_params_ = registers; 400 descriptor->register_params_ = registers;
432 descriptor->deoptimization_handler_ = 401 descriptor->deoptimization_handler_ =
433 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; 402 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry;
434 } 403 }
435 404
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 498 }
530 499
531 500
532 #define __ ACCESS_MASM(masm) 501 #define __ ACCESS_MASM(masm)
533 502
534 503
535 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { 504 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
536 // Update the static counter each time a new code stub is generated. 505 // Update the static counter each time a new code stub is generated.
537 isolate()->counters()->code_stubs()->Increment(); 506 isolate()->counters()->code_stubs()->Increment();
538 507
539 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate()); 508 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
540 int param_count = descriptor->register_param_count_; 509 int param_count = descriptor->register_param_count_;
541 { 510 {
542 // Call the runtime system in a fresh internal frame. 511 // Call the runtime system in a fresh internal frame.
543 FrameScope scope(masm, StackFrame::INTERNAL); 512 FrameScope scope(masm, StackFrame::INTERNAL);
544 ASSERT((descriptor->register_param_count_ == 0) || 513 ASSERT((descriptor->register_param_count_ == 0) ||
545 x0.Is(descriptor->register_params_[param_count - 1])); 514 x0.Is(descriptor->register_params_[param_count - 1]));
546 515
547 // Push arguments 516 // Push arguments
548 MacroAssembler::PushPopQueue queue(masm); 517 MacroAssembler::PushPopQueue queue(masm);
549 for (int i = 0; i < param_count; ++i) { 518 for (int i = 0; i < param_count; ++i) {
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 __ PopCPURegList(saved_fp_regs); 1087 __ PopCPURegList(saved_fp_regs);
1119 } 1088 }
1120 __ PopCPURegList(saved_regs); 1089 __ PopCPURegList(saved_regs);
1121 __ Ret(); 1090 __ Ret();
1122 } 1091 }
1123 1092
1124 1093
1125 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( 1094 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
1126 Isolate* isolate) { 1095 Isolate* isolate) {
1127 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs); 1096 StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs);
1128 stub1.GetCode(isolate); 1097 stub1.GetCode();
1129 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs); 1098 StoreBufferOverflowStub stub2(isolate, kSaveFPRegs);
1130 stub2.GetCode(isolate); 1099 stub2.GetCode();
1131 } 1100 }
1132 1101
1133 1102
1134 void StoreRegistersStateStub::Generate(MacroAssembler* masm) { 1103 void StoreRegistersStateStub::Generate(MacroAssembler* masm) {
1135 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); 1104 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
1136 UseScratchRegisterScope temps(masm); 1105 UseScratchRegisterScope temps(masm);
1137 Register saved_lr = temps.UnsafeAcquire(to_be_pushed_lr()); 1106 Register saved_lr = temps.UnsafeAcquire(to_be_pushed_lr());
1138 Register return_address = temps.AcquireX(); 1107 Register return_address = temps.AcquireX();
1139 __ Mov(return_address, lr); 1108 __ Mov(return_address, lr);
1140 // Restore lr with the value it had before the call to this stub (the value 1109 // Restore lr with the value it had before the call to this stub (the value
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 CreateAllocationSiteStub::GenerateAheadOfTime(isolate); 1394 CreateAllocationSiteStub::GenerateAheadOfTime(isolate);
1426 BinaryOpICStub::GenerateAheadOfTime(isolate); 1395 BinaryOpICStub::GenerateAheadOfTime(isolate);
1427 StoreRegistersStateStub::GenerateAheadOfTime(isolate); 1396 StoreRegistersStateStub::GenerateAheadOfTime(isolate);
1428 RestoreRegistersStateStub::GenerateAheadOfTime(isolate); 1397 RestoreRegistersStateStub::GenerateAheadOfTime(isolate);
1429 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); 1398 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate);
1430 } 1399 }
1431 1400
1432 1401
1433 void StoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) { 1402 void StoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
1434 StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); 1403 StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
1435 stub1.GetCode(isolate); 1404 stub1.GetCode();
1436 StoreRegistersStateStub stub2(isolate, kSaveFPRegs); 1405 StoreRegistersStateStub stub2(isolate, kSaveFPRegs);
1437 stub2.GetCode(isolate); 1406 stub2.GetCode();
1438 } 1407 }
1439 1408
1440 1409
1441 void RestoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) { 1410 void RestoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
1442 RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs); 1411 RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
1443 stub1.GetCode(isolate); 1412 stub1.GetCode();
1444 RestoreRegistersStateStub stub2(isolate, kSaveFPRegs); 1413 RestoreRegistersStateStub stub2(isolate, kSaveFPRegs);
1445 stub2.GetCode(isolate); 1414 stub2.GetCode();
1446 } 1415 }
1447 1416
1448 1417
1449 void CodeStub::GenerateFPStubs(Isolate* isolate) { 1418 void CodeStub::GenerateFPStubs(Isolate* isolate) {
1450 // Floating-point code doesn't get special handling in ARM64, so there's 1419 // Floating-point code doesn't get special handling in ARM64, so there's
1451 // nothing to do here. 1420 // nothing to do here.
1452 USE(isolate); 1421 USE(isolate);
1453 } 1422 }
1454 1423
1455 1424
1456 bool CEntryStub::NeedsImmovableCode() { 1425 bool CEntryStub::NeedsImmovableCode() {
1457 // CEntryStub stores the return address on the stack before calling into 1426 // CEntryStub stores the return address on the stack before calling into
1458 // C++ code. In some cases, the VM accesses this address, but it is not used 1427 // C++ code. In some cases, the VM accesses this address, but it is not used
1459 // when the C++ code returns to the stub because LR holds the return address 1428 // when the C++ code returns to the stub because LR holds the return address
1460 // in AAPCS64. If the stub is moved (perhaps during a GC), we could end up 1429 // in AAPCS64. If the stub is moved (perhaps during a GC), we could end up
1461 // returning to dead code. 1430 // returning to dead code.
1462 // TODO(jbramley): Whilst this is the only analysis that makes sense, I can't 1431 // TODO(jbramley): Whilst this is the only analysis that makes sense, I can't
1463 // find any comment to confirm this, and I don't hit any crashes whatever 1432 // find any comment to confirm this, and I don't hit any crashes whatever
1464 // this function returns. The anaylsis should be properly confirmed. 1433 // this function returns. The anaylsis should be properly confirmed.
1465 return true; 1434 return true;
1466 } 1435 }
1467 1436
1468 1437
1469 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { 1438 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
1470 CEntryStub stub(isolate, 1, kDontSaveFPRegs); 1439 CEntryStub stub(isolate, 1, kDontSaveFPRegs);
1471 stub.GetCode(isolate); 1440 stub.GetCode();
1472 CEntryStub stub_fp(isolate, 1, kSaveFPRegs); 1441 CEntryStub stub_fp(isolate, 1, kSaveFPRegs);
1473 stub_fp.GetCode(isolate); 1442 stub_fp.GetCode();
1474 } 1443 }
1475 1444
1476 1445
1477 void CEntryStub::Generate(MacroAssembler* masm) { 1446 void CEntryStub::Generate(MacroAssembler* masm) {
1478 // The Abort mechanism relies on CallRuntime, which in turn relies on 1447 // The Abort mechanism relies on CallRuntime, which in turn relies on
1479 // CEntryStub, so until this stub has been generated, we have to use a 1448 // CEntryStub, so until this stub has been generated, we have to use a
1480 // fall-back Abort mechanism. 1449 // fall-back Abort mechanism.
1481 // 1450 //
1482 // Note that this stub must be generated before any use of Abort. 1451 // Note that this stub must be generated before any use of Abort.
1483 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); 1452 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
(...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after
3551 __ Fcmp(lhs_d, rhs_d); 3520 __ Fcmp(lhs_d, rhs_d);
3552 __ B(vs, &unordered); // Overflow flag set if either is NaN. 3521 __ B(vs, &unordered); // Overflow flag set if either is NaN.
3553 STATIC_ASSERT((LESS == -1) && (EQUAL == 0) && (GREATER == 1)); 3522 STATIC_ASSERT((LESS == -1) && (EQUAL == 0) && (GREATER == 1));
3554 __ Cset(result, gt); // gt => 1, otherwise (lt, eq) => 0 (EQUAL). 3523 __ Cset(result, gt); // gt => 1, otherwise (lt, eq) => 0 (EQUAL).
3555 __ Csinv(result, result, xzr, ge); // lt => -1, gt => 1, eq => 0. 3524 __ Csinv(result, result, xzr, ge); // lt => -1, gt => 1, eq => 0.
3556 __ Ret(); 3525 __ Ret();
3557 3526
3558 __ Bind(&unordered); 3527 __ Bind(&unordered);
3559 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC, 3528 ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC,
3560 CompareIC::GENERIC); 3529 CompareIC::GENERIC);
3561 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 3530 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
3562 3531
3563 __ Bind(&maybe_undefined1); 3532 __ Bind(&maybe_undefined1);
3564 if (Token::IsOrderedRelationalCompareOp(op_)) { 3533 if (Token::IsOrderedRelationalCompareOp(op_)) {
3565 __ JumpIfNotRoot(rhs, Heap::kUndefinedValueRootIndex, &miss); 3534 __ JumpIfNotRoot(rhs, Heap::kUndefinedValueRootIndex, &miss);
3566 __ JumpIfSmi(lhs, &unordered); 3535 __ JumpIfSmi(lhs, &unordered);
3567 __ JumpIfNotObjectType(lhs, x10, x10, HEAP_NUMBER_TYPE, &maybe_undefined2); 3536 __ JumpIfNotObjectType(lhs, x10, x10, HEAP_NUMBER_TYPE, &maybe_undefined2);
3568 __ B(&unordered); 3537 __ B(&unordered);
3569 } 3538 }
3570 3539
3571 __ Bind(&maybe_undefined2); 3540 __ Bind(&maybe_undefined2);
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 __ Bind(&double_elements); 4543 __ Bind(&double_elements);
4575 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset)); 4544 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset));
4576 __ StoreNumberToDoubleElements(value, index_smi, x10, x11, d0, d1, 4545 __ StoreNumberToDoubleElements(value, index_smi, x10, x11, d0, d1,
4577 &slow_elements); 4546 &slow_elements);
4578 __ Ret(); 4547 __ Ret();
4579 } 4548 }
4580 4549
4581 4550
4582 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { 4551 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
4583 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); 4552 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
4584 __ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); 4553 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
4585 int parameter_count_offset = 4554 int parameter_count_offset =
4586 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; 4555 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
4587 __ Ldr(x1, MemOperand(fp, parameter_count_offset)); 4556 __ Ldr(x1, MemOperand(fp, parameter_count_offset));
4588 if (function_mode_ == JS_FUNCTION_STUB_MODE) { 4557 if (function_mode_ == JS_FUNCTION_STUB_MODE) {
4589 __ Add(x1, x1, 1); 4558 __ Add(x1, x1, 1);
4590 } 4559 }
4591 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 4560 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
4592 __ Drop(x1); 4561 __ Drop(x1);
4593 // Return to IC Miss stub, continuation still on stack. 4562 // Return to IC Miss stub, continuation still on stack.
4594 __ Ret(); 4563 __ Ret();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
4680 __ SetStackPointer(old_stack_pointer); 4649 __ SetStackPointer(old_stack_pointer);
4681 } 4650 }
4682 4651
4683 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, 4652 void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
4684 Register target) { 4653 Register target) {
4685 // Make sure the caller configured the stack pointer (see comment in 4654 // Make sure the caller configured the stack pointer (see comment in
4686 // DirectCEntryStub::Generate). 4655 // DirectCEntryStub::Generate).
4687 ASSERT(csp.Is(__ StackPointer())); 4656 ASSERT(csp.Is(__ StackPointer()));
4688 4657
4689 intptr_t code = 4658 intptr_t code =
4690 reinterpret_cast<intptr_t>(GetCode(isolate()).location()); 4659 reinterpret_cast<intptr_t>(GetCode().location());
4691 __ Mov(lr, Operand(code, RelocInfo::CODE_TARGET)); 4660 __ Mov(lr, Operand(code, RelocInfo::CODE_TARGET));
4692 __ Mov(x10, target); 4661 __ Mov(x10, target);
4693 // Branch to the stub. 4662 // Branch to the stub.
4694 __ Blr(lr); 4663 __ Blr(lr);
4695 } 4664 }
4696 4665
4697 4666
4698 // Probe the name dictionary in the 'elements' register. 4667 // Probe the name dictionary in the 'elements' register.
4699 // Jump to the 'done' label if a property with the given name is found. 4668 // Jump to the 'done' label if a property with the given name is found.
4700 // Jump to the 'miss' label otherwise. 4669 // Jump to the 'miss' label otherwise.
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
5055 } 5024 }
5056 5025
5057 5026
5058 template<class T> 5027 template<class T>
5059 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { 5028 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
5060 int to_index = GetSequenceIndexFromFastElementsKind( 5029 int to_index = GetSequenceIndexFromFastElementsKind(
5061 TERMINAL_FAST_ELEMENTS_KIND); 5030 TERMINAL_FAST_ELEMENTS_KIND);
5062 for (int i = 0; i <= to_index; ++i) { 5031 for (int i = 0; i <= to_index; ++i) {
5063 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5032 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5064 T stub(isolate, kind); 5033 T stub(isolate, kind);
5065 stub.GetCode(isolate); 5034 stub.GetCode();
5066 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { 5035 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
5067 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); 5036 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
5068 stub1.GetCode(isolate); 5037 stub1.GetCode();
5069 } 5038 }
5070 } 5039 }
5071 } 5040 }
5072 5041
5073 5042
5074 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { 5043 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) {
5075 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( 5044 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
5076 isolate); 5045 isolate);
5077 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( 5046 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
5078 isolate); 5047 isolate);
5079 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( 5048 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>(
5080 isolate); 5049 isolate);
5081 } 5050 }
5082 5051
5083 5052
5084 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( 5053 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
5085 Isolate* isolate) { 5054 Isolate* isolate) {
5086 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; 5055 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS };
5087 for (int i = 0; i < 2; i++) { 5056 for (int i = 0; i < 2; i++) {
5088 // For internal arrays we only need a few things 5057 // For internal arrays we only need a few things
5089 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); 5058 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
5090 stubh1.GetCode(isolate); 5059 stubh1.GetCode();
5091 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); 5060 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
5092 stubh2.GetCode(isolate); 5061 stubh2.GetCode();
5093 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); 5062 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
5094 stubh3.GetCode(isolate); 5063 stubh3.GetCode();
5095 } 5064 }
5096 } 5065 }
5097 5066
5098 5067
5099 void ArrayConstructorStub::GenerateDispatchToArrayStub( 5068 void ArrayConstructorStub::GenerateDispatchToArrayStub(
5100 MacroAssembler* masm, 5069 MacroAssembler* masm,
5101 AllocationSiteOverrideMode mode) { 5070 AllocationSiteOverrideMode mode) {
5102 Register argc = x0; 5071 Register argc = x0;
5103 if (argument_count_ == ANY) { 5072 if (argument_count_ == ANY) {
5104 Label zero_case, n_case; 5073 Label zero_case, n_case;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
5415 MemOperand(fp, 6 * kPointerSize), 5384 MemOperand(fp, 6 * kPointerSize),
5416 NULL); 5385 NULL);
5417 } 5386 }
5418 5387
5419 5388
5420 #undef __ 5389 #undef __
5421 5390
5422 } } // namespace v8::internal 5391 } } // namespace v8::internal
5423 5392
5424 #endif // V8_TARGET_ARCH_ARM64 5393 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698