From 9d3557ef999b25e6520ec33252e07594fa3a661b Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Thu, 11 Sep 2008 12:57:27 +0000 Subject: [PATCH] Formatting fixes (e.g., whitespace at end of line) Added in-file documentation for --log-regexp switch. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@278 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/log.cc | 7 ++++--- src/log.h | 12 ++++++++---- src/objects.h | 3 ++- src/smart-pointer.h | 6 +++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/log.cc b/src/log.cc index a7bb406..a9600d6 100644 --- a/src/log.cc +++ b/src/log.cc @@ -371,7 +371,7 @@ void Logger::SharedLibraryEvent(const wchar_t* library_path, } void Logger::LogRegExpSource(Handle regexp) { - // Prints "/" + re.source + "/" + + // Prints "/" + re.source + "/" + // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") Handle source = GetProperty(regexp, "source"); @@ -427,14 +427,15 @@ void Logger::RegExpCompileEvent(Handle regexp) { void Logger::RegExpExecEvent(Handle regexp, int start_index, - Handle string) { + Handle input_string) { #ifdef ENABLE_LOGGING_AND_PROFILING if (logfile_ == NULL || !FLAG_log_regexp) return; ScopedLock sl(mutex_); fprintf(logfile_, "regexp-run,"); LogRegExpSource(regexp); - fprintf(logfile_, ",0x%08x,%d..%d\n", string->Hash(), start_index, string->length()); + fprintf(logfile_, ",0x%08x,%d..%d\n", + input_string->Hash(), start_index, input_string->length()); #endif } diff --git a/src/log.h b/src/log.h index 569abf5..e481447 100644 --- a/src/log.h +++ b/src/log.h @@ -40,7 +40,7 @@ namespace v8 { namespace internal { // // --log-all // Log all events to the file, default is off. This is the same as combining -// --log-api, --log-code, and --log-gc. +// --log-api, --log-code, --log-gc, and --log-regexp. // // --log-api // Log API events to the logfile, default is off. --log-api implies --log. @@ -53,6 +53,10 @@ namespace v8 { namespace internal { // Log GC heap samples after each GC that can be processed by hp2ps, default // is off. --log-gc implies --log. // +// --log-regexp +// Log creation and use of regular expressions, Default is off. +// --log-regexp implies --log. +// // --logfile // Specify the name of the logfile, default is "v8.log". // @@ -179,9 +183,9 @@ class Logger { static void RegExpCompileEvent(Handle regexp); - static void RegExpExecEvent(Handle regexp, - int start_index, - Handle string); + static void RegExpExecEvent(Handle regexp, + int start_index, + Handle input_string); #ifdef ENABLE_LOGGING_AND_PROFILING static StateTag state() { diff --git a/src/objects.h b/src/objects.h index fc7256e..69e1d50 100644 --- a/src/objects.h +++ b/src/objects.h @@ -2861,7 +2861,8 @@ class String: public HeapObject { // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it // handles unexpected data without causing assert failures and it does not // do any heap allocations. This is useful when printing stack traces. - SmartPointer ToWideCString(RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL); + SmartPointer ToWideCString( + RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL); // Tells whether the hash code has been computed. inline bool HasHashCode(); diff --git a/src/smart-pointer.h b/src/smart-pointer.h index 4ae0524..03fd229 100644 --- a/src/smart-pointer.h +++ b/src/smart-pointer.h @@ -37,7 +37,7 @@ template class SmartPointer { public: - // Default constructor. Construct an empty scoped pointer. + // Default constructor. Construct an empty scoped pointer. inline SmartPointer() : p(NULL) {} @@ -86,8 +86,8 @@ class SmartPointer { // the copy constructor it removes the pointer in the original to avoid // double freeing. inline SmartPointer& operator=(const SmartPointer& rhs) { - ASSERT(p == NULL); - T* tmp = rhs.p; // swap to handle self-assignment + ASSERT(p == NULL); + T* tmp = rhs.p; // swap to handle self-assignment const_cast&>(rhs).p = NULL; p = tmp; return *this; -- 2.7.4