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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1517243002: [es6] Remove the %DefaultConstructorCallSuper intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@GetSuperConstructor
Patch Set: Created 5 years 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/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('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 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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 3721 matching lines...) Expand 10 before | Expand all | Expand 10 after
3732 // Call the target. 3732 // Call the target.
3733 __ li(a0, Operand(argc)); 3733 __ li(a0, Operand(argc));
3734 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 3734 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
3735 // Restore context register. 3735 // Restore context register.
3736 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3736 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3737 // Discard the function left on TOS. 3737 // Discard the function left on TOS.
3738 context()->DropAndPlug(1, v0); 3738 context()->DropAndPlug(1, v0);
3739 } 3739 }
3740 3740
3741 3741
3742 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
3743 ZoneList<Expression*>* args = expr->arguments();
3744 DCHECK(args->length() == 2);
3745
3746 // Evaluate new.target and super constructor.
3747 VisitForStackValue(args->at(0));
3748 VisitForStackValue(args->at(1));
3749
3750 // Call the construct call builtin that handles allocation and
3751 // constructor invocation.
3752 SetConstructCallPosition(expr);
3753
3754 // Load new target into a3.
3755 __ ld(a3, MemOperand(sp, 1 * kPointerSize));
3756
3757 // Check if the calling frame is an arguments adaptor frame.
3758 Label adaptor_frame, args_set_up, runtime;
3759 __ ld(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
3760 __ ld(a4, MemOperand(a2, StandardFrameConstants::kContextOffset));
3761 __ Branch(&adaptor_frame, eq, a4,
3762 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
3763 // default constructor has no arguments, so no adaptor frame means no args.
3764 __ mov(a0, zero_reg);
3765 __ Branch(&args_set_up);
3766
3767 // Copy arguments from adaptor frame.
3768 {
3769 __ bind(&adaptor_frame);
3770 __ ld(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset));
3771 __ SmiUntag(a1, a1);
3772
3773 __ mov(a0, a1);
3774
3775 // Get arguments pointer in a2.
3776 __ dsll(at, a1, kPointerSizeLog2);
3777 __ Daddu(a2, a2, Operand(at));
3778 __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset));
3779 Label loop;
3780 __ bind(&loop);
3781 // Pre-decrement a2 with kPointerSize on each iteration.
3782 // Pre-decrement in order to skip receiver.
3783 __ Daddu(a2, a2, Operand(-kPointerSize));
3784 __ ld(a4, MemOperand(a2));
3785 __ Push(a4);
3786 __ Daddu(a1, a1, Operand(-1));
3787 __ Branch(&loop, ne, a1, Operand(zero_reg));
3788 }
3789
3790 __ bind(&args_set_up);
3791 __ dsll(at, a0, kPointerSizeLog2);
3792 __ Daddu(at, at, Operand(sp));
3793 __ ld(a1, MemOperand(at, 0));
3794 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
3795
3796 // Restore context register.
3797 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3798
3799 context()->DropAndPlug(1, result_register());
3800 }
3801
3802
3803 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { 3742 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) {
3804 ZoneList<Expression*>* args = expr->arguments(); 3743 ZoneList<Expression*>* args = expr->arguments();
3805 VisitForAccumulatorValue(args->at(0)); 3744 VisitForAccumulatorValue(args->at(0));
3806 3745
3807 Label materialize_true, materialize_false; 3746 Label materialize_true, materialize_false;
3808 Label* if_true = NULL; 3747 Label* if_true = NULL;
3809 Label* if_false = NULL; 3748 Label* if_false = NULL;
3810 Label* fall_through = NULL; 3749 Label* fall_through = NULL;
3811 context()->PrepareTest(&materialize_true, &materialize_false, 3750 context()->PrepareTest(&materialize_true, &materialize_false,
3812 &if_true, &if_false, &fall_through); 3751 &if_true, &if_false, &fall_through);
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
4927 reinterpret_cast<uint64_t>( 4866 reinterpret_cast<uint64_t>(
4928 isolate->builtins()->OsrAfterStackCheck()->entry())); 4867 isolate->builtins()->OsrAfterStackCheck()->entry()));
4929 return OSR_AFTER_STACK_CHECK; 4868 return OSR_AFTER_STACK_CHECK;
4930 } 4869 }
4931 4870
4932 4871
4933 } // namespace internal 4872 } // namespace internal
4934 } // namespace v8 4873 } // namespace v8
4935 4874
4936 #endif // V8_TARGET_ARCH_MIPS64 4875 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698