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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 4003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4014 __ bind(&done); | 4014 __ bind(&done); |
4015 | 4015 |
4016 context()->Plug(eax); | 4016 context()->Plug(eax); |
4017 } | 4017 } |
4018 | 4018 |
4019 | 4019 |
4020 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 4020 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
4021 ZoneList<Expression*>* args = expr->arguments(); | 4021 ZoneList<Expression*>* args = expr->arguments(); |
4022 DCHECK(args->length() == 2); | 4022 DCHECK(args->length() == 2); |
4023 | 4023 |
4024 // new.target | 4024 // Evaluate new.target and super constructor. |
4025 VisitForStackValue(args->at(0)); | 4025 VisitForStackValue(args->at(0)); |
4026 | |
4027 // .this_function | |
4028 VisitForStackValue(args->at(1)); | 4026 VisitForStackValue(args->at(1)); |
4029 __ CallRuntime(Runtime::kGetPrototype, 1); | |
4030 __ push(result_register()); | |
4031 | 4027 |
4032 // Load original constructor into ecx. | 4028 // Load original constructor into ecx. |
4033 __ mov(ecx, Operand(esp, 1 * kPointerSize)); | 4029 __ mov(ecx, Operand(esp, 1 * kPointerSize)); |
4034 | 4030 |
4035 // Check if the calling frame is an arguments adaptor frame. | 4031 // Check if the calling frame is an arguments adaptor frame. |
4036 Label adaptor_frame, args_set_up, runtime; | 4032 Label adaptor_frame, args_set_up, runtime; |
4037 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 4033 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
4038 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); | 4034 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); |
4039 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4035 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
4040 __ j(equal, &adaptor_frame); | 4036 __ j(equal, &adaptor_frame); |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5248 Assembler::target_address_at(call_target_address, | 5244 Assembler::target_address_at(call_target_address, |
5249 unoptimized_code)); | 5245 unoptimized_code)); |
5250 return OSR_AFTER_STACK_CHECK; | 5246 return OSR_AFTER_STACK_CHECK; |
5251 } | 5247 } |
5252 | 5248 |
5253 | 5249 |
5254 } // namespace internal | 5250 } // namespace internal |
5255 } // namespace v8 | 5251 } // namespace v8 |
5256 | 5252 |
5257 #endif // V8_TARGET_ARCH_IA32 | 5253 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |