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

Side by Side Diff: src/interpreter/bytecode-array-iterator.h

Issue 1291693004: [Interpreter] Bytecode graph builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patch set 8. Created 5 years, 3 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
(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 ~BytecodeArrayIterator();
20
21 void Next();
22 bool More() const;
23
24 int8_t GetSmi8Operand(int operand_index) const;
25 int GetIndexOperand(int operand_index) const;
26 Register GetRegisterOperand(int operand_index) const;
27 Handle<Object> GetConstantForIndexOperand(int operand_index) const;
28
29 const Handle<BytecodeArray>& bytecode_array() const {
30 return bytecode_array_;
31 }
32
33 Bytecode current_bytecode() const;
34
35 private:
36 uint8_t GetOperand(int operand_index, OperandType operand_type) const;
37
38 void MarkOperandsUnused();
39 void CheckOperandsUsed() const;
40 void MarkOperandUsed(int operand_index) const;
41
42 Handle<BytecodeArray> bytecode_array_;
43 int bytecode_offset_;
44 #ifdef DEBUG
45 mutable int operands_used_;
46 #endif // DEBUG
47 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator);
48 };
49
50 } // namespace interpreter
51 } // namespace internal
52 } // namespace v8
53
54 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ITERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698