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_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 Loading... |
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 Loading... |
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 |
OLD | NEW |