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

Side by Side Diff: src/interpreter/interpreter-assembler.h

Issue 1783483002: [interpreter] Add support for scalable operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase onto 3c1dc424d3f2f651ad Created 4 years, 9 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ 5 #ifndef V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_
6 #define V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ 6 #define V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/smart-pointers.h" 9 #include "src/base/smart-pointers.h"
10 #include "src/builtins.h" 10 #include "src/builtins.h"
11 #include "src/compiler/code-stub-assembler.h" 11 #include "src/compiler/code-stub-assembler.h"
12 #include "src/frames.h" 12 #include "src/frames.h"
13 #include "src/interpreter/bytecodes.h" 13 #include "src/interpreter/bytecodes.h"
14 #include "src/runtime/runtime.h" 14 #include "src/runtime/runtime.h"
15 15
16 namespace v8 { 16 namespace v8 {
17 namespace internal { 17 namespace internal {
18 namespace interpreter { 18 namespace interpreter {
19 19
20 class InterpreterAssembler : public compiler::CodeStubAssembler { 20 class InterpreterAssembler : public compiler::CodeStubAssembler {
21 public: 21 public:
22 InterpreterAssembler(Isolate* isolate, Zone* zone, Bytecode bytecode); 22 InterpreterAssembler(Isolate* isolate, Zone* zone, Bytecode bytecode,
23 int operand_scale);
23 virtual ~InterpreterAssembler(); 24 virtual ~InterpreterAssembler();
24 25
25 // Returns the count immediate for bytecode operand |operand_index| in the 26 // Returns the count immediate for bytecode operand |operand_index| in the
26 // current bytecode. 27 // current bytecode.
27 compiler::Node* BytecodeOperandCount(int operand_index); 28 compiler::Node* BytecodeOperandCount(int operand_index);
29 // Returns the 8-bit flag for bytecode operand |operand_index| in the
30 // current bytecode.
31 compiler::Node* BytecodeOperandFlag(int operand_index);
28 // Returns the index immediate for bytecode operand |operand_index| in the 32 // Returns the index immediate for bytecode operand |operand_index| in the
29 // current bytecode. 33 // current bytecode.
30 compiler::Node* BytecodeOperandIdx(int operand_index); 34 compiler::Node* BytecodeOperandIdx(int operand_index);
31 // Returns the Imm8 immediate for bytecode operand |operand_index| in the 35 // Returns the Imm8 immediate for bytecode operand |operand_index| in the
32 // current bytecode. 36 // current bytecode.
33 compiler::Node* BytecodeOperandImm(int operand_index); 37 compiler::Node* BytecodeOperandImm(int operand_index);
34 // Returns the register index for bytecode operand |operand_index| in the 38 // Returns the register index for bytecode operand |operand_index| in the
35 // current bytecode. 39 // current bytecode.
36 compiler::Node* BytecodeOperandReg(int operand_index); 40 compiler::Node* BytecodeOperandReg(int operand_index);
41 // Returns the runtime id immediate for bytecode operand
42 // |operand_index| in the current bytecode.
43 compiler::Node* BytecodeOperandRuntimeId(int operand_index);
37 44
38 // Accumulator. 45 // Accumulator.
39 compiler::Node* GetAccumulator(); 46 compiler::Node* GetAccumulator();
40 void SetAccumulator(compiler::Node* value); 47 void SetAccumulator(compiler::Node* value);
41 48
42 // Context. 49 // Context.
43 compiler::Node* GetContext(); 50 compiler::Node* GetContext();
44 void SetContext(compiler::Node* value); 51 void SetContext(compiler::Node* value);
45 52
46 // Loads from and stores to the interpreter register file. 53 // Loads from and stores to the interpreter register file.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Dispatch to the bytecode. 136 // Dispatch to the bytecode.
130 void Dispatch(); 137 void Dispatch();
131 138
132 // Dispatch to bytecode handler. 139 // Dispatch to bytecode handler.
133 void DispatchToBytecodeHandler(compiler::Node* handler, 140 void DispatchToBytecodeHandler(compiler::Node* handler,
134 compiler::Node* bytecode_offset); 141 compiler::Node* bytecode_offset);
135 void DispatchToBytecodeHandler(compiler::Node* handler) { 142 void DispatchToBytecodeHandler(compiler::Node* handler) {
136 DispatchToBytecodeHandler(handler, BytecodeOffset()); 143 DispatchToBytecodeHandler(handler, BytecodeOffset());
137 } 144 }
138 145
146 // Dispatch bytecode as wide operand variant.
147 void RedispatchWide(int operand_scale);
148
139 // Abort with the given bailout reason. 149 // Abort with the given bailout reason.
140 void Abort(BailoutReason bailout_reason); 150 void Abort(BailoutReason bailout_reason);
141 151
142 protected: 152 protected:
143 static bool TargetSupportsUnalignedAccess(); 153 static bool TargetSupportsUnalignedAccess();
144 154
145 private: 155 private:
146 // Returns a raw pointer to start of the register file on the stack. 156 // Returns a raw pointer to start of the register file on the stack.
147 compiler::Node* RegisterFileRawPointer(); 157 compiler::Node* RegisterFileRawPointer();
148 // Returns a tagged pointer to the current function's BytecodeArray object. 158 // Returns a tagged pointer to the current function's BytecodeArray object.
(...skipping 11 matching lines...) Expand all
160 // Traces the current bytecode by calling |function_id|. 170 // Traces the current bytecode by calling |function_id|.
161 void TraceBytecode(Runtime::FunctionId function_id); 171 void TraceBytecode(Runtime::FunctionId function_id);
162 172
163 // Updates the bytecode array's interrupt budget by |weight| and calls 173 // Updates the bytecode array's interrupt budget by |weight| and calls
164 // Runtime::kInterrupt if counter reaches zero. 174 // Runtime::kInterrupt if counter reaches zero.
165 void UpdateInterruptBudget(compiler::Node* weight); 175 void UpdateInterruptBudget(compiler::Node* weight);
166 176
167 // Returns the offset of register |index| relative to RegisterFilePointer(). 177 // Returns the offset of register |index| relative to RegisterFilePointer().
168 compiler::Node* RegisterFrameOffset(compiler::Node* index); 178 compiler::Node* RegisterFrameOffset(compiler::Node* index);
169 179
170 compiler::Node* BytecodeOperand(int operand_index); 180 compiler::Node* BytecodeOperandUnsignedByte(int operand_index);
171 compiler::Node* BytecodeOperandSignExtended(int operand_index); 181 compiler::Node* BytecodeOperandSignedByte(int operand_index);
172 compiler::Node* BytecodeOperandShort(int operand_index); 182 compiler::Node* BytecodeOperandUnsignedShort(int operand_index);
173 compiler::Node* BytecodeOperandShortSignExtended(int operand_index); 183 compiler::Node* BytecodeOperandSignedShort(int operand_index);
184 compiler::Node* BytecodeOperandUnsignedQuad(int operand_index);
185 compiler::Node* BytecodeOperandSignedQuad(int operand_index);
186
187 compiler::Node* BytecodeSignedOperand(int operand_index,
188 OperandSize operand_size);
189 compiler::Node* BytecodeUnsignedOperand(int operand_index,
190 OperandSize operand_size);
174 191
175 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not 192 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not
176 // update BytecodeOffset() itself. 193 // update BytecodeOffset() itself.
177 compiler::Node* Advance(int delta); 194 compiler::Node* Advance(int delta);
178 compiler::Node* Advance(compiler::Node* delta); 195 compiler::Node* Advance(compiler::Node* delta);
179 196
180 // Starts next instruction dispatch at |new_bytecode_offset|. 197 // Starts next instruction dispatch at |new_bytecode_offset|.
181 void DispatchTo(compiler::Node* new_bytecode_offset); 198 void DispatchTo(compiler::Node* new_bytecode_offset);
182 199
183 // Abort operations for debug code. 200 // Abort operations for debug code.
184 void AbortIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs, 201 void AbortIfWordNotEqual(compiler::Node* lhs, compiler::Node* rhs,
185 BailoutReason bailout_reason); 202 BailoutReason bailout_reason);
186 203
204 int operand_scale() const { return operand_scale_; }
205
187 Bytecode bytecode_; 206 Bytecode bytecode_;
207 int operand_scale_;
188 CodeStubAssembler::Variable accumulator_; 208 CodeStubAssembler::Variable accumulator_;
189 CodeStubAssembler::Variable context_; 209 CodeStubAssembler::Variable context_;
190 CodeStubAssembler::Variable bytecode_array_; 210 CodeStubAssembler::Variable bytecode_array_;
191 211
192 bool disable_stack_check_across_call_; 212 bool disable_stack_check_across_call_;
193 compiler::Node* stack_pointer_before_call_; 213 compiler::Node* stack_pointer_before_call_;
194 214
195 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); 215 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler);
196 }; 216 };
197 217
198 } // namespace interpreter 218 } // namespace interpreter
199 } // namespace internal 219 } // namespace internal
200 } // namespace v8 220 } // namespace v8
201 221
202 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_ 222 #endif // V8_INTERPRETER_INTERPRETER_ASSEMBLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698