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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2888 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
2889 context()->Plug(eax); | 2889 context()->Plug(eax); |
2890 } | 2890 } |
2891 | 2891 |
2892 | 2892 |
2893 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 2893 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
2894 SuperCallReference* super_call_ref = | 2894 SuperCallReference* super_call_ref = |
2895 expr->expression()->AsSuperCallReference(); | 2895 expr->expression()->AsSuperCallReference(); |
2896 DCHECK_NOT_NULL(super_call_ref); | 2896 DCHECK_NOT_NULL(super_call_ref); |
2897 | 2897 |
2898 EmitLoadSuperConstructor(super_call_ref); | 2898 // Push the super constructor target on the stack (may be null, |
2899 __ push(result_register()); | 2899 // but the Construct builtin can deal with that properly). |
| 2900 VisitForAccumulatorValue(super_call_ref->this_function_var()); |
| 2901 __ AssertFunction(result_register()); |
| 2902 __ mov(result_register(), |
| 2903 FieldOperand(result_register(), HeapObject::kMapOffset)); |
| 2904 __ Push(FieldOperand(result_register(), Map::kPrototypeOffset)); |
2900 | 2905 |
2901 // Push the arguments ("left-to-right") on the stack. | 2906 // Push the arguments ("left-to-right") on the stack. |
2902 ZoneList<Expression*>* args = expr->arguments(); | 2907 ZoneList<Expression*>* args = expr->arguments(); |
2903 int arg_count = args->length(); | 2908 int arg_count = args->length(); |
2904 for (int i = 0; i < arg_count; i++) { | 2909 for (int i = 0; i < arg_count; i++) { |
2905 VisitForStackValue(args->at(i)); | 2910 VisitForStackValue(args->at(i)); |
2906 } | 2911 } |
2907 | 2912 |
2908 // Call the construct call builtin that handles allocation and | 2913 // Call the construct call builtin that handles allocation and |
2909 // constructor invocation. | 2914 // constructor invocation. |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4765 Assembler::target_address_at(call_target_address, | 4770 Assembler::target_address_at(call_target_address, |
4766 unoptimized_code)); | 4771 unoptimized_code)); |
4767 return OSR_AFTER_STACK_CHECK; | 4772 return OSR_AFTER_STACK_CHECK; |
4768 } | 4773 } |
4769 | 4774 |
4770 | 4775 |
4771 } // namespace internal | 4776 } // namespace internal |
4772 } // namespace v8 | 4777 } // namespace v8 |
4773 | 4778 |
4774 #endif // V8_TARGET_ARCH_IA32 | 4779 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |