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

Unified Diff: src/scanner-character-streams.h

Issue 1102523003: Implement a 'trial parse' step, that will abort pre-parsing excessively (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comments + naming. (Marja's feedback.) Created 5 years, 8 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
Index: src/scanner-character-streams.h
diff --git a/src/scanner-character-streams.h b/src/scanner-character-streams.h
index 5944d7644572320f33498082ca362d0cdb2df564..79ee0425d9a39318eb67fc68409410e25f39117b 100644
--- a/src/scanner-character-streams.h
+++ b/src/scanner-character-streams.h
@@ -43,12 +43,16 @@ class GenericStringUtf16CharacterStream: public BufferedUtf16CharacterStream {
size_t end_position);
virtual ~GenericStringUtf16CharacterStream();
+ virtual bool SetBookmark();
+ virtual void ResetToBookmark();
+
protected:
virtual size_t BufferSeekForward(size_t delta);
virtual size_t FillBuffer(size_t position);
Handle<String> string_;
size_t length_;
+ size_t bookmark_;
};
@@ -129,6 +133,9 @@ class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
pos_--;
}
+ virtual bool SetBookmark();
+ virtual void ResetToBookmark();
+
protected:
virtual size_t SlowSeekForward(size_t delta) {
// Fast case always handles seeking.
@@ -140,6 +147,11 @@ class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
}
Handle<ExternalTwoByteString> source_;
const uc16* raw_data_; // Pointer to the actual array of characters.
+
+ private:
+ static const size_t kNoBookmark = -1;
+
+ size_t bookmark_;
};
} } // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698