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

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

Issue 1239593003: Fix memento initialization when constructing from new call (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: readd deleted line Created 5 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
OLDNEW
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
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);
341 __ push(a2);
Michael Starzinger 2015/07/16 15:40:12 Multiple pushes seem to be going on here, I think
Michael Lippautz 2015/07/16 16:55:12 whoops, done.
345 __ SmiTag(a0); 342 __ SmiTag(a0);
346 __ Push(a0, a1, a3); 343 __ Push(a2, a0, a1, a3);
347 344
348 // Try to allocate the object without transitioning into C code. If any of 345 // 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. 346 // the preconditions is not met, the code bails out to the runtime call.
350 Label rt_call, allocated; 347 Label rt_call, allocated;
351 if (FLAG_inline_new) { 348 if (FLAG_inline_new) {
352 ExternalReference debug_step_in_fp = 349 ExternalReference debug_step_in_fp =
353 ExternalReference::debug_step_in_fp_address(isolate); 350 ExternalReference::debug_step_in_fp_address(isolate);
354 __ li(a2, Operand(debug_step_in_fp)); 351 __ li(a2, Operand(debug_step_in_fp));
355 __ ld(a2, MemOperand(a2)); 352 __ ld(a2, MemOperand(a2));
356 __ Branch(&rt_call, ne, a2, Operand(zero_reg)); 353 __ Branch(&rt_call, ne, a2, Operand(zero_reg));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 __ Daddu(a0, t0, Operand(a0)); // End of object. 466 __ Daddu(a0, t0, Operand(a0)); // End of object.
470 __ InitializeFieldsWithFiller(t1, a0, t3); 467 __ InitializeFieldsWithFiller(t1, a0, t3);
471 468
472 // Fill in memento fields. 469 // Fill in memento fields.
473 // t1: points to the allocated but uninitialized memento. 470 // t1: points to the allocated but uninitialized memento.
474 __ LoadRoot(t3, Heap::kAllocationMementoMapRootIndex); 471 __ LoadRoot(t3, Heap::kAllocationMementoMapRootIndex);
475 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); 472 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset);
476 __ sd(t3, MemOperand(t1)); 473 __ sd(t3, MemOperand(t1));
477 __ Daddu(t1, t1, kPointerSize); 474 __ Daddu(t1, t1, kPointerSize);
478 // Load the AllocationSite. 475 // Load the AllocationSite.
479 __ ld(t3, MemOperand(sp, 2 * kPointerSize)); 476 __ ld(t3, MemOperand(sp, 3 * kPointerSize));
477 __ AssertUndefinedOrAllocationSite(t3, t0);
Michael Starzinger 2015/07/16 15:40:12 This will clobber t0, which contains the untagged
Michael Lippautz 2015/07/16 16:55:12 Done.
480 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); 478 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset);
481 __ sd(t3, MemOperand(t1)); 479 __ sd(t3, MemOperand(t1));
482 __ Daddu(t1, t1, kPointerSize); 480 __ Daddu(t1, t1, kPointerSize);
483 } else { 481 } else {
484 __ dsll(at, a3, kPointerSizeLog2); 482 __ dsll(at, a3, kPointerSizeLog2);
485 __ Daddu(a0, t0, Operand(at)); // End of object. 483 __ Daddu(a0, t0, Operand(at)); // End of object.
486 __ InitializeFieldsWithFiller(t1, a0, t3); 484 __ InitializeFieldsWithFiller(t1, a0, t3);
487 } 485 }
488 486
489 // Add the object tag to make the JSObject real, so that we can continue 487 // 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
651 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { 649 void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
652 // ----------- S t a t e ------------- 650 // ----------- S t a t e -------------
653 // -- a0 : number of arguments 651 // -- a0 : number of arguments
654 // -- a1 : constructor function 652 // -- a1 : constructor function
655 // -- a2 : allocation site or undefined 653 // -- a2 : allocation site or undefined
656 // -- a3 : original constructor 654 // -- a3 : original constructor
657 // -- ra : return address 655 // -- ra : return address
658 // -- sp[...]: constructor arguments 656 // -- sp[...]: constructor arguments
659 // ----------------------------------- 657 // -----------------------------------
660 658
661 // TODO(dslomov): support pretenuring
662 CHECK(!FLAG_pretenuring_call_new);
663
664 { 659 {
665 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); 660 FrameScope frame_scope(masm, StackFrame::CONSTRUCT);
666 661
662 __ AssertUndefinedOrAllocationSite(a2, t0);
663 __ push(a2);
664
667 __ mov(a4, a0); 665 __ mov(a4, a0);
668 __ SmiTag(a4); 666 __ SmiTag(a4);
669 __ push(a4); // Smi-tagged arguments count. 667 __ push(a4); // Smi-tagged arguments count.
670 668
671 // Push new.target. 669 // Push new.target.
672 __ push(a3); 670 __ push(a3);
673 671
674 // receiver is the hole. 672 // receiver is the hole.
675 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 673 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
676 __ push(at); 674 __ push(at);
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 } 1734 }
1737 } 1735 }
1738 1736
1739 1737
1740 #undef __ 1738 #undef __
1741 1739
1742 } // namespace internal 1740 } // namespace internal
1743 } // namespace v8 1741 } // namespace v8
1744 1742
1745 #endif // V8_TARGET_ARCH_MIPS64 1743 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698