OLD | NEW |
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_BYTECODE_PIPELINE_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_PIPELINE_H_ |
6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_ | 6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_ |
7 | 7 |
8 #include "src/interpreter/bytecode-register-allocator.h" | 8 #include "src/interpreter/bytecode-register-allocator.h" |
9 #include "src/interpreter/bytecode-register.h" | 9 #include "src/interpreter/bytecode-register.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 BytecodeNode(Bytecode bytecode, uint32_t operand0); | 146 BytecodeNode(Bytecode bytecode, uint32_t operand0); |
147 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1); | 147 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1); |
148 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 148 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
149 uint32_t operand2); | 149 uint32_t operand2); |
150 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 150 BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
151 uint32_t operand2, uint32_t operand3); | 151 uint32_t operand2, uint32_t operand3); |
152 | 152 |
153 BytecodeNode(const BytecodeNode& other); | 153 BytecodeNode(const BytecodeNode& other); |
154 BytecodeNode& operator=(const BytecodeNode& other); | 154 BytecodeNode& operator=(const BytecodeNode& other); |
155 | 155 |
| 156 // Replace the bytecode of this node with |bytecode| and keep the operands. |
| 157 void replace_bytecode(Bytecode bytecode) { |
| 158 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode_), |
| 159 Bytecodes::NumberOfOperands(bytecode)); |
| 160 bytecode_ = bytecode; |
| 161 } |
156 void set_bytecode(Bytecode bytecode) { | 162 void set_bytecode(Bytecode bytecode) { |
157 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); | 163 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); |
158 bytecode_ = bytecode; | 164 bytecode_ = bytecode; |
159 } | 165 } |
160 void set_bytecode(Bytecode bytecode, uint32_t operand0) { | 166 void set_bytecode(Bytecode bytecode, uint32_t operand0) { |
161 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1); | 167 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1); |
162 bytecode_ = bytecode; | 168 bytecode_ = bytecode; |
163 operands_[0] = operand0; | 169 operands_[0] = operand0; |
164 } | 170 } |
165 void set_bytecode(Bytecode bytecode, uint32_t operand0, uint32_t operand1) { | 171 void set_bytecode(Bytecode bytecode, uint32_t operand0, uint32_t operand1) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 }; | 211 }; |
206 | 212 |
207 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); | 213 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); |
208 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); | 214 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); |
209 | 215 |
210 } // namespace interpreter | 216 } // namespace interpreter |
211 } // namespace internal | 217 } // namespace internal |
212 } // namespace v8 | 218 } // namespace v8 |
213 | 219 |
214 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ | 220 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ |
OLD | NEW |