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

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 2118283003: [builtins] Construct builtin frame in String/Number ctors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@20160630-tostringtag
Patch Set: Remove TODO Created 4 years, 5 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
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 __ Peek(x2, Operand(x4, LSL, kPointerSizeLog2)); 156 __ Peek(x2, Operand(x4, LSL, kPointerSizeLog2));
157 157
158 // Load the double value of the parameter into d2, maybe converting the 158 // Load the double value of the parameter into d2, maybe converting the
159 // parameter to a number first using the ToNumber builtin if necessary. 159 // parameter to a number first using the ToNumber builtin if necessary.
160 Label convert_smi, convert_number, done_convert; 160 Label convert_smi, convert_number, done_convert;
161 __ JumpIfSmi(x2, &convert_smi); 161 __ JumpIfSmi(x2, &convert_smi);
162 __ JumpIfHeapNumber(x2, &convert_number); 162 __ JumpIfHeapNumber(x2, &convert_number);
163 { 163 {
164 // Parameter is not a Number, use the ToNumber builtin to convert it. 164 // Parameter is not a Number, use the ToNumber builtin to convert it.
165 FrameScope scope(masm, StackFrame::MANUAL); 165 FrameScope scope(masm, StackFrame::MANUAL);
166 __ Push(lr, fp);
167 __ Move(fp, jssp);
168 __ Push(cp, x1);
169 __ SmiTag(x0); 166 __ SmiTag(x0);
170 __ SmiTag(x4); 167 __ SmiTag(x4);
171 __ Push(x0, x5, x4); 168 __ EnterBuiltinFrame(cp, x1, x0);
169 __ Push(x5, x4);
172 __ Mov(x0, x2); 170 __ Mov(x0, x2);
173 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); 171 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
174 __ Mov(x2, x0); 172 __ Mov(x2, x0);
175 __ Pop(x4, x5, x0); 173 __ Pop(x4, x5);
174 __ LeaveBuiltinFrame(cp, x1, x0);
175 __ SmiUntag(x4);
176 __ SmiUntag(x0);
176 { 177 {
177 // Restore the double accumulator value (d5). 178 // Restore the double accumulator value (d5).
178 Label done_restore; 179 Label done_restore;
179 __ SmiUntagToDouble(d5, x5, kSpeculativeUntag); 180 __ SmiUntagToDouble(d5, x5, kSpeculativeUntag);
180 __ JumpIfSmi(x5, &done_restore); 181 __ JumpIfSmi(x5, &done_restore);
181 __ Ldr(d5, FieldMemOperand(x5, HeapNumber::kValueOffset)); 182 __ Ldr(d5, FieldMemOperand(x5, HeapNumber::kValueOffset));
182 __ Bind(&done_restore); 183 __ Bind(&done_restore);
183 } 184 }
184 __ SmiUntag(x4);
185 __ SmiUntag(x0);
186 __ Pop(x1, cp, fp, lr);
187 } 185 }
188 __ AssertNumber(x2); 186 __ AssertNumber(x2);
189 __ JumpIfSmi(x2, &convert_smi); 187 __ JumpIfSmi(x2, &convert_smi);
190 188
191 __ Bind(&convert_number); 189 __ Bind(&convert_number);
192 __ Ldr(d2, FieldMemOperand(x2, HeapNumber::kValueOffset)); 190 __ Ldr(d2, FieldMemOperand(x2, HeapNumber::kValueOffset));
193 __ B(&done_convert); 191 __ B(&done_convert);
194 192
195 __ Bind(&convert_smi); 193 __ Bind(&convert_smi);
196 __ SmiUntagToDouble(d2, x2); 194 __ SmiUntagToDouble(d2, x2);
(...skipping 20 matching lines...) Expand all
217 __ Drop(x0); 215 __ Drop(x0);
218 __ Mov(x0, x5); 216 __ Mov(x0, x5);
219 __ Ret(); 217 __ Ret();
220 } 218 }
221 219
222 // static 220 // static
223 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { 221 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
224 // ----------- S t a t e ------------- 222 // ----------- S t a t e -------------
225 // -- x0 : number of arguments 223 // -- x0 : number of arguments
226 // -- x1 : constructor function 224 // -- x1 : constructor function
225 // -- cp : context
227 // -- lr : return address 226 // -- lr : return address
228 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based) 227 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based)
229 // -- sp[argc * 8] : receiver 228 // -- sp[argc * 8] : receiver
230 // ----------------------------------- 229 // -----------------------------------
231 ASM_LOCATION("Builtins::Generate_NumberConstructor"); 230 ASM_LOCATION("Builtins::Generate_NumberConstructor");
232 231
233 // 1. Load the first argument into x0 and get rid of the rest (including the 232 // 1. Load the first argument into x0.
234 // receiver).
235 Label no_arguments; 233 Label no_arguments;
236 { 234 {
237 __ Cbz(x0, &no_arguments); 235 __ Cbz(x0, &no_arguments);
236 __ Mov(x2, x0); // Store argc in x2.
238 __ Sub(x0, x0, 1); 237 __ Sub(x0, x0, 1);
239 __ Drop(x0); 238 __ Ldr(x0, MemOperand(jssp, x0, LSL, kPointerSizeLog2));
240 __ Ldr(x0, MemOperand(jssp, 2 * kPointerSize, PostIndex));
241 } 239 }
242 240
243 // 2a. Convert first argument to number. 241 // 2a. Convert first argument to number.
244 __ Jump(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); 242 {
243 FrameScope scope(masm, StackFrame::MANUAL);
244 __ SmiTag(x2);
245 __ EnterBuiltinFrame(cp, x1, x2);
246 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
247 __ LeaveBuiltinFrame(cp, x1, x2);
248 __ SmiUntag(x2);
249 }
250
251 {
252 // Drop all arguments.
253 __ Drop(x2);
254 }
245 255
246 // 2b. No arguments, return +0 (already in x0). 256 // 2b. No arguments, return +0 (already in x0).
247 __ Bind(&no_arguments); 257 __ Bind(&no_arguments);
248 __ Drop(1); 258 __ Drop(1);
249 __ Ret(); 259 __ Ret();
250 } 260 }
251 261
252 262
253 // static 263 // static
254 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { 264 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
255 // ----------- S t a t e ------------- 265 // ----------- S t a t e -------------
256 // -- x0 : number of arguments 266 // -- x0 : number of arguments
257 // -- x1 : constructor function 267 // -- x1 : constructor function
258 // -- x3 : new target 268 // -- x3 : new target
269 // -- cp : context
259 // -- lr : return address 270 // -- lr : return address
260 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based) 271 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based)
261 // -- sp[argc * 8] : receiver 272 // -- sp[argc * 8] : receiver
262 // ----------------------------------- 273 // -----------------------------------
263 ASM_LOCATION("Builtins::Generate_NumberConstructor_ConstructStub"); 274 ASM_LOCATION("Builtins::Generate_NumberConstructor_ConstructStub");
264 275
265 // 1. Make sure we operate in the context of the called function. 276 // 1. Make sure we operate in the context of the called function.
266 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); 277 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset));
267 278
268 // 2. Load the first argument into x2 and get rid of the rest (including the 279 // 2. Load the first argument into x2.
269 // receiver).
270 { 280 {
271 Label no_arguments, done; 281 Label no_arguments, done;
282 __ Move(x6, x0); // Store argc in x6.
272 __ Cbz(x0, &no_arguments); 283 __ Cbz(x0, &no_arguments);
273 __ Sub(x0, x0, 1); 284 __ Sub(x0, x0, 1);
274 __ Drop(x0); 285 __ Ldr(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2));
275 __ Ldr(x2, MemOperand(jssp, 2 * kPointerSize, PostIndex));
276 __ B(&done); 286 __ B(&done);
277 __ Bind(&no_arguments); 287 __ Bind(&no_arguments);
278 __ Drop(1);
279 __ Mov(x2, Smi::FromInt(0)); 288 __ Mov(x2, Smi::FromInt(0));
280 __ Bind(&done); 289 __ Bind(&done);
281 } 290 }
282 291
283 // 3. Make sure x2 is a number. 292 // 3. Make sure x2 is a number.
284 { 293 {
285 Label done_convert; 294 Label done_convert;
286 __ JumpIfSmi(x2, &done_convert); 295 __ JumpIfSmi(x2, &done_convert);
287 __ JumpIfObjectType(x2, x4, x4, HEAP_NUMBER_TYPE, &done_convert, eq); 296 __ JumpIfObjectType(x2, x4, x4, HEAP_NUMBER_TYPE, &done_convert, eq);
288 { 297 {
289 FrameScope scope(masm, StackFrame::INTERNAL); 298 FrameScope scope(masm, StackFrame::MANUAL);
290 __ Push(x1, x3); 299 __ SmiTag(x6);
300 __ EnterBuiltinFrame(cp, x1, x6);
301 __ Push(x3);
291 __ Move(x0, x2); 302 __ Move(x0, x2);
292 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); 303 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
293 __ Move(x2, x0); 304 __ Move(x2, x0);
294 __ Pop(x3, x1); 305 __ Pop(x3);
306 __ LeaveBuiltinFrame(cp, x1, x6);
307 __ SmiUntag(x6);
295 } 308 }
296 __ Bind(&done_convert); 309 __ Bind(&done_convert);
297 } 310 }
298 311
299 // 4. Check if new target and constructor differ. 312 // 4. Check if new target and constructor differ.
300 Label new_object; 313 Label drop_frame_and_ret, new_object;
301 __ Cmp(x1, x3); 314 __ Cmp(x1, x3);
302 __ B(ne, &new_object); 315 __ B(ne, &new_object);
303 316
304 // 5. Allocate a JSValue wrapper for the number. 317 // 5. Allocate a JSValue wrapper for the number.
305 __ AllocateJSValue(x0, x1, x2, x4, x5, &new_object); 318 __ AllocateJSValue(x0, x1, x2, x4, x5, &new_object);
306 __ Ret(); 319 __ B(&drop_frame_and_ret);
307 320
308 // 6. Fallback to the runtime to create new object. 321 // 6. Fallback to the runtime to create new object.
309 __ bind(&new_object); 322 __ bind(&new_object);
310 { 323 {
311 FrameScope scope(masm, StackFrame::INTERNAL); 324 FrameScope scope(masm, StackFrame::MANUAL);
325 FastNewObjectStub stub(masm->isolate());
326 __ SmiTag(x6);
327 __ EnterBuiltinFrame(cp, x1, x6);
312 __ Push(x2); // first argument 328 __ Push(x2); // first argument
313 FastNewObjectStub stub(masm->isolate());
314 __ CallStub(&stub); 329 __ CallStub(&stub);
315 __ Pop(x2); 330 __ Pop(x2);
331 __ LeaveBuiltinFrame(cp, x1, x6);
332 __ SmiUntag(x6);
316 } 333 }
317 __ Str(x2, FieldMemOperand(x0, JSValue::kValueOffset)); 334 __ Str(x2, FieldMemOperand(x0, JSValue::kValueOffset));
318 __ Ret(); 335
336 __ bind(&drop_frame_and_ret);
337 {
338 __ Drop(x6);
339 __ Drop(1);
340 __ Ret();
341 }
319 } 342 }
320 343
321 344
322 // static 345 // static
323 void Builtins::Generate_StringConstructor(MacroAssembler* masm) { 346 void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
324 // ----------- S t a t e ------------- 347 // ----------- S t a t e -------------
325 // -- x0 : number of arguments 348 // -- x0 : number of arguments
326 // -- x1 : constructor function 349 // -- x1 : constructor function
350 // -- cp : context
327 // -- lr : return address 351 // -- lr : return address
328 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based) 352 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based)
329 // -- sp[argc * 8] : receiver 353 // -- sp[argc * 8] : receiver
330 // ----------------------------------- 354 // -----------------------------------
331 ASM_LOCATION("Builtins::Generate_StringConstructor"); 355 ASM_LOCATION("Builtins::Generate_StringConstructor");
332 356
333 // 1. Load the first argument into x0 and get rid of the rest (including the 357 // 1. Load the first argument into x0.
334 // receiver).
335 Label no_arguments; 358 Label no_arguments;
336 { 359 {
337 __ Cbz(x0, &no_arguments); 360 __ Cbz(x0, &no_arguments);
361 __ Mov(x2, x0); // Store argc in x2.
338 __ Sub(x0, x0, 1); 362 __ Sub(x0, x0, 1);
339 __ Drop(x0); 363 __ Ldr(x0, MemOperand(jssp, x0, LSL, kPointerSizeLog2));
340 __ Ldr(x0, MemOperand(jssp, 2 * kPointerSize, PostIndex));
341 } 364 }
342 365
343 // 2a. At least one argument, return x0 if it's a string, otherwise 366 // 2a. At least one argument, return x0 if it's a string, otherwise
344 // dispatch to appropriate conversion. 367 // dispatch to appropriate conversion.
345 Label to_string, symbol_descriptive_string; 368 Label drop_frame_and_ret, to_string, symbol_descriptive_string;
346 { 369 {
347 __ JumpIfSmi(x0, &to_string); 370 __ JumpIfSmi(x0, &to_string);
348 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE); 371 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE);
349 __ CompareObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE); 372 __ CompareObjectType(x0, x3, x3, FIRST_NONSTRING_TYPE);
350 __ B(hi, &to_string); 373 __ B(hi, &to_string);
351 __ B(eq, &symbol_descriptive_string); 374 __ B(eq, &symbol_descriptive_string);
352 __ Ret(); 375 __ b(&drop_frame_and_ret);
353 } 376 }
354 377
355 // 2b. No arguments, return the empty string (and pop the receiver). 378 // 2b. No arguments, return the empty string (and pop the receiver).
356 __ Bind(&no_arguments); 379 __ Bind(&no_arguments);
357 { 380 {
358 __ LoadRoot(x0, Heap::kempty_stringRootIndex); 381 __ LoadRoot(x0, Heap::kempty_stringRootIndex);
359 __ Drop(1); 382 __ Drop(1);
360 __ Ret(); 383 __ Ret();
361 } 384 }
362 385
363 // 3a. Convert x0 to a string. 386 // 3a. Convert x0 to a string.
364 __ Bind(&to_string); 387 __ Bind(&to_string);
365 { 388 {
389 FrameScope scope(masm, StackFrame::MANUAL);
366 ToStringStub stub(masm->isolate()); 390 ToStringStub stub(masm->isolate());
367 __ TailCallStub(&stub); 391 __ SmiTag(x2);
392 __ EnterBuiltinFrame(cp, x1, x2);
393 __ CallStub(&stub);
394 __ LeaveBuiltinFrame(cp, x1, x2);
395 __ SmiUntag(x2);
368 } 396 }
397 __ b(&drop_frame_and_ret);
369 398
370 // 3b. Convert symbol in x0 to a string. 399 // 3b. Convert symbol in x0 to a string.
371 __ Bind(&symbol_descriptive_string); 400 __ Bind(&symbol_descriptive_string);
372 { 401 {
402 __ Drop(x2);
403 __ Drop(1);
373 __ Push(x0); 404 __ Push(x0);
374 __ TailCallRuntime(Runtime::kSymbolDescriptiveString); 405 __ TailCallRuntime(Runtime::kSymbolDescriptiveString);
375 } 406 }
407
408 __ bind(&drop_frame_and_ret);
409 {
410 __ Drop(x2);
411 __ Drop(1);
412 __ Ret();
413 }
376 } 414 }
377 415
378 416
379 // static 417 // static
380 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { 418 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
381 // ----------- S t a t e ------------- 419 // ----------- S t a t e -------------
382 // -- x0 : number of arguments 420 // -- x0 : number of arguments
383 // -- x1 : constructor function 421 // -- x1 : constructor function
384 // -- x3 : new target 422 // -- x3 : new target
423 // -- cp : context
385 // -- lr : return address 424 // -- lr : return address
386 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based) 425 // -- sp[(argc - n - 1) * 8] : arg[n] (zero based)
387 // -- sp[argc * 8] : receiver 426 // -- sp[argc * 8] : receiver
388 // ----------------------------------- 427 // -----------------------------------
389 ASM_LOCATION("Builtins::Generate_StringConstructor_ConstructStub"); 428 ASM_LOCATION("Builtins::Generate_StringConstructor_ConstructStub");
390 429
391 // 1. Make sure we operate in the context of the called function. 430 // 1. Make sure we operate in the context of the called function.
392 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset)); 431 __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset));
393 432
394 // 2. Load the first argument into x2 and get rid of the rest (including the 433 // 2. Load the first argument into x2.
395 // receiver).
396 { 434 {
397 Label no_arguments, done; 435 Label no_arguments, done;
436 __ mov(x6, x0); // Store argc in x6.
398 __ Cbz(x0, &no_arguments); 437 __ Cbz(x0, &no_arguments);
399 __ Sub(x0, x0, 1); 438 __ Sub(x0, x0, 1);
400 __ Drop(x0); 439 __ Ldr(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2));
401 __ Ldr(x2, MemOperand(jssp, 2 * kPointerSize, PostIndex));
402 __ B(&done); 440 __ B(&done);
403 __ Bind(&no_arguments); 441 __ Bind(&no_arguments);
404 __ Drop(1);
405 __ LoadRoot(x2, Heap::kempty_stringRootIndex); 442 __ LoadRoot(x2, Heap::kempty_stringRootIndex);
406 __ Bind(&done); 443 __ Bind(&done);
407 } 444 }
408 445
409 // 3. Make sure x2 is a string. 446 // 3. Make sure x2 is a string.
410 { 447 {
411 Label convert, done_convert; 448 Label convert, done_convert;
412 __ JumpIfSmi(x2, &convert); 449 __ JumpIfSmi(x2, &convert);
413 __ JumpIfObjectType(x2, x4, x4, FIRST_NONSTRING_TYPE, &done_convert, lo); 450 __ JumpIfObjectType(x2, x4, x4, FIRST_NONSTRING_TYPE, &done_convert, lo);
414 __ Bind(&convert); 451 __ Bind(&convert);
415 { 452 {
416 FrameScope scope(masm, StackFrame::INTERNAL); 453 FrameScope scope(masm, StackFrame::MANUAL);
417 ToStringStub stub(masm->isolate()); 454 ToStringStub stub(masm->isolate());
418 __ Push(x1, x3); 455 __ SmiTag(x6);
456 __ EnterBuiltinFrame(cp, x1, x6);
457 __ Push(x3);
419 __ Move(x0, x2); 458 __ Move(x0, x2);
420 __ CallStub(&stub); 459 __ CallStub(&stub);
421 __ Move(x2, x0); 460 __ Move(x2, x0);
422 __ Pop(x3, x1); 461 __ Pop(x3);
462 __ LeaveBuiltinFrame(cp, x1, x6);
463 __ SmiUntag(x6);
423 } 464 }
424 __ Bind(&done_convert); 465 __ Bind(&done_convert);
425 } 466 }
426 467
427 // 4. Check if new target and constructor differ. 468 // 4. Check if new target and constructor differ.
428 Label new_object; 469 Label drop_frame_and_ret, new_object;
429 __ Cmp(x1, x3); 470 __ Cmp(x1, x3);
430 __ B(ne, &new_object); 471 __ B(ne, &new_object);
431 472
432 // 5. Allocate a JSValue wrapper for the string. 473 // 5. Allocate a JSValue wrapper for the string.
433 __ AllocateJSValue(x0, x1, x2, x4, x5, &new_object); 474 __ AllocateJSValue(x0, x1, x2, x4, x5, &new_object);
434 __ Ret(); 475 __ B(&drop_frame_and_ret);
435 476
436 // 6. Fallback to the runtime to create new object. 477 // 6. Fallback to the runtime to create new object.
437 __ bind(&new_object); 478 __ bind(&new_object);
438 { 479 {
439 FrameScope scope(masm, StackFrame::INTERNAL); 480 FrameScope scope(masm, StackFrame::MANUAL);
481 FastNewObjectStub stub(masm->isolate());
482 __ SmiTag(x6);
483 __ EnterBuiltinFrame(cp, x1, x6);
440 __ Push(x2); // first argument 484 __ Push(x2); // first argument
441 FastNewObjectStub stub(masm->isolate());
442 __ CallStub(&stub); 485 __ CallStub(&stub);
443 __ Pop(x2); 486 __ Pop(x2);
487 __ LeaveBuiltinFrame(cp, x1, x6);
488 __ SmiUntag(x6);
444 } 489 }
445 __ Str(x2, FieldMemOperand(x0, JSValue::kValueOffset)); 490 __ Str(x2, FieldMemOperand(x0, JSValue::kValueOffset));
446 __ Ret(); 491
492 __ bind(&drop_frame_and_ret);
493 {
494 __ Drop(x6);
495 __ Drop(1);
496 __ Ret();
497 }
447 } 498 }
448 499
449 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { 500 static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
450 __ Ldr(x2, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); 501 __ Ldr(x2, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
451 __ Ldr(x2, FieldMemOperand(x2, SharedFunctionInfo::kCodeOffset)); 502 __ Ldr(x2, FieldMemOperand(x2, SharedFunctionInfo::kCodeOffset));
452 __ Add(x2, x2, Code::kHeaderSize - kHeapObjectTag); 503 __ Add(x2, x2, Code::kHeaderSize - kHeapObjectTag);
453 __ Br(x2); 504 __ Br(x2);
454 } 505 }
455 506
456 static void GenerateTailCallToReturnedCode(MacroAssembler* masm, 507 static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 __ Mov(x1, Smi::FromInt(field_index)); 1855 __ Mov(x1, Smi::FromInt(field_index));
1805 __ CallCFunction( 1856 __ CallCFunction(
1806 ExternalReference::get_date_field_function(masm->isolate()), 2); 1857 ExternalReference::get_date_field_function(masm->isolate()), 2);
1807 } 1858 }
1808 __ Ret(); 1859 __ Ret();
1809 1860
1810 // 3. Raise a TypeError if the receiver is not a date. 1861 // 3. Raise a TypeError if the receiver is not a date.
1811 __ Bind(&receiver_not_date); 1862 __ Bind(&receiver_not_date);
1812 { 1863 {
1813 FrameScope scope(masm, StackFrame::MANUAL); 1864 FrameScope scope(masm, StackFrame::MANUAL);
1814 __ Push(x0, lr, fp); 1865 __ Push(x0);
1815 __ Move(fp, jssp); 1866 __ Mov(x0, Smi::FromInt(0));
1816 __ Push(cp, x1); 1867 __ EnterBuiltinFrame(cp, x1, x0);
1817 __ Push(Smi::FromInt(0));
1818 __ CallRuntime(Runtime::kThrowNotDateError); 1868 __ CallRuntime(Runtime::kThrowNotDateError);
1819 } 1869 }
1820 } 1870 }
1821 1871
1822 // static 1872 // static
1823 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1873 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1824 // ----------- S t a t e ------------- 1874 // ----------- S t a t e -------------
1825 // -- x0 : argc 1875 // -- x0 : argc
1826 // -- jssp[0] : argArray (if argc == 2) 1876 // -- jssp[0] : argArray (if argc == 2)
1827 // -- jssp[8] : thisArg (if argc >= 1) 1877 // -- jssp[8] : thisArg (if argc >= 1)
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3039 } 3089 }
3040 } 3090 }
3041 3091
3042 3092
3043 #undef __ 3093 #undef __
3044 3094
3045 } // namespace internal 3095 } // namespace internal
3046 } // namespace v8 3096 } // namespace v8
3047 3097
3048 #endif // V8_TARGET_ARCH_ARM 3098 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698