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

Unified Diff: src/source-position-table.h

Issue 2860843003: Introduce a handlified version of source position iterator. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/source-position-table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/source-position-table.h
diff --git a/src/source-position-table.h b/src/source-position-table.h
index 756838d1e510b033e8f3f171a0c077bf31fecb23..c77c1ef26ec082f2511f9a206f63dae1bad32cb1 100644
--- a/src/source-position-table.h
+++ b/src/source-position-table.h
@@ -61,6 +61,16 @@ class V8_EXPORT_PRIVATE SourcePositionTableBuilder {
class V8_EXPORT_PRIVATE SourcePositionTableIterator {
public:
+ // We expose two flavours of the iterator, depending on the argument passed
+ // to the constructor:
+
+ // Handlified iterator allows allocation, but it needs a handle (and thus
+ // a handle scope). This is the preferred version.
+ explicit SourcePositionTableIterator(Handle<ByteArray> byte_array);
+
+ // Non-handlified iterator does not need a handle scope, but it disallows
+ // allocation during its lifetime. This is useful if there is no handle
+ // scope around.
explicit SourcePositionTableIterator(ByteArray* byte_array);
void Advance();
@@ -82,8 +92,9 @@ class V8_EXPORT_PRIVATE SourcePositionTableIterator {
private:
static const int kDone = -1;
- ByteArray* table_;
- int index_;
+ ByteArray* raw_table_ = nullptr;
+ Handle<ByteArray> table_;
+ int index_ = 0;
PositionTableEntry current_;
DisallowHeapAllocation no_gc;
};
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/source-position-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698