OLD | NEW |
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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2873 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2873 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2874 context()->Plug(rax); | 2874 context()->Plug(rax); |
2875 } | 2875 } |
2876 | 2876 |
2877 | 2877 |
2878 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 2878 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
2879 SuperCallReference* super_call_ref = | 2879 SuperCallReference* super_call_ref = |
2880 expr->expression()->AsSuperCallReference(); | 2880 expr->expression()->AsSuperCallReference(); |
2881 DCHECK_NOT_NULL(super_call_ref); | 2881 DCHECK_NOT_NULL(super_call_ref); |
2882 | 2882 |
2883 EmitLoadSuperConstructor(super_call_ref); | 2883 // Push the super constructor target on the stack (may be null, |
2884 __ Push(result_register()); | 2884 // but the Construct builtin can deal with that properly). |
| 2885 VisitForAccumulatorValue(super_call_ref->this_function_var()); |
| 2886 __ AssertFunction(result_register()); |
| 2887 __ movp(result_register(), |
| 2888 FieldOperand(result_register(), HeapObject::kMapOffset)); |
| 2889 __ Push(FieldOperand(result_register(), Map::kPrototypeOffset)); |
2885 | 2890 |
2886 // Push the arguments ("left-to-right") on the stack. | 2891 // Push the arguments ("left-to-right") on the stack. |
2887 ZoneList<Expression*>* args = expr->arguments(); | 2892 ZoneList<Expression*>* args = expr->arguments(); |
2888 int arg_count = args->length(); | 2893 int arg_count = args->length(); |
2889 for (int i = 0; i < arg_count; i++) { | 2894 for (int i = 0; i < arg_count; i++) { |
2890 VisitForStackValue(args->at(i)); | 2895 VisitForStackValue(args->at(i)); |
2891 } | 2896 } |
2892 | 2897 |
2893 // Call the construct call builtin that handles allocation and | 2898 // Call the construct call builtin that handles allocation and |
2894 // constructor invocation. | 2899 // constructor invocation. |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4776 Assembler::target_address_at(call_target_address, | 4781 Assembler::target_address_at(call_target_address, |
4777 unoptimized_code)); | 4782 unoptimized_code)); |
4778 return OSR_AFTER_STACK_CHECK; | 4783 return OSR_AFTER_STACK_CHECK; |
4779 } | 4784 } |
4780 | 4785 |
4781 | 4786 |
4782 } // namespace internal | 4787 } // namespace internal |
4783 } // namespace v8 | 4788 } // namespace v8 |
4784 | 4789 |
4785 #endif // V8_TARGET_ARCH_X64 | 4790 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |