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

Unified Diff: src/interpreter/bytecode-array-reverse-iterator.h

Issue 2518003002: [ignition] Add a reverse bytecode iterator (Closed)
Patch Set: Make class final 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/bytecode-array-reverse-iterator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-reverse-iterator.h
diff --git a/src/interpreter/bytecode-array-reverse-iterator.h b/src/interpreter/bytecode-array-reverse-iterator.h
new file mode 100644
index 0000000000000000000000000000000000000000..42c9e7ce27ca23f9536af107e6fe0c6bbf79ddc7
--- /dev/null
+++ b/src/interpreter/bytecode-array-reverse-iterator.h
@@ -0,0 +1,39 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_INTERPRETER_BYTECODE_ARRAY_REVERSE_ITERATOR_H_
+#define V8_INTERPRETER_BYTECODE_ARRAY_REVERSE_ITERATOR_H_
+
+#include "src/interpreter/bytecode-array-accessor.h"
+#include "src/zone/zone-containers.h"
+#include "src/zone/zone.h"
+
+namespace v8 {
+namespace internal {
+namespace interpreter {
+
+class V8_EXPORT_PRIVATE BytecodeArrayReverseIterator final
+ : public BytecodeArrayAccessor {
+ public:
+ explicit BytecodeArrayReverseIterator(Handle<BytecodeArray> bytecode_array,
+ Zone* zone);
+
+ void Advance();
+ void Reset();
+ bool done() const;
+
+ private:
+ ZoneVector<int> offsets_;
+ ZoneVector<int>::const_reverse_iterator it_offsets_;
+
+ void UpdateOffsetFromIterator();
+
+ DISALLOW_COPY_AND_ASSIGN(BytecodeArrayReverseIterator);
+};
+
+} // namespace interpreter
+} // namespace internal
+} // namespace v8
+
+#endif // V8_INTERPRETER_BYTECODE_ARRAY_REVERSE_ITERATOR_H_
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/bytecode-array-reverse-iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698