| Index: src/scanner-character-streams.cc
|
| diff --git a/src/scanner-character-streams.cc b/src/scanner-character-streams.cc
|
| index 8fbfe4ee968a70d69574e8a381dd9dbd270cf32c..6d6897d087d8c48128984f7b12bc9e566397f5aa 100644
|
| --- a/src/scanner-character-streams.cc
|
| +++ b/src/scanner-character-streams.cc
|
| @@ -284,17 +284,52 @@ ExternalTwoByteStringUtf16CharacterStream::
|
| ~ExternalTwoByteStringUtf16CharacterStream() { }
|
|
|
|
|
| -ExternalTwoByteStringUtf16CharacterStream
|
| - ::ExternalTwoByteStringUtf16CharacterStream(
|
| - Handle<ExternalTwoByteString> data,
|
| - int start_position,
|
| - int end_position)
|
| - : Utf16CharacterStream(),
|
| - source_(data),
|
| - raw_data_(data->GetTwoByteData(start_position)) {
|
| - buffer_cursor_ = raw_data_,
|
| +ExternalTwoByteStringUtf16CharacterStream::
|
| + ExternalTwoByteStringUtf16CharacterStream(const uint16_t* raw_data,
|
| + int start_position,
|
| + int end_position)
|
| + : Utf16CharacterStream(), raw_data_(raw_data + start_position) {
|
| + buffer_cursor_ = raw_data_;
|
| buffer_end_ = raw_data_ + (end_position - start_position);
|
| pos_ = start_position;
|
| }
|
|
|
| +
|
| +// ----------------------------------------------------------------------------
|
| +// ExternalOneByteStringUtf16CharacterStream
|
| +
|
| +ExternalOneByteStringUtf16CharacterStream::
|
| + ExternalOneByteStringUtf16CharacterStream(const uint8_t* raw_data,
|
| + int start_position,
|
| + int end_position)
|
| + : raw_data_(raw_data + start_position),
|
| + length_(end_position) {
|
| + pos_ = start_position;
|
| +}
|
| +
|
| +
|
| +ExternalOneByteStringUtf16CharacterStream::
|
| + ~ExternalOneByteStringUtf16CharacterStream() {}
|
| +
|
| +
|
| +unsigned ExternalOneByteStringUtf16CharacterStream::BufferSeekForward(
|
| + unsigned delta) {
|
| + unsigned old_pos = pos_;
|
| + pos_ = Min(pos_ + delta, length_);
|
| + ReadBlock();
|
| + return pos_ - old_pos;
|
| +}
|
| +
|
| +
|
| +unsigned ExternalOneByteStringUtf16CharacterStream::FillBuffer(
|
| + unsigned from_pos, unsigned length) {
|
| + if (from_pos >= length_) return 0;
|
| + if (from_pos + length > length_) {
|
| + length = length_ - from_pos;
|
| + }
|
| + CopyChars(buffer_, raw_data_ + from_pos, length);
|
| + return length;
|
| +}
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|