21 message_buffer_(
NULL),
34 FLAG_log_suspect =
true;
35 FLAG_log_handles =
true;
36 FLAG_log_regexp =
true;
37 FLAG_log_internal_timer_events =
true;
41 if (FLAG_prof) FLAG_log_code =
true;
93 Log::MessageBuilder::MessageBuilder(
Log* log)
95 lock_guard_(&log_->mutex_),
101 void Log::MessageBuilder::Append(
const char* format, ...) {
102 Vector<char> buf(log_->message_buffer_ + pos_,
105 va_start(args, format);
106 AppendVA(format, args);
112 void Log::MessageBuilder::AppendVA(
const char* format, va_list args) {
113 Vector<char> buf(log_->message_buffer_ + pos_,
127 void Log::MessageBuilder::Append(
const char c) {
129 log_->message_buffer_[pos_++] = c;
135 void Log::MessageBuilder::AppendDoubleQuotedString(
const char*
string) {
137 for (
const char* p =
string; *p !=
'\0'; p++) {
147 void Log::MessageBuilder::Append(String* str) {
149 int length = str->length();
150 for (
int i = 0;
i < length;
i++) {
151 Append(
static_cast<char>(str->Get(
i)));
156 void Log::MessageBuilder::AppendAddress(
Address addr) {
161 void Log::MessageBuilder::AppendSymbolName(
Symbol* symbol) {
164 if (!symbol->name()->IsUndefined()) {
166 AppendDetailed(String::cast(symbol->name()),
false);
169 Append(
"hash %x)", symbol->Hash());
173 void Log::MessageBuilder::AppendDetailed(String* str,
bool show_impl_info) {
174 if (str ==
NULL)
return;
176 int len = str->length();
179 if (show_impl_info) {
180 Append(str->IsOneByteRepresentation() ?
'a' :
'2');
181 if (StringShape(str).IsExternal())
183 if (StringShape(str).IsInternalized())
185 Append(
":%i:", str->length());
187 for (
int i = 0;
i < len;
i++) {
188 uc32 c = str->Get(
i);
190 Append(
"\\u%04x", c);
191 }
else if (c < 32 || c > 126) {
192 Append(
"\\x%02x", c);
193 }
else if (c ==
',') {
195 }
else if (c ==
'\\') {
197 }
else if (c ==
'\"') {
206 void Log::MessageBuilder::AppendStringPart(
const char* str,
int len) {
210 if (len == 0)
return;
212 Vector<char> buf(log_->message_buffer_ + pos_,
220 void Log::MessageBuilder::WriteToLogFile() {
223 DCHECK(pos_ == 0 || log_->message_buffer_[pos_ - 1] !=
'\n');
225 log_->message_buffer_[pos_++] =
'\n';
226 const int written = log_->WriteToFile(log_->message_buffer_, pos_);
227 if (written != pos_) {
229 log_->logger_->LogFailure();
static const char *const LogFileOpenMode
static FILE * OpenTemporaryFile()
static FILE * FOpen(const char *path, const char *mode)
void Initialize(const char *log_file_name)
static const int kMessageBufferSize
void OpenFile(const char *name)
static bool InitLogAtStart()
static const char *const kLogToTemporaryFile
static const char *const kLogToConsole
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 name
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)
IN DWORD64 OUT PDWORD64 OUT PIMAGEHLP_SYMBOL64 Symbol
void DeleteArray(T *array)
void StrNCpy(Vector< char > dest, const char *src, size_t n)
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
int VSNPrintF(Vector< char > str, const char *format, va_list args)
Debugger support for the V8 JavaScript engine.