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/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
698 | 698 |
699 Generate_InterpreterPushArgs(masm, ecx); | 699 Generate_InterpreterPushArgs(masm, ecx); |
700 | 700 |
701 // Call the target. | 701 // Call the target. |
702 __ Push(edx); // Re-push return address. | 702 __ Push(edx); // Re-push return address. |
703 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 703 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
704 } | 704 } |
705 | 705 |
706 | 706 |
707 // static | 707 // static |
708 void Builtins::Generate_InterpreterPushArgsAndCallIC(MacroAssembler* masm) { | |
709 // ----------- S t a t e ------------- | |
710 // -- eax : the number of arguments (not including the receiver) | |
711 // -- ebx : the address of the first argument to be pushed. Subsequent | |
712 // arguments should be consecutive above this, in the same order as | |
713 // they are to be pushed onto the stack. | |
714 // -- edi : the target to call (can be any Object). | |
715 // -- edx : feedback slot id. | |
716 // -- ecx : type feedback vector. | |
717 // ----------------------------------- | |
718 | |
719 { | |
720 FrameScope scope(masm, StackFrame::INTERNAL); | |
721 // Store the feedback vector below where arguments are going to be pushed. | |
722 // This would act like a temporary store without disturbing the stack. | |
723 // We push eax + 1 values, so adjust the displacement accordingly. | |
724 __ neg(eax); | |
725 __ mov(Operand(esp, eax, times_pointer_size, -2 * kPointerSize), ecx); | |
726 __ neg(eax); | |
rmcilroy
2016/02/12 14:21:03
Could you try and use a virtual register instead,
mythria
2016/02/17 11:02:48
Done.
| |
727 | |
728 // Find the address of the last argument. | |
729 __ mov(ecx, eax); | |
730 __ add(ecx, Immediate(1)); // Add one for receiver. | |
731 __ shl(ecx, kPointerSizeLog2); | |
732 __ neg(ecx); | |
733 __ add(ecx, ebx); | |
rmcilroy
2016/02/12 14:21:03
Could you pull this out to a helper function (to s
mythria
2016/02/17 11:02:48
Done.
| |
734 | |
735 Generate_InterpreterPushArgs(masm, ecx); | |
736 | |
737 // Call via the CallIC stub. | |
rmcilroy
2016/02/12 14:21:03
nit - move this comment above CallIcState call_ic.
mythria
2016/02/17 11:02:48
Done.
| |
738 // Restore feedback vector to ebx from the stack. | |
739 __ mov(ebx, Operand(esp, -kPointerSize)); | |
740 | |
741 CallICState call_ic_state(0, ConvertReceiverMode::kAny, | |
742 TailCallMode::kDisallow, true); | |
743 CallICStub stub(masm->isolate(), call_ic_state); | |
744 __ CallStub(&stub); | |
rmcilroy
2016/02/12 14:21:03
Add a TODO that we should replace this with a Tail
mythria
2016/02/17 11:02:47
Done.
| |
745 } | |
746 __ Ret(); | |
747 } | |
748 | |
749 // static | |
708 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 750 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
709 // ----------- S t a t e ------------- | 751 // ----------- S t a t e ------------- |
710 // -- eax : the number of arguments (not including the receiver) | 752 // -- eax : the number of arguments (not including the receiver) |
711 // -- edx : the new target | 753 // -- edx : the new target |
712 // -- edi : the constructor | 754 // -- edi : the constructor |
713 // -- ebx : the address of the first argument to be pushed. Subsequent | 755 // -- ebx : the address of the first argument to be pushed. Subsequent |
714 // arguments should be consecutive above this, in the same order as | 756 // arguments should be consecutive above this, in the same order as |
715 // they are to be pushed onto the stack. | 757 // they are to be pushed onto the stack. |
716 // ----------------------------------- | 758 // ----------------------------------- |
717 | 759 |
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2772 | 2814 |
2773 __ bind(&ok); | 2815 __ bind(&ok); |
2774 __ ret(0); | 2816 __ ret(0); |
2775 } | 2817 } |
2776 | 2818 |
2777 #undef __ | 2819 #undef __ |
2778 } // namespace internal | 2820 } // namespace internal |
2779 } // namespace v8 | 2821 } // namespace v8 |
2780 | 2822 |
2781 #endif // V8_TARGET_ARCH_IA32 | 2823 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |