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

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

Issue 1671813003: [interpreter] move the dispatch table off heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix verify heap 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/isolate.cc ('k') | src/mips64/builtins-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1030 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1031 // - Allow simulator stop operations if FLAG_stop_at is set. 1031 // - Allow simulator stop operations if FLAG_stop_at is set.
1032 // - Code aging of the BytecodeArray object. 1032 // - Code aging of the BytecodeArray object.
1033 1033
1034 // Load bytecode offset and dispatch table into registers. 1034 // Load bytecode offset and dispatch table into registers.
1035 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1035 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1036 __ Addu(kInterpreterRegisterFileRegister, fp, 1036 __ Addu(kInterpreterRegisterFileRegister, fp,
1037 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1037 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1038 __ li(kInterpreterBytecodeOffsetRegister, 1038 __ li(kInterpreterBytecodeOffsetRegister,
1039 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1039 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1040 __ LoadRoot(kInterpreterDispatchTableRegister, 1040 __ li(kInterpreterDispatchTableRegister,
1041 Heap::kInterpreterTableRootIndex); 1041 Operand(ExternalReference::interpreter_dispatch_table_address(
1042 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 1042 masm->isolate())));
1043 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1044 1043
1045 // Dispatch to the first bytecode handler for the function. 1044 // Dispatch to the first bytecode handler for the function.
1046 __ Addu(a0, kInterpreterBytecodeArrayRegister, 1045 __ Addu(a0, kInterpreterBytecodeArrayRegister,
1047 kInterpreterBytecodeOffsetRegister); 1046 kInterpreterBytecodeOffsetRegister);
1048 __ lbu(a0, MemOperand(a0)); 1047 __ lbu(a0, MemOperand(a0));
1049 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 1048 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
1050 __ lw(at, MemOperand(at)); 1049 __ lw(at, MemOperand(at));
1051 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1050 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1052 // and header removal. 1051 // and header removal.
1053 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 1052 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 __ bind(&loop_check); 1133 __ bind(&loop_check);
1135 __ Branch(&loop_header, gt, a2, Operand(t0)); 1134 __ Branch(&loop_header, gt, a2, Operand(t0));
1136 1135
1137 // Call the constructor with a0, a1, and a3 unmodified. 1136 // Call the constructor with a0, a1, and a3 unmodified.
1138 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 1137 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
1139 } 1138 }
1140 1139
1141 1140
1142 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { 1141 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
1143 // Initialize register file register and dispatch table register. 1142 // Initialize register file register and dispatch table register.
1144 __ Addu(kInterpreterRegisterFileRegister, fp, 1143 __ li(kInterpreterDispatchTableRegister,
1145 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1144 Operand(ExternalReference::interpreter_dispatch_table_address(
1146 __ LoadRoot(kInterpreterDispatchTableRegister, 1145 masm->isolate())));
1147 Heap::kInterpreterTableRootIndex);
1148 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 1146 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
1149 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1147 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1150 1148
1151 // Get the context from the frame. 1149 // Get the context from the frame.
1152 __ lw(kContextRegister, 1150 __ lw(kContextRegister,
1153 MemOperand(kInterpreterRegisterFileRegister, 1151 MemOperand(kInterpreterRegisterFileRegister,
1154 InterpreterFrameConstants::kContextFromRegisterPointer)); 1152 InterpreterFrameConstants::kContextFromRegisterPointer));
1155 1153
1156 // Get the bytecode array pointer from the frame. 1154 // Get the bytecode array pointer from the frame.
1157 __ lw(a1, 1155 __ lw(a1,
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2766 } 2764 }
2767 } 2765 }
2768 2766
2769 2767
2770 #undef __ 2768 #undef __
2771 2769
2772 } // namespace internal 2770 } // namespace internal
2773 } // namespace v8 2771 } // namespace v8
2774 2772
2775 #endif // V8_TARGET_ARCH_MIPS 2773 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698