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/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 uint32_t operand(int i) const { | 111 uint32_t operand(int i) const { |
112 DCHECK_LT(i, operand_count()); | 112 DCHECK_LT(i, operand_count()); |
113 return operands_[i]; | 113 return operands_[i]; |
114 } | 114 } |
115 uint32_t* operands() { return operands_; } | 115 uint32_t* operands() { return operands_; } |
116 const uint32_t* operands() const { return operands_; } | 116 const uint32_t* operands() const { return operands_; } |
117 | 117 |
118 int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); } | 118 int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); } |
119 OperandScale operand_scale() const { return operand_scale_; } | 119 OperandScale operand_scale() const { return operand_scale_; } |
| 120 void set_operand_scale(OperandScale operand_scale) { |
| 121 operand_scale_ = operand_scale; |
| 122 } |
120 | 123 |
121 const BytecodeSourceInfo& source_info() const { return source_info_; } | 124 const BytecodeSourceInfo& source_info() const { return source_info_; } |
122 BytecodeSourceInfo& source_info() { return source_info_; } | 125 BytecodeSourceInfo& source_info() { return source_info_; } |
123 | 126 |
124 bool operator==(const BytecodeNode& other) const; | 127 bool operator==(const BytecodeNode& other) const; |
125 bool operator!=(const BytecodeNode& other) const { return !(*this == other); } | 128 bool operator!=(const BytecodeNode& other) const { return !(*this == other); } |
126 | 129 |
127 private: | 130 private: |
128 static const int kInvalidPosition = kMinInt; | 131 static const int kInvalidPosition = kMinInt; |
129 static const size_t kMaxOperands = 4; | 132 static const size_t kMaxOperands = 4; |
130 | 133 |
131 Bytecode bytecode_; | 134 Bytecode bytecode_; |
132 uint32_t operands_[kMaxOperands]; | 135 uint32_t operands_[kMaxOperands]; |
133 OperandScale operand_scale_; | 136 OperandScale operand_scale_; |
134 BytecodeSourceInfo source_info_; | 137 BytecodeSourceInfo source_info_; |
135 }; | 138 }; |
136 | 139 |
137 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); | 140 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); |
138 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); | 141 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); |
139 | 142 |
140 } // namespace interpreter | 143 } // namespace interpreter |
141 } // namespace internal | 144 } // namespace internal |
142 } // namespace v8 | 145 } // namespace v8 |
143 | 146 |
144 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ | 147 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ |
OLD | NEW |