43 pushback_limit_(
NULL) {
122 unsigned start_position,
123 unsigned end_position)
125 length_(end_position) {
126 ASSERT(end_position >= start_position);
129 pos_ = start_position;
137 unsigned old_pos =
pos_;
140 return pos_ - old_pos;
146 if (from_pos >=
length_)
return 0;
147 if (from_pos + length >
length_) {
150 String::WriteToFlat<uc16>(*
string_,
buffer_, from_pos, from_pos + length);
161 raw_data_length_(length),
163 raw_character_position_(0) {
172 unsigned old_pos =
pos_;
173 unsigned target_pos =
pos_ + delta;
177 return pos_ - old_pos;
191 while (i < length - 1) {
201 if (c > kMaxUtf16Character) {
213 static const byte kUtf8MultiByteMask = 0xC0;
214 static const byte kUtf8MultiByteCharStart = 0xC0;
215 static const byte kUtf8MultiByteCharFollower = 0x80;
219 static bool IsUtf8MultiCharacterStart(
byte first_byte) {
220 return (first_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharStart;
225 static bool IsUtf8MultiCharacterFollower(
byte later_byte) {
226 return (later_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharFollower;
232 static inline void Utf8CharacterBack(
const byte* buffer,
unsigned* cursor) {
233 byte character = buffer[--*cursor];
235 ASSERT(IsUtf8MultiCharacterFollower(character));
239 while (IsUtf8MultiCharacterFollower(buffer[--*cursor])) { }
240 ASSERT(IsUtf8MultiCharacterStart(buffer[*cursor]));
247 static inline void Utf8CharacterForward(
const byte* buffer,
unsigned* cursor) {
248 byte character = buffer[(*cursor)++];
256 ASSERT(IsUtf8MultiCharacterStart(character));
262 unsigned additional_bytes =
263 ((0x3211u) >> (((character - 0xC0) >> 2) & 0xC)) & 0x03;
264 *cursor += additional_bytes;
265 ASSERT(!IsUtf8MultiCharacterFollower(buffer[1 + additional_bytes]));
317 raw_data_(data->GetTwoByteData(start_position)) {
318 buffer_cursor_ = raw_data_,
319 buffer_end_ = raw_data_ + (end_position - start_position);
320 pos_ = start_position;
static uchar TrailSurrogate(int char_code)
static uchar LeadSurrogate(int char_code)
virtual unsigned FillBuffer(unsigned position, unsigned length)=0
virtual ~Utf8ToUtf16CharacterStream()
const uc16 * buffer_cursor_
unsigned raw_character_position_
virtual void SlowPushBack(uc16 character)
static const unsigned kBufferSize
static const uc32 kEndOfInput
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_
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]
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
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_