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 | 5 |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 // Should never create mementos for api functions. | 330 // Should never create mementos for api functions. |
331 DCHECK(!is_api_function || !create_memento); | 331 DCHECK(!is_api_function || !create_memento); |
332 | 332 |
333 Isolate* isolate = masm->isolate(); | 333 Isolate* isolate = masm->isolate(); |
334 | 334 |
335 // Enter a construct frame. | 335 // Enter a construct frame. |
336 { | 336 { |
337 FrameScope scope(masm, StackFrame::CONSTRUCT); | 337 FrameScope scope(masm, StackFrame::CONSTRUCT); |
338 | 338 |
339 if (create_memento) { | |
340 __ AssertUndefinedOrAllocationSite(a2, t0); | |
341 __ push(a2); | |
342 } | |
343 | |
344 // Preserve the incoming parameters on the stack. | 339 // Preserve the incoming parameters on the stack. |
| 340 __ AssertUndefinedOrAllocationSite(a2, t0); |
345 __ SmiTag(a0); | 341 __ SmiTag(a0); |
346 __ Push(a0, a1, a3); | 342 __ Push(a2, a0, a1, a3); |
347 | 343 |
348 // Try to allocate the object without transitioning into C code. If any of | 344 // Try to allocate the object without transitioning into C code. If any of |
349 // the preconditions is not met, the code bails out to the runtime call. | 345 // the preconditions is not met, the code bails out to the runtime call. |
350 Label rt_call, allocated; | 346 Label rt_call, allocated; |
351 if (FLAG_inline_new) { | 347 if (FLAG_inline_new) { |
352 ExternalReference debug_step_in_fp = | 348 ExternalReference debug_step_in_fp = |
353 ExternalReference::debug_step_in_fp_address(isolate); | 349 ExternalReference::debug_step_in_fp_address(isolate); |
354 __ li(a2, Operand(debug_step_in_fp)); | 350 __ li(a2, Operand(debug_step_in_fp)); |
355 __ ld(a2, MemOperand(a2)); | 351 __ ld(a2, MemOperand(a2)); |
356 __ Branch(&rt_call, ne, a2, Operand(zero_reg)); | 352 __ Branch(&rt_call, ne, a2, Operand(zero_reg)); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 __ Daddu(a0, t0, Operand(a0)); // End of object. | 465 __ Daddu(a0, t0, Operand(a0)); // End of object. |
470 __ InitializeFieldsWithFiller(t1, a0, t3); | 466 __ InitializeFieldsWithFiller(t1, a0, t3); |
471 | 467 |
472 // Fill in memento fields. | 468 // Fill in memento fields. |
473 // t1: points to the allocated but uninitialized memento. | 469 // t1: points to the allocated but uninitialized memento. |
474 __ LoadRoot(t3, Heap::kAllocationMementoMapRootIndex); | 470 __ LoadRoot(t3, Heap::kAllocationMementoMapRootIndex); |
475 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); | 471 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); |
476 __ sd(t3, MemOperand(t1)); | 472 __ sd(t3, MemOperand(t1)); |
477 __ Daddu(t1, t1, kPointerSize); | 473 __ Daddu(t1, t1, kPointerSize); |
478 // Load the AllocationSite. | 474 // Load the AllocationSite. |
479 __ ld(t3, MemOperand(sp, 2 * kPointerSize)); | 475 __ ld(t3, MemOperand(sp, 3 * kPointerSize)); |
| 476 __ AssertUndefinedOrAllocationSite(t3, a0); |
480 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); | 477 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); |
481 __ sd(t3, MemOperand(t1)); | 478 __ sd(t3, MemOperand(t1)); |
482 __ Daddu(t1, t1, kPointerSize); | 479 __ Daddu(t1, t1, kPointerSize); |
483 } else { | 480 } else { |
484 __ dsll(at, a3, kPointerSizeLog2); | 481 __ dsll(at, a3, kPointerSizeLog2); |
485 __ Daddu(a0, t0, Operand(at)); // End of object. | 482 __ Daddu(a0, t0, Operand(at)); // End of object. |
486 __ InitializeFieldsWithFiller(t1, a0, t3); | 483 __ InitializeFieldsWithFiller(t1, a0, t3); |
487 } | 484 } |
488 | 485 |
489 // Add the object tag to make the JSObject real, so that we can continue | 486 // Add the object tag to make the JSObject real, so that we can continue |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { | 648 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { |
652 // ----------- S t a t e ------------- | 649 // ----------- S t a t e ------------- |
653 // -- a0 : number of arguments | 650 // -- a0 : number of arguments |
654 // -- a1 : constructor function | 651 // -- a1 : constructor function |
655 // -- a2 : allocation site or undefined | 652 // -- a2 : allocation site or undefined |
656 // -- a3 : original constructor | 653 // -- a3 : original constructor |
657 // -- ra : return address | 654 // -- ra : return address |
658 // -- sp[...]: constructor arguments | 655 // -- sp[...]: constructor arguments |
659 // ----------------------------------- | 656 // ----------------------------------- |
660 | 657 |
661 // TODO(dslomov): support pretenuring | |
662 CHECK(!FLAG_pretenuring_call_new); | |
663 | |
664 { | 658 { |
665 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); | 659 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); |
666 | 660 |
| 661 __ AssertUndefinedOrAllocationSite(a2, t0); |
| 662 __ push(a2); |
| 663 |
667 __ mov(a4, a0); | 664 __ mov(a4, a0); |
668 __ SmiTag(a4); | 665 __ SmiTag(a4); |
669 __ push(a4); // Smi-tagged arguments count. | 666 __ push(a4); // Smi-tagged arguments count. |
670 | 667 |
671 // Push new.target. | 668 // Push new.target. |
672 __ push(a3); | 669 __ push(a3); |
673 | 670 |
674 // receiver is the hole. | 671 // receiver is the hole. |
675 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 672 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
676 __ push(at); | 673 __ push(at); |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 } | 1733 } |
1737 } | 1734 } |
1738 | 1735 |
1739 | 1736 |
1740 #undef __ | 1737 #undef __ |
1741 | 1738 |
1742 } // namespace internal | 1739 } // namespace internal |
1743 } // namespace v8 | 1740 } // namespace v8 |
1744 | 1741 |
1745 #endif // V8_TARGET_ARCH_MIPS64 | 1742 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |