Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/x64/builtins-x64.cc

Issue 1882073002: [Interpreter] Make dispatch table point to code entry instead of code objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix visiting dispatch table. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 676 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
677 __ Move( 677 __ Move(
678 kInterpreterDispatchTableRegister, 678 kInterpreterDispatchTableRegister,
679 ExternalReference::interpreter_dispatch_table_address(masm->isolate())); 679 ExternalReference::interpreter_dispatch_table_address(masm->isolate()));
680 680
681 // Dispatch to the first bytecode handler for the function. 681 // Dispatch to the first bytecode handler for the function.
682 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, 682 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister,
683 kInterpreterBytecodeOffsetRegister, times_1, 0)); 683 kInterpreterBytecodeOffsetRegister, times_1, 0));
684 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, 684 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx,
685 times_pointer_size, 0)); 685 times_pointer_size, 0));
686 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
687 // and header removal.
688 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag));
689 __ call(rbx); 686 __ call(rbx);
690 687
691 // Even though the first bytecode handler was called, we will never return. 688 // Even though the first bytecode handler was called, we will never return.
692 __ Abort(kUnexpectedReturnFromBytecodeHandler); 689 __ Abort(kUnexpectedReturnFromBytecodeHandler);
693 690
694 // Load debug copy of the bytecode array. 691 // Load debug copy of the bytecode array.
695 __ bind(&load_debug_bytecode_array); 692 __ bind(&load_debug_bytecode_array);
696 Register debug_info = kInterpreterBytecodeArrayRegister; 693 Register debug_info = kInterpreterBytecodeArrayRegister;
697 __ movp(debug_info, FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset)); 694 __ movp(debug_info, FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset));
698 __ movp(kInterpreterBytecodeArrayRegister, 695 __ movp(kInterpreterBytecodeArrayRegister,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 Operand(kInterpreterRegisterFileRegister, 837 Operand(kInterpreterRegisterFileRegister,
841 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); 838 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer));
842 __ SmiToInteger32(kInterpreterBytecodeOffsetRegister, 839 __ SmiToInteger32(kInterpreterBytecodeOffsetRegister,
843 kInterpreterBytecodeOffsetRegister); 840 kInterpreterBytecodeOffsetRegister);
844 841
845 // Dispatch to the target bytecode. 842 // Dispatch to the target bytecode.
846 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, 843 __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister,
847 kInterpreterBytecodeOffsetRegister, times_1, 0)); 844 kInterpreterBytecodeOffsetRegister, times_1, 0));
848 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, 845 __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx,
849 times_pointer_size, 0)); 846 times_pointer_size, 0));
850 __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag));
851 __ jmp(rbx); 847 __ jmp(rbx);
852 } 848 }
853 849
854 850
855 static void Generate_InterpreterNotifyDeoptimizedHelper( 851 static void Generate_InterpreterNotifyDeoptimizedHelper(
856 MacroAssembler* masm, Deoptimizer::BailoutType type) { 852 MacroAssembler* masm, Deoptimizer::BailoutType type) {
857 // Enter an internal frame. 853 // Enter an internal frame.
858 { 854 {
859 FrameScope scope(masm, StackFrame::INTERNAL); 855 FrameScope scope(masm, StackFrame::INTERNAL);
860 856
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 __ ret(0); 2787 __ ret(0);
2792 } 2788 }
2793 2789
2794 2790
2795 #undef __ 2791 #undef __
2796 2792
2797 } // namespace internal 2793 } // namespace internal
2798 } // namespace v8 2794 } // namespace v8
2799 2795
2800 #endif // V8_TARGET_ARCH_X64 2796 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | test/unittests/interpreter/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698