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

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

Issue 1684073002: [Interpreter] Save and restore dispatch table pointer during calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_assm
Patch Set: Update for off-heap dispatch table and address review comments Created 4 years, 10 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 // frames.h for its layout. 992 // frames.h for its layout.
993 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 993 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
994 // Open a frame scope to indicate that there is a frame on the stack. The 994 // Open a frame scope to indicate that there is a frame on the stack. The
995 // MANUAL indicates that the scope shouldn't actually generate code to set up 995 // MANUAL indicates that the scope shouldn't actually generate code to set up
996 // the frame (that is done below). 996 // the frame (that is done below).
997 FrameScope frame_scope(masm, StackFrame::MANUAL); 997 FrameScope frame_scope(masm, StackFrame::MANUAL);
998 __ Push(lr, fp, cp, x1); 998 __ Push(lr, fp, cp, x1);
999 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); 999 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp);
1000 __ Push(x3); 1000 __ Push(x3);
1001 1001
1002 // Push dispatch table pointer.
1003 __ Mov(x0, Operand(ExternalReference::interpreter_dispatch_table_address(
1004 masm->isolate())));
1005 __ Push(x0);
1002 // Push zero for bytecode array offset. 1006 // Push zero for bytecode array offset.
1003 __ Mov(x0, Operand(0)); 1007 __ Mov(x0, Operand(0));
1004 __ Push(x0); 1008 __ Push(x0);
1005 1009
1006 // Get the bytecode array from the function object and load the pointer to the 1010 // Get the bytecode array from the function object and load the pointer to the
1007 // first entry into kInterpreterBytecodeRegister. 1011 // first entry into kInterpreterBytecodeRegister.
1008 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); 1012 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
1009 __ Ldr(kInterpreterBytecodeArrayRegister, 1013 __ Ldr(kInterpreterBytecodeArrayRegister,
1010 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); 1014 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset));
1011 1015
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1055 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1052 // - Code aging of the BytecodeArray object. 1056 // - Code aging of the BytecodeArray object.
1053 1057
1054 // Load accumulator, register file, bytecode offset, dispatch table into 1058 // Load accumulator, register file, bytecode offset, dispatch table into
1055 // registers. 1059 // registers.
1056 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1060 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1057 __ Add(kInterpreterRegisterFileRegister, fp, 1061 __ Add(kInterpreterRegisterFileRegister, fp,
1058 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1062 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1059 __ Mov(kInterpreterBytecodeOffsetRegister, 1063 __ Mov(kInterpreterBytecodeOffsetRegister,
1060 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1064 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1061 __ Mov(kInterpreterDispatchTableRegister, 1065 __ Ldr(kInterpreterDispatchTableRegister,
1062 Operand(ExternalReference::interpreter_dispatch_table_address( 1066 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp));
1063 masm->isolate())));
1064 1067
1065 // Dispatch to the first bytecode handler for the function. 1068 // Dispatch to the first bytecode handler for the function.
1066 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, 1069 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
1067 kInterpreterBytecodeOffsetRegister)); 1070 kInterpreterBytecodeOffsetRegister));
1068 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); 1071 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2));
1069 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); 1072 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1));
1070 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1073 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1071 // and header removal. 1074 // and header removal.
1072 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); 1075 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
1073 __ Call(ip0); 1076 __ Call(ip0);
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2819 } 2822 }
2820 } 2823 }
2821 2824
2822 2825
2823 #undef __ 2826 #undef __
2824 2827
2825 } // namespace internal 2828 } // namespace internal
2826 } // namespace v8 2829 } // namespace v8
2827 2830
2828 #endif // V8_TARGET_ARCH_ARM 2831 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/deoptimizer.cc » ('j') | src/frames.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698