Definition at line 4567 of file api.cc.
◆ Utf8WriterVisitor()
v8::Utf8WriterVisitor::Utf8WriterVisitor |
( |
char * |
buffer, |
|
|
int |
capacity, |
|
|
bool |
skip_capacity_check, |
|
|
bool |
replace_invalid_utf8 |
|
) |
| |
|
inline |
Definition at line 4569 of file api.cc.
static const int kNoPreviousCharacter
bool const skip_capacity_check_
bool const replace_invalid_utf8_
◆ CompleteWrite()
int v8::Utf8WriterVisitor::CompleteWrite |
( |
bool |
write_null, |
|
|
int * |
utf16_chars_read_out |
|
) |
| |
|
inline |
Definition at line 4725 of file api.cc.
4727 if (utf16_chars_read_out !=
NULL) {
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
References NULL.
Referenced by v8::String::WriteUtf8().
◆ DISALLOW_IMPLICIT_CONSTRUCTORS()
◆ IsDone()
bool v8::Utf8WriterVisitor::IsDone |
( |
| ) |
|
|
inline |
◆ Visit()
template<typename Char >
void v8::Utf8WriterVisitor::Visit |
( |
const Char * |
chars, |
|
|
const int |
length |
|
) |
| |
|
inline |
Definition at line 4629 of file api.cc.
4632 if (length == 0)
return;
4635 int last_character =
4642 fast_length = length;
4644 int remaining_capacity =
capacity_ -
static_cast<int>(buffer -
start_);
4646 STATIC_ASSERT(Utf16::kMaxExtraUtf8BytesForOneUtf16CodeUnit == 3);
4647 int max_size_per_char =
sizeof(Char) == 1 ? 2 : 3;
4648 int writable_length =
4649 (remaining_capacity - max_size_per_char)/max_size_per_char;
4651 if (writable_length <= 0)
break;
4652 fast_length =
i + writable_length;
4653 if (fast_length > length) fast_length = length;
4656 if (
sizeof(Char) == 1) {
4657 for (;
i < fast_length;
i++) {
4659 Utf8::EncodeOneByte(buffer,
static_cast<uint8_t
>(*chars++));
4663 for (;
i < fast_length;
i++) {
4665 buffer += Utf8::Encode(buffer,
4669 last_character = character;
4674 if (fast_length == length) {
4684 int remaining_capacity =
capacity_ -
static_cast<int>(buffer -
start_);
4685 DCHECK(remaining_capacity >= 0);
4686 for (; i < length && remaining_capacity > 0;
i++) {
4704 remaining_capacity -= written;
4705 last_character = character;
static int WriteEndCharacter(uint16_t character, int last_character, int remaining, char *const buffer, bool replace_invalid_utf8)
#define DCHECK(condition)
#define STATIC_ASSERT(test)
References DCHECK, and STATIC_ASSERT.
◆ VisitOneByteString()
void v8::Utf8WriterVisitor::VisitOneByteString |
( |
const uint8_t * |
chars, |
|
|
int |
length |
|
) |
| |
|
inline |
Definition at line 4717 of file api.cc.
4718 Visit(chars, length);
void Visit(const Char *chars, const int length)
◆ VisitTwoByteString()
void v8::Utf8WriterVisitor::VisitTwoByteString |
( |
const uint16_t * |
chars, |
|
|
int |
length |
|
) |
| |
|
inline |
◆ WriteEndCharacter()
static int v8::Utf8WriterVisitor::WriteEndCharacter |
( |
uint16_t |
character, |
|
|
int |
last_character, |
|
|
int |
remaining, |
|
|
char *const |
buffer, |
|
|
bool |
replace_invalid_utf8 |
|
) |
| |
|
inlinestatic |
Definition at line 4584 of file api.cc.
4594 if (Utf16::IsSurrogatePair(last_character, character)) {
4595 int written = Utf8::Encode(buffer,
4598 replace_invalid_utf8);
4603 char temp_buffer[Utf8::kMaxEncodedSize];
4605 int written = Utf8::Encode(temp_buffer,
4607 Utf16::kNoPreviousCharacter,
4608 replace_invalid_utf8);
4610 if (written > remaining)
return 0;
4612 for (
int j = 0; j < written; j++) {
4613 buffer[j] = temp_buffer[j];
References DCHECK.
◆ buffer_
char* v8::Utf8WriterVisitor::buffer_ |
|
private |
◆ capacity_
int v8::Utf8WriterVisitor::capacity_ |
|
private |
◆ early_termination_
bool v8::Utf8WriterVisitor::early_termination_ |
|
private |
◆ last_character_
int v8::Utf8WriterVisitor::last_character_ |
|
private |
◆ replace_invalid_utf8_
bool const v8::Utf8WriterVisitor::replace_invalid_utf8_ |
|
private |
◆ skip_capacity_check_
bool const v8::Utf8WriterVisitor::skip_capacity_check_ |
|
private |
◆ start_
char* const v8::Utf8WriterVisitor::start_ |
|
private |
◆ utf16_chars_read_
int v8::Utf8WriterVisitor::utf16_chars_read_ |
|
private |
The documentation for this class was generated from the following file: