OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 unsigned start, | 339 unsigned start, |
340 unsigned end) { | 340 unsigned end) { |
341 #ifdef ENABLE_LOGGING_AND_PROFILING | 341 #ifdef ENABLE_LOGGING_AND_PROFILING |
342 if (logfile_ == NULL || !FLAG_prof) return; | 342 if (logfile_ == NULL || !FLAG_prof) return; |
343 ScopedLock sl(mutex_); | 343 ScopedLock sl(mutex_); |
344 fprintf(logfile_, "shared-library,\"%ls\",0x%08x,0x%08x\n", library_path, | 344 fprintf(logfile_, "shared-library,\"%ls\",0x%08x,0x%08x\n", library_path, |
345 start, end); | 345 start, end); |
346 #endif | 346 #endif |
347 } | 347 } |
348 | 348 |
| 349 |
| 350 #ifdef ENABLE_LOGGING_AND_PROFILING |
349 void Logger::LogRegExpSource(Handle<JSValue> regexp) { | 351 void Logger::LogRegExpSource(Handle<JSValue> regexp) { |
350 // Prints "/" + re.source + "/" + | 352 // Prints "/" + re.source + "/" + |
351 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") | 353 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") |
352 | 354 |
353 Handle<Object> source = GetProperty(regexp, "source"); | 355 Handle<Object> source = GetProperty(regexp, "source"); |
354 if (!source->IsString()) { | 356 if (!source->IsString()) { |
355 fprintf(logfile_, "no source"); | 357 fprintf(logfile_, "no source"); |
356 return; | 358 return; |
357 } | 359 } |
358 Handle<String> source_string = Handle<String>::cast(source); | 360 Handle<String> source_string = Handle<String>::cast(source); |
(...skipping 21 matching lines...) Expand all Loading... |
380 Handle<Object> ignorecase = GetProperty(regexp, "ignoreCase"); | 382 Handle<Object> ignorecase = GetProperty(regexp, "ignoreCase"); |
381 if (ignorecase->IsTrue()) { | 383 if (ignorecase->IsTrue()) { |
382 fprintf(logfile_, "i"); | 384 fprintf(logfile_, "i"); |
383 } | 385 } |
384 // multiline flag | 386 // multiline flag |
385 Handle<Object> multiline = GetProperty(regexp, "multiline"); | 387 Handle<Object> multiline = GetProperty(regexp, "multiline"); |
386 if (multiline->IsTrue()) { | 388 if (multiline->IsTrue()) { |
387 fprintf(logfile_, "m"); | 389 fprintf(logfile_, "m"); |
388 } | 390 } |
389 } | 391 } |
| 392 #endif // ENABLE_LOGGING_AND_PROFILING |
390 | 393 |
391 | 394 |
392 void Logger::RegExpCompileEvent(Handle<JSValue> regexp) { | 395 void Logger::RegExpCompileEvent(Handle<JSValue> regexp) { |
393 #ifdef ENABLE_LOGGING_AND_PROFILING | 396 #ifdef ENABLE_LOGGING_AND_PROFILING |
394 if (logfile_ == NULL || !FLAG_log_regexp) return; | 397 if (logfile_ == NULL || !FLAG_log_regexp) return; |
395 ScopedLock sl(mutex_); | 398 ScopedLock sl(mutex_); |
396 | 399 |
397 fprintf(logfile_, "regexp-compile,"); | 400 fprintf(logfile_, "regexp-compile,"); |
398 LogRegExpSource(regexp); | 401 LogRegExpSource(regexp); |
399 fprintf(logfile_, "\n"); | 402 fprintf(logfile_, "\n"); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 if (FLAG_log_state_changes) { | 791 if (FLAG_log_state_changes) { |
789 LOG(StringEvent("Leaving", StateToString(state_))); | 792 LOG(StringEvent("Leaving", StateToString(state_))); |
790 if (previous_) { | 793 if (previous_) { |
791 LOG(StringEvent("To", StateToString(previous_->state_))); | 794 LOG(StringEvent("To", StateToString(previous_->state_))); |
792 } | 795 } |
793 } | 796 } |
794 } | 797 } |
795 #endif | 798 #endif |
796 | 799 |
797 } } // namespace v8::internal | 800 } } // namespace v8::internal |
OLD | NEW |