31 DCHECK(
static_cast<size_t>(n) <= strlen(s));
38 for (
int i = 0;
i < count;
i++) {
48 number =
static_cast<uint32_t>(-value);
51 for (
uint32_t factor = 10; digits < 10; digits++, factor *= 10) {
52 if (factor > number)
break;
55 for (
int i = 1;
i <= digits;
i++) {
80 void PrintF(
const char* format, ...) {
82 va_start(arguments, format);
88 void PrintF(FILE* out,
const char* format, ...) {
90 va_start(arguments, format);
99 va_start(arguments, format);
107 va_start(args, format);
108 int result =
VSNPrintF(str, format, args);
133 bool keep_going =
true;
134 fprintf(stdout,
"%s", prompt);
137 if (fgets(line_buf,
sizeof(line_buf), stdin) ==
NULL) {
139 if (result !=
NULL) {
146 line_buf[len - 2] ==
'\\' &&
147 line_buf[len - 1] ==
'\n') {
150 line_buf[len - 2] =
'\n';
151 line_buf[len - 1] = 0;
153 }
else if ((len > 0) && (line_buf[len - 1] ==
'\n')) {
158 if (result ==
NULL) {
160 result = NewArray<char>(len + 1);
163 int new_len = offset + len + 1;
164 char* new_result = NewArray<char>(new_len);
176 result[offset] =
'\0';
185 const char* filename) {
197 char* result = NewArray<char>(*
size + extra_space);
198 for (
int i = 0;
i < *
size && feof(
file) == 0;) {
199 int read =
static_cast<int>(fread(&result[
i], 1, *
size -
i,
file));
200 if (read != (*
size -
i) && ferror(
file) != 0) {
224 return reinterpret_cast<byte*
>(chars);
261 while (total <
size) {
262 int write =
static_cast<int>(fwrite(str, 1,
size - total, f));
311 const char* str =
reinterpret_cast<const char*
>(bytes);
319 va_start(arguments, format);
336 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
337 static void MemMoveWrapper(
void* dest,
const void* src,
size_t size) {
338 memmove(dest, src,
size);
343 static MemMoveFunction memmove_function = &MemMoveWrapper;
346 MemMoveFunction CreateMemMoveFunction();
349 void MemMove(
void* dest,
const void* src,
size_t size) {
350 if (
size == 0)
return;
353 (*memmove_function)(dest, src,
size);
356 #elif V8_OS_POSIX && V8_HOST_ARCH_ARM
357 void MemCopyUint16Uint8Wrapper(
uint16_t* dest,
const uint8_t* src,
360 while (dest < limit) {
361 *dest++ =
static_cast<uint16_t>(*src++);
366 MemCopyUint8Function memcopy_uint8_function = &MemCopyUint8Wrapper;
367 MemCopyUint16Uint8Function memcopy_uint16_uint8_function =
368 &MemCopyUint16Uint8Wrapper;
370 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub);
371 MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
372 MemCopyUint16Uint8Function stub);
374 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
375 MemCopyUint8Function memcopy_uint8_function = &MemCopyUint8Wrapper;
377 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub);
382 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
383 MemMoveFunction generated_memmove = CreateMemMoveFunction();
384 if (generated_memmove !=
NULL) {
385 memmove_function = generated_memmove;
387 #elif V8_OS_POSIX && V8_HOST_ARCH_ARM
388 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper);
389 memcopy_uint16_uint8_function =
390 CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper);
391 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
392 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper);
399 #if __BYTE_ORDER == __LITTLE_ENDIAN
401 #elif __BYTE_ORDER == __BIG_ENDIAN
static void VPrint(const char *format, va_list args)
static FILE * FOpen(const char *path, const char *mode)
static int GetCurrentProcessId()
static void Print(const char *format,...)
static void StrNCpy(char *dest, int length, const char *src, size_t n)
static void PrintError(const char *format,...)
static void VFPrint(FILE *out, const char *format, va_list args)
static int VSNPrintF(char *str, int length, const char *format, va_list args)
void AddDecimalInteger(int value)
void AddPadding(char c, int count)
bool is_finalized() const
void AddCharacter(char c)
void AddSubstring(const char *s, int n)
SimpleStringBuilder(int size)
void AddString(const char *s)
void AddFormattedList(const char *format, va_list list)
void AddFormatted(const char *format,...)
static Vector< T > empty()
static Vector< T > New(int length)
enable harmony numeric enable harmony object literal extensions Optimize object size
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes A file to write the raw context snapshot bytes Write V8 startup blob file(mksnapshot only)") DEFINE_BOOL(profile_hydrogen_code_stub_compilation
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)
void DeleteArray(T *array)
char * ReadLine(const char *prompt)
void StrNCpy(Vector< char > dest, const char *src, size_t n)
void PrintPID(const char *format,...)
bool DoubleToBoolean(double d)
static Vector< const char > SetVectorContents(char *chars, int size, bool *exists)
int SNPrintF(Vector< char > str, const char *format,...)
void MemMove(void *dest, const void *src, size_t size)
int AppendChars(const char *filename, const char *str, int size, bool verbose)
int WriteChars(const char *filename, const char *str, int size, bool verbose)
void PrintF(const char *format,...)
int VSNPrintF(Vector< char > str, const char *format, va_list args)
char * ReadCharsFromFile(FILE *file, int *size, int extra_space, bool verbose, const char *filename)
byte * ReadBytes(const char *filename, int *size, bool verbose)
Vector< const char > ReadFile(const char *filename, bool *exists, bool verbose)
int WriteBytes(const char *filename, const byte *bytes, int size, bool verbose)
int StrLength(const char *string)
void MemCopy(void *dest, const void *src, size_t size)
int WriteCharsToFile(const char *str, int size, FILE *f)
void init_memcopy_functions()
Debugger support for the V8 JavaScript engine.
struct v8::internal::IeeeDoubleLittleEndianArchType::@15 bits