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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | 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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2880 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2881 context()->Plug(eax); 2881 context()->Plug(eax);
2882 } 2882 }
2883 2883
2884 2884
2885 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { 2885 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
2886 SuperCallReference* super_call_ref = 2886 SuperCallReference* super_call_ref =
2887 expr->expression()->AsSuperCallReference(); 2887 expr->expression()->AsSuperCallReference();
2888 DCHECK_NOT_NULL(super_call_ref); 2888 DCHECK_NOT_NULL(super_call_ref);
2889 2889
2890 EmitLoadSuperConstructor(super_call_ref); 2890 // Push the super constructor target on the stack (may be null,
2891 __ push(result_register()); 2891 // but the Construct builtin can deal with that properly).
2892 VisitForAccumulatorValue(super_call_ref->this_function_var());
2893 __ AssertFunction(result_register());
2894 __ mov(result_register(),
2895 FieldOperand(result_register(), HeapObject::kMapOffset));
2896 __ Push(FieldOperand(result_register(), Map::kPrototypeOffset));
2892 2897
2893 // Push the arguments ("left-to-right") on the stack. 2898 // Push the arguments ("left-to-right") on the stack.
2894 ZoneList<Expression*>* args = expr->arguments(); 2899 ZoneList<Expression*>* args = expr->arguments();
2895 int arg_count = args->length(); 2900 int arg_count = args->length();
2896 for (int i = 0; i < arg_count; i++) { 2901 for (int i = 0; i < arg_count; i++) {
2897 VisitForStackValue(args->at(i)); 2902 VisitForStackValue(args->at(i));
2898 } 2903 }
2899 2904
2900 // Call the construct call builtin that handles allocation and 2905 // Call the construct call builtin that handles allocation and
2901 // constructor invocation. 2906 // constructor invocation.
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 Assembler::target_address_at(call_target_address, 4763 Assembler::target_address_at(call_target_address,
4759 unoptimized_code)); 4764 unoptimized_code));
4760 return OSR_AFTER_STACK_CHECK; 4765 return OSR_AFTER_STACK_CHECK;
4761 } 4766 }
4762 4767
4763 4768
4764 } // namespace internal 4769 } // namespace internal
4765 } // namespace v8 4770 } // namespace v8
4766 4771
4767 #endif // V8_TARGET_ARCH_X87 4772 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698