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

Unified Diff: src/objects.h

Issue 11231: Flat string reader (Closed)
Patch Set: Created 12 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 8b1cb2c8a3b2139eec7dbab54fc5d8b55da2b30e..75100bd51f9470063b831c99b7937fea1a9fadf3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3590,6 +3590,25 @@ class ExternalTwoByteString: public ExternalString {
};
+class FlatStringReader {
+public:
+ explicit FlatStringReader(Handle<String> str);
Erik Corry 2008/11/19 09:45:38 FlatStringReaders can only be stack allocated, rig
+ explicit FlatStringReader(Vector<const char> input);
+ ~FlatStringReader();
+ void RefreshState();
+ inline uc32 Get(int index);
+ int length() { return length_; }
+ static void PostGarbageCollectionProcessing();
+private:
+ String** str_;
+ bool is_ascii_;
+ int length_;
+ const void* start_;
+ FlatStringReader* prev_;
+ static FlatStringReader* top_;
+};
+
+
// Note that StringInputBuffers are not valid across a GC! To fix this
// it would have to store a String Handle instead of a String* and
// AsciiStringReadBlock would have to be modified to use memcpy.

Powered by Google App Engine
This is Rietveld 408576698