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

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

Issue 1529113002: [es6] Consistently use %_GetSuperConstructor to implement super calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment 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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2996 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2997 context()->Plug(v0); 2997 context()->Plug(v0);
2998 } 2998 }
2999 2999
3000 3000
3001 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { 3001 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
3002 SuperCallReference* super_call_ref = 3002 SuperCallReference* super_call_ref =
3003 expr->expression()->AsSuperCallReference(); 3003 expr->expression()->AsSuperCallReference();
3004 DCHECK_NOT_NULL(super_call_ref); 3004 DCHECK_NOT_NULL(super_call_ref);
3005 3005
3006 EmitLoadSuperConstructor(super_call_ref); 3006 // Push the super constructor target on the stack (may be null,
3007 __ push(result_register()); 3007 // but the Construct builtin can deal with that properly).
3008 VisitForAccumulatorValue(super_call_ref->this_function_var());
3009 __ AssertFunction(result_register());
3010 __ lw(result_register(),
3011 FieldMemOperand(result_register(), HeapObject::kMapOffset));
3012 __ lw(result_register(),
3013 FieldMemOperand(result_register(), Map::kPrototypeOffset));
3014 __ Push(result_register());
3008 3015
3009 // Push the arguments ("left-to-right") on the stack. 3016 // Push the arguments ("left-to-right") on the stack.
3010 ZoneList<Expression*>* args = expr->arguments(); 3017 ZoneList<Expression*>* args = expr->arguments();
3011 int arg_count = args->length(); 3018 int arg_count = args->length();
3012 for (int i = 0; i < arg_count; i++) { 3019 for (int i = 0; i < arg_count; i++) {
3013 VisitForStackValue(args->at(i)); 3020 VisitForStackValue(args->at(i));
3014 } 3021 }
3015 3022
3016 // Call the construct call builtin that handles allocation and 3023 // Call the construct call builtin that handles allocation and
3017 // constructor invocation. 3024 // constructor invocation.
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
4847 reinterpret_cast<uint32_t>( 4854 reinterpret_cast<uint32_t>(
4848 isolate->builtins()->OsrAfterStackCheck()->entry())); 4855 isolate->builtins()->OsrAfterStackCheck()->entry()));
4849 return OSR_AFTER_STACK_CHECK; 4856 return OSR_AFTER_STACK_CHECK;
4850 } 4857 }
4851 4858
4852 4859
4853 } // namespace internal 4860 } // namespace internal
4854 } // namespace v8 4861 } // namespace v8
4855 4862
4856 #endif // V8_TARGET_ARCH_MIPS 4863 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698