| 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 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 // Call the target. | 3608 // Call the target. |
| 3609 __ mov(eax, Immediate(argc)); | 3609 __ mov(eax, Immediate(argc)); |
| 3610 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 3610 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 3611 // Restore context register. | 3611 // Restore context register. |
| 3612 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 3612 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 3613 // Discard the function left on TOS. | 3613 // Discard the function left on TOS. |
| 3614 context()->DropAndPlug(1, eax); | 3614 context()->DropAndPlug(1, eax); |
| 3615 } | 3615 } |
| 3616 | 3616 |
| 3617 | 3617 |
| 3618 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | |
| 3619 ZoneList<Expression*>* args = expr->arguments(); | |
| 3620 DCHECK(args->length() == 2); | |
| 3621 | |
| 3622 // Evaluate new.target and super constructor. | |
| 3623 VisitForStackValue(args->at(0)); | |
| 3624 VisitForStackValue(args->at(1)); | |
| 3625 | |
| 3626 // Call the construct call builtin that handles allocation and | |
| 3627 // constructor invocation. | |
| 3628 SetConstructCallPosition(expr); | |
| 3629 | |
| 3630 // Check if the calling frame is an arguments adaptor frame. | |
| 3631 Label adaptor_frame, args_set_up, runtime; | |
| 3632 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | |
| 3633 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); | |
| 3634 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
| 3635 __ j(equal, &adaptor_frame); | |
| 3636 // default constructor has no arguments, so no adaptor frame means no args. | |
| 3637 __ mov(eax, Immediate(0)); | |
| 3638 __ jmp(&args_set_up); | |
| 3639 | |
| 3640 // Copy arguments from adaptor frame. | |
| 3641 { | |
| 3642 __ bind(&adaptor_frame); | |
| 3643 __ mov(ebx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
| 3644 __ SmiUntag(ebx); | |
| 3645 | |
| 3646 __ mov(eax, ebx); | |
| 3647 __ lea(edx, Operand(edx, ebx, times_pointer_size, | |
| 3648 StandardFrameConstants::kCallerSPOffset)); | |
| 3649 Label loop; | |
| 3650 __ bind(&loop); | |
| 3651 __ push(Operand(edx, -1 * kPointerSize)); | |
| 3652 __ sub(edx, Immediate(kPointerSize)); | |
| 3653 __ dec(ebx); | |
| 3654 __ j(not_zero, &loop); | |
| 3655 } | |
| 3656 | |
| 3657 __ bind(&args_set_up); | |
| 3658 | |
| 3659 __ mov(edx, Operand(esp, eax, times_pointer_size, 1 * kPointerSize)); | |
| 3660 __ mov(edi, Operand(esp, eax, times_pointer_size, 0 * kPointerSize)); | |
| 3661 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
| 3662 | |
| 3663 // Restore context register. | |
| 3664 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
| 3665 | |
| 3666 context()->DropAndPlug(1, eax); | |
| 3667 } | |
| 3668 | |
| 3669 | |
| 3670 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3618 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
| 3671 ZoneList<Expression*>* args = expr->arguments(); | 3619 ZoneList<Expression*>* args = expr->arguments(); |
| 3672 DCHECK(args->length() == 1); | 3620 DCHECK(args->length() == 1); |
| 3673 | 3621 |
| 3674 VisitForAccumulatorValue(args->at(0)); | 3622 VisitForAccumulatorValue(args->at(0)); |
| 3675 | 3623 |
| 3676 __ AssertString(eax); | 3624 __ AssertString(eax); |
| 3677 | 3625 |
| 3678 Label materialize_true, materialize_false; | 3626 Label materialize_true, materialize_false; |
| 3679 Label* if_true = NULL; | 3627 Label* if_true = NULL; |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4824 Assembler::target_address_at(call_target_address, | 4772 Assembler::target_address_at(call_target_address, |
| 4825 unoptimized_code)); | 4773 unoptimized_code)); |
| 4826 return OSR_AFTER_STACK_CHECK; | 4774 return OSR_AFTER_STACK_CHECK; |
| 4827 } | 4775 } |
| 4828 | 4776 |
| 4829 | 4777 |
| 4830 } // namespace internal | 4778 } // namespace internal |
| 4831 } // namespace v8 | 4779 } // namespace v8 |
| 4832 | 4780 |
| 4833 #endif // V8_TARGET_ARCH_IA32 | 4781 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |