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

Side by Side Diff: src/mips64/builtins-mips64.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 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 963 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
964 // Open a frame scope to indicate that there is a frame on the stack. The 964 // Open a frame scope to indicate that there is a frame on the stack. The
965 // MANUAL indicates that the scope shouldn't actually generate code to set up 965 // MANUAL indicates that the scope shouldn't actually generate code to set up
966 // the frame (that is done below). 966 // the frame (that is done below).
967 FrameScope frame_scope(masm, StackFrame::MANUAL); 967 FrameScope frame_scope(masm, StackFrame::MANUAL);
968 968
969 __ Push(ra, fp, cp, a1); 969 __ Push(ra, fp, cp, a1);
970 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 970 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
971 __ Push(a3); 971 __ Push(a3);
972 972
973 // Push dispatch table pointer.
974 __ li(a0, Operand(ExternalReference::interpreter_dispatch_table_address(
975 masm->isolate())));
976 __ Push(a0);
balazs.kilvady 2016/02/11 10:44:01 You could use __ Push(a0, zero_reg); to save one d
rmcilroy 2016/02/11 12:30:12 Done.
973 // Push zero for bytecode array offset. 977 // Push zero for bytecode array offset.
974 __ Push(zero_reg); 978 __ Push(zero_reg);
975 979
976 // Get the bytecode array from the function object and load the pointer to the 980 // Get the bytecode array from the function object and load the pointer to the
977 // first entry into kInterpreterBytecodeRegister. 981 // first entry into kInterpreterBytecodeRegister.
978 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 982 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
979 __ ld(kInterpreterBytecodeArrayRegister, 983 __ ld(kInterpreterBytecodeArrayRegister,
980 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 984 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
981 985
982 if (FLAG_debug_code) { 986 if (FLAG_debug_code) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 // - Support profiler (specifically profiling_counter). 1026 // - Support profiler (specifically profiling_counter).
1023 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1027 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1024 // - Code aging of the BytecodeArray object. 1028 // - Code aging of the BytecodeArray object.
1025 1029
1026 // Load bytecode offset and dispatch table into registers. 1030 // Load bytecode offset and dispatch table into registers.
1027 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1031 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1028 __ Daddu(kInterpreterRegisterFileRegister, fp, 1032 __ Daddu(kInterpreterRegisterFileRegister, fp,
1029 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1033 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1030 __ li(kInterpreterBytecodeOffsetRegister, 1034 __ li(kInterpreterBytecodeOffsetRegister,
1031 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1035 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1032 __ li(kInterpreterDispatchTableRegister, 1036 __ lw(kInterpreterDispatchTableRegister,
1033 Operand(ExternalReference::interpreter_dispatch_table_address( 1037 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp));
1034 masm->isolate())));
1035 1038
1036 // Dispatch to the first bytecode handler for the function. 1039 // Dispatch to the first bytecode handler for the function.
1037 __ Daddu(a0, kInterpreterBytecodeArrayRegister, 1040 __ Daddu(a0, kInterpreterBytecodeArrayRegister,
1038 kInterpreterBytecodeOffsetRegister); 1041 kInterpreterBytecodeOffsetRegister);
1039 __ lbu(a0, MemOperand(a0)); 1042 __ lbu(a0, MemOperand(a0));
1040 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 1043 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
1041 __ ld(at, MemOperand(at)); 1044 __ ld(at, MemOperand(at));
1042 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1045 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1043 // and header removal. 1046 // and header removal.
1044 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 1047 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2756 } 2759 }
2757 } 2760 }
2758 2761
2759 2762
2760 #undef __ 2763 #undef __
2761 2764
2762 } // namespace internal 2765 } // namespace internal
2763 } // namespace v8 2766 } // namespace v8
2764 2767
2765 #endif // V8_TARGET_ARCH_MIPS64 2768 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698