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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2996 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2997 context()->Plug(r3); 2997 context()->Plug(r3);
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 __ LoadP(result_register(),
3011 FieldMemOperand(result_register(), HeapObject::kMapOffset));
3012 __ LoadP(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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
4836 return ON_STACK_REPLACEMENT; 4843 return ON_STACK_REPLACEMENT;
4837 } 4844 }
4838 4845
4839 DCHECK(interrupt_address == 4846 DCHECK(interrupt_address ==
4840 isolate->builtins()->OsrAfterStackCheck()->entry()); 4847 isolate->builtins()->OsrAfterStackCheck()->entry());
4841 return OSR_AFTER_STACK_CHECK; 4848 return OSR_AFTER_STACK_CHECK;
4842 } 4849 }
4843 } // namespace internal 4850 } // namespace internal
4844 } // namespace v8 4851 } // namespace v8
4845 #endif // V8_TARGET_ARCH_PPC 4852 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698