| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // - Code aging of the BytecodeArray object. | 671 // - Code aging of the BytecodeArray object. |
| 672 | 672 |
| 673 // Load accumulator, register file, bytecode offset, dispatch table into | 673 // Load accumulator, register file, bytecode offset, dispatch table into |
| 674 // registers. | 674 // registers. |
| 675 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 675 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 676 __ movp(kInterpreterRegisterFileRegister, rbp); | 676 __ movp(kInterpreterRegisterFileRegister, rbp); |
| 677 __ addp(kInterpreterRegisterFileRegister, | 677 __ addp(kInterpreterRegisterFileRegister, |
| 678 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 678 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 679 __ movp(kInterpreterBytecodeOffsetRegister, | 679 __ movp(kInterpreterBytecodeOffsetRegister, |
| 680 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 680 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 681 __ LoadRoot(kInterpreterDispatchTableRegister, | 681 __ Move( |
| 682 Heap::kInterpreterTableRootIndex); | 682 kInterpreterDispatchTableRegister, |
| 683 __ addp(kInterpreterDispatchTableRegister, | 683 ExternalReference::interpreter_dispatch_table_address(masm->isolate())); |
| 684 Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 685 | 684 |
| 686 // Dispatch to the first bytecode handler for the function. | 685 // Dispatch to the first bytecode handler for the function. |
| 687 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, | 686 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, |
| 688 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 687 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
| 689 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, | 688 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, |
| 690 times_pointer_size, 0)); | 689 times_pointer_size, 0)); |
| 691 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 690 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 692 // and header removal. | 691 // and header removal. |
| 693 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 692 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 694 __ call(rbx); | 693 __ call(rbx); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 // Call the constructor (rax, rdx, rdi passed on). | 797 // Call the constructor (rax, rdx, rdi passed on). |
| 799 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 798 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 800 } | 799 } |
| 801 | 800 |
| 802 | 801 |
| 803 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { | 802 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
| 804 // Initialize register file register and dispatch table register. | 803 // Initialize register file register and dispatch table register. |
| 805 __ movp(kInterpreterRegisterFileRegister, rbp); | 804 __ movp(kInterpreterRegisterFileRegister, rbp); |
| 806 __ addp(kInterpreterRegisterFileRegister, | 805 __ addp(kInterpreterRegisterFileRegister, |
| 807 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 806 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 808 __ LoadRoot(kInterpreterDispatchTableRegister, | 807 __ Move( |
| 809 Heap::kInterpreterTableRootIndex); | 808 kInterpreterDispatchTableRegister, |
| 810 __ addp(kInterpreterDispatchTableRegister, | 809 ExternalReference::interpreter_dispatch_table_address(masm->isolate())); |
| 811 Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 812 | 810 |
| 813 // Get the context from the frame. | 811 // Get the context from the frame. |
| 814 __ movp(kContextRegister, | 812 __ movp(kContextRegister, |
| 815 Operand(kInterpreterRegisterFileRegister, | 813 Operand(kInterpreterRegisterFileRegister, |
| 816 InterpreterFrameConstants::kContextFromRegisterPointer)); | 814 InterpreterFrameConstants::kContextFromRegisterPointer)); |
| 817 | 815 |
| 818 // Get the bytecode array pointer from the frame. | 816 // Get the bytecode array pointer from the frame. |
| 819 __ movp(rbx, | 817 __ movp(rbx, |
| 820 Operand(kInterpreterRegisterFileRegister, | 818 Operand(kInterpreterRegisterFileRegister, |
| 821 InterpreterFrameConstants::kFunctionFromRegisterPointer)); | 819 InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2854 __ ret(0); | 2852 __ ret(0); |
| 2855 } | 2853 } |
| 2856 | 2854 |
| 2857 | 2855 |
| 2858 #undef __ | 2856 #undef __ |
| 2859 | 2857 |
| 2860 } // namespace internal | 2858 } // namespace internal |
| 2861 } // namespace v8 | 2859 } // namespace v8 |
| 2862 | 2860 |
| 2863 #endif // V8_TARGET_ARCH_X64 | 2861 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |