V8 Project
unibrow::Utf8Decoder< kBufferSize > Class Template Reference

#include <unicode.h>

+ Inheritance diagram for unibrow::Utf8Decoder< kBufferSize >:
+ Collaboration diagram for unibrow::Utf8Decoder< kBufferSize >:

Public Member Functions

 Utf8Decoder ()
 
 Utf8Decoder (const char *stream, unsigned length)
 
void Reset (const char *stream, unsigned length)
 
unsigned WriteUtf16 (uint16_t *data, unsigned length) const
 
- Public Member Functions inherited from unibrow::Utf8DecoderBase
 Utf8DecoderBase ()
 
 Utf8DecoderBase (uint16_t *buffer, unsigned buffer_length, const uint8_t *stream, unsigned stream_length)
 
unsigned Utf16Length () const
 

Private Attributes

uint16_t buffer_ [kBufferSize]
 

Additional Inherited Members

- Protected Member Functions inherited from unibrow::Utf8DecoderBase
void Reset (uint16_t *buffer, unsigned buffer_length, const uint8_t *stream, unsigned stream_length)
 
- Static Protected Member Functions inherited from unibrow::Utf8DecoderBase
static void WriteUtf16Slow (const uint8_t *stream, uint16_t *data, unsigned length)
 
- Protected Attributes inherited from unibrow::Utf8DecoderBase
const uint8_t * unbuffered_start_
 
unsigned utf16_length_
 
bool last_byte_of_buffer_unused_
 

Detailed Description

template<unsigned kBufferSize>
class unibrow::Utf8Decoder< kBufferSize >

Definition at line 186 of file unicode.h.

Constructor & Destructor Documentation

◆ Utf8Decoder() [1/2]

template<unsigned kBufferSize>
unibrow::Utf8Decoder< kBufferSize >::Utf8Decoder ( )
inline

Definition at line 188 of file unicode.h.

188 {}

◆ Utf8Decoder() [2/2]

template<unsigned kBufferSize>
unibrow::Utf8Decoder< kBufferSize >::Utf8Decoder ( const char *  stream,
unsigned  length 
)
inline

Definition at line 169 of file unicode-inl.h.

171  kBufferSize,
172  reinterpret_cast<const uint8_t*>(stream),
173  length) {
174 }
uint16_t buffer_[kBufferSize]
Definition: unicode.h:193

Member Function Documentation

◆ Reset()

template<unsigned kBufferSize>
void unibrow::Utf8Decoder< kBufferSize >::Reset ( const char *  stream,
unsigned  length 
)
inline

Definition at line 177 of file unicode-inl.h.

177  {
179  kBufferSize,
180  reinterpret_cast<const uint8_t*>(stream),
181  length);
182 }
void Reset(uint16_t *buffer, unsigned buffer_length, const uint8_t *stream, unsigned stream_length)
Definition: unicode.cc:261

References v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, and unibrow::Utf8DecoderBase::Reset().

+ Here is the call graph for this function:

◆ WriteUtf16()

template<unsigned kBufferSize>
unsigned unibrow::Utf8Decoder< kBufferSize >::WriteUtf16 ( uint16_t data,
unsigned  length 
) const
inline

Definition at line 185 of file unicode-inl.h.

186  {
187  DCHECK(length > 0);
188  if (length > utf16_length_) length = utf16_length_;
189  // memcpy everything in buffer.
190  unsigned buffer_length =
192  unsigned memcpy_length = length <= buffer_length ? length : buffer_length;
193  v8::internal::MemCopy(data, buffer_, memcpy_length * sizeof(uint16_t));
194  if (length <= buffer_length) return length;
196  // Copy the rest the slow way.
198  data + buffer_length,
199  length - buffer_length);
200  return length;
201 }
bool last_byte_of_buffer_unused_
Definition: unicode.h:180
const uint8_t * unbuffered_start_
Definition: unicode.h:178
static void WriteUtf16Slow(const uint8_t *stream, uint16_t *data, unsigned length)
Definition: unicode.cc:308
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)
Definition: logging.h:205
unsigned short uint16_t
Definition: unicode.cc:23
void MemCopy(void *dest, const void *src, size_t size)
Definition: utils.h:350

References DCHECK, v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, v8::internal::MemCopy(), and NULL.

+ Here is the call graph for this function:

Member Data Documentation

◆ buffer_

template<unsigned kBufferSize>
uint16_t unibrow::Utf8Decoder< kBufferSize >::buffer_[kBufferSize]
private

Definition at line 193 of file unicode.h.


The documentation for this class was generated from the following files: