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

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

Issue 1203103003: Unify the stack layout for construct frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 // r2 is an AllocationSite. We are creating a memento from it, so we 617 // r2 is an AllocationSite. We are creating a memento from it, so we
618 // need to increment the memento create count. 618 // need to increment the memento create count.
619 __ ldr(r3, FieldMemOperand(r2, 619 __ ldr(r3, FieldMemOperand(r2,
620 AllocationSite::kPretenureCreateCountOffset)); 620 AllocationSite::kPretenureCreateCountOffset));
621 __ add(r3, r3, Operand(Smi::FromInt(1))); 621 __ add(r3, r3, Operand(Smi::FromInt(1)));
622 __ str(r3, FieldMemOperand(r2, 622 __ str(r3, FieldMemOperand(r2,
623 AllocationSite::kPretenureCreateCountOffset)); 623 AllocationSite::kPretenureCreateCountOffset));
624 __ bind(&count_incremented); 624 __ bind(&count_incremented);
625 } 625 }
626 626
627 __ pop(r1); // Constructor function.
Dmitry Lomov (no reviews) 2015/06/24 15:49:47 Use __ Drop(1)
arv (Not doing code reviews) 2015/06/24 15:54:10 That is not an option here because we need to have
Dmitry Lomov (no reviews) 2015/06/24 15:58:32 Ah silly me. Thanks
628
627 __ push(r4); 629 __ push(r4);
628 __ push(r4); 630 __ push(r4);
629 631
630 // Reload the number of arguments and the constructor from the stack. 632 // Reload the number of arguments from the stack.
631 // sp[0]: receiver 633 // sp[0]: receiver
632 // sp[1]: receiver 634 // sp[1]: receiver
633 // sp[2]: constructor function 635 // sp[2]: number of arguments (smi-tagged)
634 // sp[3]: number of arguments (smi-tagged) 636 __ ldr(r3, MemOperand(sp, 2 * kPointerSize));
635 __ ldr(r1, MemOperand(sp, 2 * kPointerSize));
636 __ ldr(r3, MemOperand(sp, 3 * kPointerSize));
637 637
638 // Set up pointer to last argument. 638 // Set up pointer to last argument.
639 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); 639 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
640 640
641 // Set up number of arguments for function call below 641 // Set up number of arguments for function call below
642 __ SmiUntag(r0, r3); 642 __ SmiUntag(r0, r3);
643 643
644 // Copy arguments and receiver to the expression stack. 644 // Copy arguments and receiver to the expression stack.
645 // r0: number of arguments 645 // r0: number of arguments
646 // r1: constructor function 646 // r1: constructor function
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 // Throw away the result of the constructor invocation and use the 704 // Throw away the result of the constructor invocation and use the
705 // on-stack receiver as the result. 705 // on-stack receiver as the result.
706 __ bind(&use_receiver); 706 __ bind(&use_receiver);
707 __ ldr(r0, MemOperand(sp)); 707 __ ldr(r0, MemOperand(sp));
708 708
709 // Remove receiver from the stack, remove caller arguments, and 709 // Remove receiver from the stack, remove caller arguments, and
710 // return. 710 // return.
711 __ bind(&exit); 711 __ bind(&exit);
712 // r0: result 712 // r0: result
713 // sp[0]: receiver (newly allocated object) 713 // sp[0]: receiver (newly allocated object)
714 // sp[1]: constructor function 714 // sp[1]: number of arguments (smi-tagged)
715 // sp[2]: number of arguments (smi-tagged) 715 __ ldr(r1, MemOperand(sp, kPointerSize));
716 __ ldr(r1, MemOperand(sp, 2 * kPointerSize));
717 716
718 // Leave construct frame. 717 // Leave construct frame.
719 } 718 }
720 719
721 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); 720 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1));
722 __ add(sp, sp, Operand(kPointerSize)); 721 __ add(sp, sp, Operand(kPointerSize));
723 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, r1, r2); 722 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, r1, r2);
724 __ Jump(lr); 723 __ Jump(lr);
725 } 724 }
726 725
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 } 1809 }
1811 } 1810 }
1812 1811
1813 1812
1814 #undef __ 1813 #undef __
1815 1814
1816 } // namespace internal 1815 } // namespace internal
1817 } // namespace v8 1816 } // namespace v8
1818 1817
1819 #endif // V8_TARGET_ARCH_ARM 1818 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698