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

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

Issue 2519923002: [ignition] Refactor array iterator to separate out access (Closed)
Patch Set: Fix objects-inl.h include Created 4 years, 1 month 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 2016 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_ARRAY_ITERATOR_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_
6 #define V8_INTERPRETER_BYTECODE_ARRAY_ITERATOR_H_ 6 #define V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_
7 7
8 #include "src/globals.h" 8 #include "src/globals.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/interpreter/bytecode-register.h" 10 #include "src/interpreter/bytecode-register.h"
11 #include "src/interpreter/bytecodes.h" 11 #include "src/interpreter/bytecodes.h"
12 #include "src/objects.h" 12 #include "src/objects.h"
13 #include "src/runtime/runtime.h" 13 #include "src/runtime/runtime.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 namespace interpreter { 17 namespace interpreter {
18 18
19 class V8_EXPORT_PRIVATE BytecodeArrayIterator { 19 class V8_EXPORT_PRIVATE BytecodeArrayAccessor {
20 public: 20 public:
21 explicit BytecodeArrayIterator(Handle<BytecodeArray> bytecode_array); 21 BytecodeArrayAccessor(Handle<BytecodeArray> bytecode_array,
22 int initial_offset);
22 23
23 void Advance(); 24 void SetOffset(int offset);
24 bool done() const; 25 bool OffsetInBounds() const;
rmcilroy 2016/11/21 14:14:26 nit - make this private, and just OffsetIsValid()
Leszek Swirski 2016/11/21 16:49:03 yes to private, I want to keep OffsetInBounds thou
26
25 Bytecode current_bytecode() const; 27 Bytecode current_bytecode() const;
26 int current_bytecode_size() const; 28 int current_bytecode_size() const;
27 int current_offset() const { return bytecode_offset_; } 29 int current_offset() const { return bytecode_offset_; }
28 OperandScale current_operand_scale() const { return operand_scale_; } 30 OperandScale current_operand_scale() const { return operand_scale_; }
29 int current_prefix_offset() const { return prefix_offset_; } 31 int current_prefix_offset() const { return prefix_offset_; }
30 const Handle<BytecodeArray>& bytecode_array() const { 32 const Handle<BytecodeArray>& bytecode_array() const {
31 return bytecode_array_; 33 return bytecode_array_;
32 } 34 }
33 35
34 uint32_t GetFlagOperand(int operand_index) const; 36 uint32_t GetFlagOperand(int operand_index) const;
(...skipping 17 matching lines...) Expand all
52 OperandType operand_type) const; 54 OperandType operand_type) const;
53 int32_t GetSignedOperand(int operand_index, OperandType operand_type) const; 55 int32_t GetSignedOperand(int operand_index, OperandType operand_type) const;
54 56
55 void UpdateOperandScale(); 57 void UpdateOperandScale();
56 58
57 Handle<BytecodeArray> bytecode_array_; 59 Handle<BytecodeArray> bytecode_array_;
58 int bytecode_offset_; 60 int bytecode_offset_;
59 OperandScale operand_scale_; 61 OperandScale operand_scale_;
60 int prefix_offset_; 62 int prefix_offset_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator); 64 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayAccessor);
63 }; 65 };
64 66
65 } // namespace interpreter 67 } // namespace interpreter
66 } // namespace internal 68 } // namespace internal
67 } // namespace v8 69 } // namespace v8
68 70
69 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ITERATOR_H_ 71 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ACCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698