OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 // Should never create mementos for api functions. | 326 // Should never create mementos for api functions. |
327 DCHECK(!is_api_function || !create_memento); | 327 DCHECK(!is_api_function || !create_memento); |
328 | 328 |
329 Isolate* isolate = masm->isolate(); | 329 Isolate* isolate = masm->isolate(); |
330 | 330 |
331 // Enter a construct frame. | 331 // Enter a construct frame. |
332 { | 332 { |
333 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); | 333 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); |
334 | 334 |
335 if (create_memento) { | |
336 __ AssertUndefinedOrAllocationSite(r2, r4); | |
337 __ push(r2); | |
338 } | |
339 | |
340 // Preserve the incoming parameters on the stack. | 335 // Preserve the incoming parameters on the stack. |
| 336 __ AssertUndefinedOrAllocationSite(r2, r4); |
| 337 __ push(r2); |
341 __ SmiTag(r0); | 338 __ SmiTag(r0); |
342 __ push(r0); | 339 __ push(r0); |
343 __ push(r1); | 340 __ push(r1); |
344 __ push(r3); | 341 __ push(r3); |
345 | 342 |
346 // Try to allocate the object without transitioning into C code. If any of | 343 // Try to allocate the object without transitioning into C code. If any of |
347 // the preconditions is not met, the code bails out to the runtime call. | 344 // the preconditions is not met, the code bails out to the runtime call. |
348 Label rt_call, allocated; | 345 Label rt_call, allocated; |
349 if (FLAG_inline_new) { | 346 if (FLAG_inline_new) { |
350 ExternalReference debug_step_in_fp = | 347 ExternalReference debug_step_in_fp = |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 __ sub(ip, r3, Operand(AllocationMemento::kSize / kPointerSize)); | 466 __ sub(ip, r3, Operand(AllocationMemento::kSize / kPointerSize)); |
470 __ add(r0, r4, Operand(ip, LSL, kPointerSizeLog2)); // End of object. | 467 __ add(r0, r4, Operand(ip, LSL, kPointerSizeLog2)); // End of object. |
471 __ InitializeFieldsWithFiller(r5, r0, r6); | 468 __ InitializeFieldsWithFiller(r5, r0, r6); |
472 | 469 |
473 // Fill in memento fields. | 470 // Fill in memento fields. |
474 // r5: points to the allocated but uninitialized memento. | 471 // r5: points to the allocated but uninitialized memento. |
475 __ LoadRoot(r6, Heap::kAllocationMementoMapRootIndex); | 472 __ LoadRoot(r6, Heap::kAllocationMementoMapRootIndex); |
476 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); | 473 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); |
477 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 474 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
478 // Load the AllocationSite | 475 // Load the AllocationSite |
479 __ ldr(r6, MemOperand(sp, 2 * kPointerSize)); | 476 __ ldr(r6, MemOperand(sp, 3 * kPointerSize)); |
| 477 __ AssertUndefinedOrAllocationSite(r6, r0); |
480 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); | 478 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); |
481 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); | 479 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); |
482 } else { | 480 } else { |
483 __ add(r0, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. | 481 __ add(r0, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. |
484 __ InitializeFieldsWithFiller(r5, r0, r6); | 482 __ InitializeFieldsWithFiller(r5, r0, r6); |
485 } | 483 } |
486 | 484 |
487 // Add the object tag to make the JSObject real, so that we can continue | 485 // Add the object tag to make the JSObject real, so that we can continue |
488 // and jump into the continuation code at any time from now on. | 486 // and jump into the continuation code at any time from now on. |
489 __ add(r4, r4, Operand(kHeapObjectTag)); | 487 __ add(r4, r4, Operand(kHeapObjectTag)); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { | 655 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { |
658 // ----------- S t a t e ------------- | 656 // ----------- S t a t e ------------- |
659 // -- r0 : number of arguments | 657 // -- r0 : number of arguments |
660 // -- r1 : constructor function | 658 // -- r1 : constructor function |
661 // -- r2 : allocation site or undefined | 659 // -- r2 : allocation site or undefined |
662 // -- r3 : original constructor | 660 // -- r3 : original constructor |
663 // -- lr : return address | 661 // -- lr : return address |
664 // -- sp[...]: constructor arguments | 662 // -- sp[...]: constructor arguments |
665 // ----------------------------------- | 663 // ----------------------------------- |
666 | 664 |
667 // TODO(dslomov): support pretenuring | |
668 CHECK(!FLAG_pretenuring_call_new); | |
669 | |
670 { | 665 { |
671 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); | 666 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); |
672 | 667 |
| 668 __ AssertUndefinedOrAllocationSite(r2, r4); |
| 669 __ push(r2); |
| 670 |
673 __ mov(r4, r0); | 671 __ mov(r4, r0); |
674 __ SmiTag(r4); | 672 __ SmiTag(r4); |
675 __ push(r4); // Smi-tagged arguments count. | 673 __ push(r4); // Smi-tagged arguments count. |
676 | 674 |
677 // Push new.target. | 675 // Push new.target. |
678 __ push(r3); | 676 __ push(r3); |
679 | 677 |
680 // receiver is the hole. | 678 // receiver is the hole. |
681 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 679 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
682 __ push(ip); | 680 __ push(ip); |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 } | 1728 } |
1731 } | 1729 } |
1732 | 1730 |
1733 | 1731 |
1734 #undef __ | 1732 #undef __ |
1735 | 1733 |
1736 } // namespace internal | 1734 } // namespace internal |
1737 } // namespace v8 | 1735 } // namespace v8 |
1738 | 1736 |
1739 #endif // V8_TARGET_ARCH_ARM | 1737 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |