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

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: rebased Created 6 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/preparser.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-character-streams.h
diff --git a/src/scanner-character-streams.h b/src/scanner-character-streams.h
index 0d02f0201965923a7c19b1ff7d8bb8eefefa7d10..3b30fd438fbc9aba7fd2f941afac963cddb74e53 100644
--- a/src/scanner-character-streams.h
+++ b/src/scanner-character-streams.h
@@ -73,10 +73,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();
@@ -96,10 +97,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_
« no previous file with comments | « src/preparser.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698