43 pushback_limit_(
NULL) {
124 unsigned start_position,
125 unsigned end_position)
127 length_(end_position) {
128 ASSERT(end_position >= start_position);
131 pos_ = start_position;
139 unsigned old_pos =
pos_;
142 return pos_ - old_pos;
148 if (from_pos >=
length_)
return 0;
149 if (from_pos + length >
length_) {
152 String::WriteToFlat<uc16>(*
string_,
buffer_, from_pos, from_pos + length);
163 raw_data_length_(length),
165 raw_character_position_(0) {
174 unsigned old_pos =
pos_;
175 unsigned target_pos =
pos_ + delta;
179 return pos_ - old_pos;
193 while (i < length - 1) {
203 if (c > kMaxUtf16Character) {
215 static const byte kUtf8MultiByteMask = 0xC0;
216 static const byte kUtf8MultiByteCharFollower = 0x80;
220 static const byte kUtf8MultiByteCharStart = 0xC0;
221 static bool IsUtf8MultiCharacterStart(
byte first_byte) {
222 return (first_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharStart;
227 static bool IsUtf8MultiCharacterFollower(
byte later_byte) {
228 return (later_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharFollower;
234 static inline void Utf8CharacterBack(
const byte* buffer,
unsigned* cursor) {
235 byte character = buffer[--*cursor];
237 ASSERT(IsUtf8MultiCharacterFollower(character));
241 while (IsUtf8MultiCharacterFollower(buffer[--*cursor])) { }
242 ASSERT(IsUtf8MultiCharacterStart(buffer[*cursor]));
249 static inline void Utf8CharacterForward(
const byte* buffer,
unsigned* cursor) {
250 byte character = buffer[(*cursor)++];
258 ASSERT(IsUtf8MultiCharacterStart(character));
264 unsigned additional_bytes =
265 ((0x3211u) >> (((character - 0xC0) >> 2) & 0xC)) & 0x03;
266 *cursor += additional_bytes;
267 ASSERT(!IsUtf8MultiCharacterFollower(buffer[1 + additional_bytes]));
319 raw_data_(data->GetTwoByteData(start_position)) {
320 buffer_cursor_ = raw_data_,
321 buffer_end_ = raw_data_ + (end_position - start_position);
322 pos_ = start_position;
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
const uint16_t * buffer_cursor_
virtual unsigned FillBuffer(unsigned position, unsigned length)=0
virtual ~Utf8ToUtf16CharacterStream()
unsigned raw_character_position_
virtual void SlowPushBack(uc16 character)
static const unsigned kBufferSize
static const uc32 kEndOfInput
static uint16_t TrailSurrogate(uint32_t char_code)
const uint16_t * buffer_end_
void SetRawPosition(unsigned char_position)
virtual ~BufferedUtf16CharacterStream()
#define ASSERT(condition)
static uchar CalculateValue(const byte *str, unsigned length, unsigned *cursor)
virtual unsigned SlowSeekForward(unsigned delta)
unsigned raw_data_length_
static uint16_t LeadSurrogate(uint32_t char_code)
virtual unsigned BufferSeekForward(unsigned delta)=0
Utf8ToUtf16CharacterStream(const byte *data, unsigned length)
GenericStringUtf16CharacterStream(Handle< String > data, unsigned start_position, unsigned end_position)
BufferedUtf16CharacterStream()
virtual ~GenericStringUtf16CharacterStream()
virtual ~ExternalTwoByteStringUtf16CharacterStream()
static const unsigned kMaxOneByteChar
ExternalTwoByteStringUtf16CharacterStream(Handle< ExternalTwoByteString > data, int start_position, int end_position)
uc16 buffer_[kBufferSize]
virtual unsigned BufferSeekForward(unsigned delta)
virtual unsigned FillBuffer(unsigned char_position, unsigned length)
virtual unsigned FillBuffer(unsigned position, unsigned length)
virtual unsigned BufferSeekForward(unsigned delta)
virtual void PushBack(uc32 character)
const uc16 * pushback_limit_