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

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: 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
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 // The function builds an interpreter frame. See InterpreterFrameConstants in 961 // The function builds an interpreter frame. See InterpreterFrameConstants in
962 // frames.h for its layout. 962 // frames.h for its layout.
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);
972 971
973 // Push zero for bytecode array offset. 972 // Push new.target, dispatch table pointer and zero for bytecode array offset.
974 __ Push(zero_reg); 973 __ li(a0, Operand(ExternalReference::interpreter_dispatch_table_address(
974 masm->isolate())));
975 __ Push(a3, a0, zero_reg);
975 976
976 // Get the bytecode array from the function object and load the pointer to the 977 // Get the bytecode array from the function object and load the pointer to the
977 // first entry into kInterpreterBytecodeRegister. 978 // first entry into kInterpreterBytecodeRegister.
978 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 979 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
979 __ ld(kInterpreterBytecodeArrayRegister, 980 __ ld(kInterpreterBytecodeArrayRegister,
980 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 981 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
981 982
982 if (FLAG_debug_code) { 983 if (FLAG_debug_code) {
983 // Check function data field is actually a BytecodeArray object. 984 // Check function data field is actually a BytecodeArray object.
984 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); 985 __ SmiTst(kInterpreterBytecodeArrayRegister, a4);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 // - Support profiler (specifically profiling_counter). 1023 // - Support profiler (specifically profiling_counter).
1023 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1024 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1024 // - Code aging of the BytecodeArray object. 1025 // - Code aging of the BytecodeArray object.
1025 1026
1026 // Load bytecode offset and dispatch table into registers. 1027 // Load bytecode offset and dispatch table into registers.
1027 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1028 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1028 __ Daddu(kInterpreterRegisterFileRegister, fp, 1029 __ Daddu(kInterpreterRegisterFileRegister, fp,
1029 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1030 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1030 __ li(kInterpreterBytecodeOffsetRegister, 1031 __ li(kInterpreterBytecodeOffsetRegister,
1031 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1032 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1032 __ li(kInterpreterDispatchTableRegister, 1033 __ lw(kInterpreterDispatchTableRegister,
1033 Operand(ExternalReference::interpreter_dispatch_table_address( 1034 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp));
1034 masm->isolate())));
1035 1035
1036 // Dispatch to the first bytecode handler for the function. 1036 // Dispatch to the first bytecode handler for the function.
1037 __ Daddu(a0, kInterpreterBytecodeArrayRegister, 1037 __ Daddu(a0, kInterpreterBytecodeArrayRegister,
1038 kInterpreterBytecodeOffsetRegister); 1038 kInterpreterBytecodeOffsetRegister);
1039 __ lbu(a0, MemOperand(a0)); 1039 __ lbu(a0, MemOperand(a0));
1040 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 1040 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
1041 __ ld(at, MemOperand(at)); 1041 __ ld(at, MemOperand(at));
1042 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1042 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1043 // and header removal. 1043 // and header removal.
1044 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 1044 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2756 } 2756 }
2757 } 2757 }
2758 2758
2759 2759
2760 #undef __ 2760 #undef __
2761 2761
2762 } // namespace internal 2762 } // namespace internal
2763 } // namespace v8 2763 } // namespace v8
2764 2764
2765 #endif // V8_TARGET_ARCH_MIPS64 2765 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698