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

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

Issue 214883002: Two-threaded parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: code review (svenpanne) Created 6 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 80ef9bd525e6f95b5f2ae06ca9997793f1ef9635..75253a3587f7cc42246fe11820e3cea7f85f69b3 100644
--- a/src/scanner-character-streams.h
+++ b/src/scanner-character-streams.h
@@ -96,10 +96,11 @@ class Utf8ToUtf16CharacterStream: public BufferedUtf16CharacterStream {
};
-// UTF16 buffer to read characters from an external string.
+// UTF16 buffer to read characters from an external two byte (UTF-16)
+// string. The caller is responsible for keeping the memory alive.
class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
public:
- ExternalTwoByteStringUtf16CharacterStream(Handle<ExternalTwoByteString> data,
+ ExternalTwoByteStringUtf16CharacterStream(const uint16_t* raw_data,
int start_position,
int end_position);
virtual ~ExternalTwoByteStringUtf16CharacterStream();
@@ -119,10 +120,29 @@ class ExternalTwoByteStringUtf16CharacterStream: public Utf16CharacterStream {
// Entire string is read at start.
return false;
}
- Handle<ExternalTwoByteString> source_;
const uc16* raw_data_; // Pointer to the actual array of characters.
};
+
+// UTF16 buffer to read characters from an external one byte (latin1)
+// string. Note that "ascii" in ExternalAsciiString is actually latin1. The
+// caller is responsible for keeping the memory alive.
+class ExternalOneByteStringUtf16CharacterStream
+ : public BufferedUtf16CharacterStream {
+ public:
+ ExternalOneByteStringUtf16CharacterStream(const uint8_t* raw_data,
+ int start_position,
+ int end_position);
+ virtual ~ExternalOneByteStringUtf16CharacterStream();
+
+ protected:
+ virtual unsigned BufferSeekForward(unsigned delta);
+ virtual unsigned FillBuffer(unsigned position, unsigned length);
+
+ const uint8_t* raw_data_; // Pointer to the actual array of characters.
+ unsigned length_;
+};
+
} } // namespace v8::internal
#endif // V8_SCANNER_CHARACTER_STREAMS_H_
« src/parser-thread.cc ('K') | « src/preparser.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698