OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_ITERATOR_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_ARRAY_ITERATOR_H_ |
| 7 |
| 8 #include "src/handles.h" |
| 9 #include "src/interpreter/bytecodes.h" |
| 10 #include "src/objects.h" |
| 11 |
| 12 namespace v8 { |
| 13 namespace internal { |
| 14 namespace interpreter { |
| 15 |
| 16 class BytecodeArrayIterator { |
| 17 public: |
| 18 explicit BytecodeArrayIterator(Handle<BytecodeArray> bytecode_array); |
| 19 |
| 20 void Advance(); |
| 21 bool done() const; |
| 22 Bytecode current_bytecode() const; |
| 23 const Handle<BytecodeArray>& bytecode_array() const { |
| 24 return bytecode_array_; |
| 25 } |
| 26 |
| 27 int8_t GetSmi8Operand(int operand_index) const; |
| 28 int GetIndexOperand(int operand_index) const; |
| 29 Register GetRegisterOperand(int operand_index) const; |
| 30 Handle<Object> GetConstantForIndexOperand(int operand_index) const; |
| 31 |
| 32 private: |
| 33 uint8_t GetOperand(int operand_index, OperandType operand_type) const; |
| 34 |
| 35 Handle<BytecodeArray> bytecode_array_; |
| 36 int bytecode_offset_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator); |
| 39 }; |
| 40 |
| 41 } // namespace interpreter |
| 42 } // namespace internal |
| 43 } // namespace v8 |
| 44 |
| 45 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ITERATOR_H_ |
OLD | NEW |