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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 RelocInfo::CODE_TARGET); | 751 RelocInfo::CODE_TARGET); |
752 } else { | 752 } else { |
753 DCHECK_EQ(function_type, CallableType::kAny); | 753 DCHECK_EQ(function_type, CallableType::kAny); |
754 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 754 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
755 tail_call_mode), | 755 tail_call_mode), |
756 RelocInfo::CODE_TARGET); | 756 RelocInfo::CODE_TARGET); |
757 } | 757 } |
758 } | 758 } |
759 | 759 |
760 // static | 760 // static |
761 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 761 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
| 762 MacroAssembler* masm, CallableType construct_type) { |
762 // ----------- S t a t e ------------- | 763 // ----------- S t a t e ------------- |
763 // -- eax : the number of arguments (not including the receiver) | 764 // -- eax : the number of arguments (not including the receiver) |
764 // -- edx : the new target | 765 // -- edx : the new target |
765 // -- edi : the constructor | 766 // -- edi : the constructor |
766 // -- ebx : the address of the first argument to be pushed. Subsequent | 767 // -- ebx : the address of the first argument to be pushed. Subsequent |
767 // arguments should be consecutive above this, in the same order as | 768 // arguments should be consecutive above this, in the same order as |
768 // they are to be pushed onto the stack. | 769 // they are to be pushed onto the stack. |
769 // ----------------------------------- | 770 // ----------------------------------- |
770 | 771 |
771 // Pop return address to allow tail-call after pushing arguments. | 772 // Pop return address to allow tail-call after pushing arguments. |
(...skipping 11 matching lines...) Expand all Loading... |
783 | 784 |
784 Generate_InterpreterPushArgs(masm, edi); | 785 Generate_InterpreterPushArgs(masm, edi); |
785 | 786 |
786 // Restore the constructor from slot on stack. It was pushed at the slot | 787 // Restore the constructor from slot on stack. It was pushed at the slot |
787 // meant for receiver. | 788 // meant for receiver. |
788 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); | 789 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); |
789 | 790 |
790 // Re-push return address. | 791 // Re-push return address. |
791 __ Push(ecx); | 792 __ Push(ecx); |
792 | 793 |
793 // Call the constructor with unmodified eax, edi, ebi values. | 794 if (construct_type == CallableType::kJSFunction) { |
794 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 795 // TODO(mythria): Change this when allocation site feedback is available. |
| 796 // ConstructFunction initializes allocation site to undefined. |
| 797 __ Jump(masm->isolate()->builtins()->ConstructFunction(), |
| 798 RelocInfo::CODE_TARGET); |
| 799 } else { |
| 800 DCHECK_EQ(construct_type, CallableType::kAny); |
| 801 |
| 802 // Call the constructor with unmodified eax, edi, ebi values. |
| 803 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 804 } |
795 } | 805 } |
796 | 806 |
797 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 807 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
798 // Set the return address to the correct point in the interpreter entry | 808 // Set the return address to the correct point in the interpreter entry |
799 // trampoline. | 809 // trampoline. |
800 Smi* interpreter_entry_return_pc_offset( | 810 Smi* interpreter_entry_return_pc_offset( |
801 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 811 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
802 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); | 812 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
803 __ LoadHeapObject(ebx, | 813 __ LoadHeapObject(ebx, |
804 masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 814 masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 | 3013 |
3004 // And "return" to the OSR entry point of the function. | 3014 // And "return" to the OSR entry point of the function. |
3005 __ ret(0); | 3015 __ ret(0); |
3006 } | 3016 } |
3007 | 3017 |
3008 #undef __ | 3018 #undef __ |
3009 } // namespace internal | 3019 } // namespace internal |
3010 } // namespace v8 | 3020 } // namespace v8 |
3011 | 3021 |
3012 #endif // V8_TARGET_ARCH_IA32 | 3022 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |