19 unsigned* src_pos,
unsigned src_length,
23 dest, length, src, src_pos, src_length);
26 unsigned to_fill = length;
27 if (to_fill > src_length - *src_pos) to_fill = src_length - *src_pos;
30 v8::internal::CopyChars<uint8_t, uint16_t>(dest, src + *src_pos, to_fill);
33 v8::internal::CopyChars<uint16_t, uint16_t>(
34 dest,
reinterpret_cast<const uint16_t*
>(src + *src_pos), to_fill);
48 pushback_limit_(
NULL) {
129 unsigned start_position,
130 unsigned end_position)
132 length_(end_position) {
133 DCHECK(end_position >= start_position);
134 pos_ = start_position;
142 unsigned old_pos =
pos_;
145 return pos_ - old_pos;
150 if (from_pos >=
length_)
return 0;
152 if (from_pos + length >
length_) {
155 String::WriteToFlat<uc16>(*
string_,
buffer_, from_pos, from_pos + length);
166 raw_data_length_(length),
168 raw_character_position_(0) {
179 unsigned src_length) {
185 while (
i < length - 1) {
186 if (*src_pos == src_length)
break;
189 *src_pos = *src_pos + 1;
194 if (c > kMaxUtf16Character) {
198 dest[
i++] =
static_cast<uc16>(c);
206 unsigned old_pos =
pos_;
207 unsigned target_pos =
pos_ + delta;
211 return pos_ - old_pos;
234 static const byte kUtf8MultiByteCharStart = 0xC0;
235 static bool IsUtf8MultiCharacterStart(
byte first_byte) {
249 byte character = buffer[--*cursor];
256 DCHECK(IsUtf8MultiCharacterStart(buffer[*cursor]));
264 byte character = buffer[(*cursor)++];
272 DCHECK(IsUtf8MultiCharacterStart(character));
278 unsigned additional_bytes =
279 ((0x3211u) >> (((character - 0xC0) >> 2) & 0xC)) & 0x03;
280 *cursor += additional_bytes;
322 unsigned data_in_buffer = 0;
357 return data_in_buffer;
362 unsigned new_offset = 0;
363 unsigned new_chars_in_buffer =
367 data_in_buffer += new_chars_in_buffer;
379 return data_in_buffer;
383 unsigned* data_in_buffer) {
399 unsigned new_offset = 0;
400 unsigned new_chars_in_buffer =
404 *data_in_buffer += new_chars_in_buffer;
445 raw_data_(data->GetTwoByteData(start_position)) {
446 buffer_cursor_ = raw_data_,
447 buffer_end_ = raw_data_ + (end_position - start_position);
448 pos_ = start_position;
static uint16_t LeadSurrogate(uint32_t char_code)
static uint16_t TrailSurrogate(uint32_t char_code)
static const unsigned kMaxOneByteChar
static uchar CalculateValue(const byte *str, unsigned length, unsigned *cursor)
virtual size_t GetMoreData(const uint8_t **src)=0
V8 calls this to request the next chunk of data from the embedder.
uc16 buffer_[kBufferSize]
virtual unsigned BufferSeekForward(unsigned delta)=0
virtual void SlowPushBack(uc16 character)
const uc16 * pushback_limit_
virtual ~BufferedUtf16CharacterStream()
virtual unsigned SlowSeekForward(unsigned delta)
static const unsigned kBufferSize
virtual unsigned FillBuffer(unsigned position)=0
virtual void PushBack(uc32 character)
BufferedUtf16CharacterStream()
uint8_t utf8_split_char_buffer_[4]
ScriptCompiler::ExternalSourceStream * source_stream_
const uint8_t * current_data_
unsigned current_data_offset_
v8::ScriptCompiler::StreamedSource::Encoding encoding_
unsigned utf8_split_char_buffer_length_
unsigned current_data_length_
virtual unsigned FillBuffer(unsigned position)
void HandleUtf8SplitCharacters(unsigned *data_in_buffer)
ExternalTwoByteStringUtf16CharacterStream(Handle< ExternalTwoByteString > data, int start_position, int end_position)
virtual ~ExternalTwoByteStringUtf16CharacterStream()
virtual unsigned BufferSeekForward(unsigned delta)
virtual ~GenericStringUtf16CharacterStream()
GenericStringUtf16CharacterStream(Handle< String > data, unsigned start_position, unsigned end_position)
virtual unsigned FillBuffer(unsigned position)
const uint16_t * buffer_end_
static const uc32 kEndOfInput
const uint16_t * buffer_cursor_
virtual unsigned FillBuffer(unsigned char_position)
Utf8ToUtf16CharacterStream(const byte *data, unsigned length)
virtual unsigned BufferSeekForward(unsigned delta)
unsigned raw_data_length_
static unsigned CopyChars(uint16_t *dest, unsigned length, const byte *src, unsigned *src_pos, unsigned src_length)
unsigned raw_character_position_
void SetRawPosition(unsigned char_position)
virtual ~Utf8ToUtf16CharacterStream()
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
unsigned CopyCharsHelper(uint16_t *dest, unsigned length, const uint8_t *src, unsigned *src_pos, unsigned src_length, ScriptCompiler::StreamedSource::Encoding encoding)
static const byte kUtf8MultiByteCharFollower
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
static const byte kUtf8MultiByteMask
static void Utf8CharacterBack(const byte *buffer, unsigned *cursor)
static bool IsUtf8MultiCharacterFollower(byte later_byte)
static void Utf8CharacterForward(const byte *buffer, unsigned *cursor)
Debugger support for the V8 JavaScript engine.