| 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/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 3973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3984 __ bind(&done); | 3984 __ bind(&done); |
| 3985 | 3985 |
| 3986 context()->Plug(eax); | 3986 context()->Plug(eax); |
| 3987 } | 3987 } |
| 3988 | 3988 |
| 3989 | 3989 |
| 3990 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3990 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
| 3991 ZoneList<Expression*>* args = expr->arguments(); | 3991 ZoneList<Expression*>* args = expr->arguments(); |
| 3992 DCHECK(args->length() == 2); | 3992 DCHECK(args->length() == 2); |
| 3993 | 3993 |
| 3994 // new.target | 3994 // Evaluate new.target and super constructor. |
| 3995 VisitForStackValue(args->at(0)); | 3995 VisitForStackValue(args->at(0)); |
| 3996 | |
| 3997 // .this_function | |
| 3998 VisitForStackValue(args->at(1)); | 3996 VisitForStackValue(args->at(1)); |
| 3999 __ CallRuntime(Runtime::kGetPrototype, 1); | |
| 4000 __ push(result_register()); | |
| 4001 | 3997 |
| 4002 // Load original constructor into ecx. | 3998 // Load original constructor into ecx. |
| 4003 __ mov(ecx, Operand(esp, 1 * kPointerSize)); | 3999 __ mov(ecx, Operand(esp, 1 * kPointerSize)); |
| 4004 | 4000 |
| 4005 // Check if the calling frame is an arguments adaptor frame. | 4001 // Check if the calling frame is an arguments adaptor frame. |
| 4006 Label adaptor_frame, args_set_up, runtime; | 4002 Label adaptor_frame, args_set_up, runtime; |
| 4007 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 4003 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 4008 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); | 4004 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); |
| 4009 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4005 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 4010 __ j(equal, &adaptor_frame); | 4006 __ j(equal, &adaptor_frame); |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5218 Assembler::target_address_at(call_target_address, | 5214 Assembler::target_address_at(call_target_address, |
| 5219 unoptimized_code)); | 5215 unoptimized_code)); |
| 5220 return OSR_AFTER_STACK_CHECK; | 5216 return OSR_AFTER_STACK_CHECK; |
| 5221 } | 5217 } |
| 5222 | 5218 |
| 5223 | 5219 |
| 5224 } // namespace internal | 5220 } // namespace internal |
| 5225 } // namespace v8 | 5221 } // namespace v8 |
| 5226 | 5222 |
| 5227 #endif // V8_TARGET_ARCH_X87 | 5223 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |