| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_SCANNER_CHARACTER_STREAMS_H_ | 5 #ifndef V8_SCANNER_CHARACTER_STREAMS_H_ |
| 6 #define V8_SCANNER_CHARACTER_STREAMS_H_ | 6 #define V8_SCANNER_CHARACTER_STREAMS_H_ |
| 7 | 7 |
| 8 #include "src/scanner.h" | 8 #include "src/scanner.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 v8::ScriptCompiler::StreamedSource::Encoding encoding) | 83 v8::ScriptCompiler::StreamedSource::Encoding encoding) |
| 84 : source_stream_(source_stream), | 84 : source_stream_(source_stream), |
| 85 encoding_(encoding), | 85 encoding_(encoding), |
| 86 current_data_(NULL), | 86 current_data_(NULL), |
| 87 current_data_offset_(0), | 87 current_data_offset_(0), |
| 88 current_data_length_(0), | 88 current_data_length_(0), |
| 89 utf8_split_char_buffer_length_(0) {} | 89 utf8_split_char_buffer_length_(0) {} |
| 90 | 90 |
| 91 virtual ~ExternalStreamingStream() { delete[] current_data_; } | 91 virtual ~ExternalStreamingStream() { delete[] current_data_; } |
| 92 | 92 |
| 93 size_t BufferSeekForward(size_t delta) OVERRIDE { | 93 size_t BufferSeekForward(size_t delta) override { |
| 94 // We never need to seek forward when streaming scripts. We only seek | 94 // We never need to seek forward when streaming scripts. We only seek |
| 95 // forward when we want to parse a function whose location we already know, | 95 // forward when we want to parse a function whose location we already know, |
| 96 // and when streaming, we don't know the locations of anything we haven't | 96 // and when streaming, we don't know the locations of anything we haven't |
| 97 // seen yet. | 97 // seen yet. |
| 98 UNREACHABLE(); | 98 UNREACHABLE(); |
| 99 return 0; | 99 return 0; |
| 100 } | 100 } |
| 101 | 101 |
| 102 size_t FillBuffer(size_t position) OVERRIDE; | 102 size_t FillBuffer(size_t position) override; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 void HandleUtf8SplitCharacters(size_t* data_in_buffer); | 105 void HandleUtf8SplitCharacters(size_t* data_in_buffer); |
| 106 | 106 |
| 107 ScriptCompiler::ExternalSourceStream* source_stream_; | 107 ScriptCompiler::ExternalSourceStream* source_stream_; |
| 108 v8::ScriptCompiler::StreamedSource::Encoding encoding_; | 108 v8::ScriptCompiler::StreamedSource::Encoding encoding_; |
| 109 const uint8_t* current_data_; | 109 const uint8_t* current_data_; |
| 110 size_t current_data_offset_; | 110 size_t current_data_offset_; |
| 111 size_t current_data_length_; | 111 size_t current_data_length_; |
| 112 // For converting UTF-8 characters which are split across two data chunks. | 112 // For converting UTF-8 characters which are split across two data chunks. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 138 // Entire string is read at start. | 138 // Entire string is read at start. |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 Handle<ExternalTwoByteString> source_; | 141 Handle<ExternalTwoByteString> source_; |
| 142 const uc16* raw_data_; // Pointer to the actual array of characters. | 142 const uc16* raw_data_; // Pointer to the actual array of characters. |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } } // namespace v8::internal | 145 } } // namespace v8::internal |
| 146 | 146 |
| 147 #endif // V8_SCANNER_CHARACTER_STREAMS_H_ | 147 #endif // V8_SCANNER_CHARACTER_STREAMS_H_ |
| OLD | NEW |