Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: src/log.cc

Issue 8104: Regexp caching (Closed)
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index be76b96e1bdec0a1aadca616e9cadb7023923a7c..1b5e500d956db39454ed001b897e97a581ab91a4 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -377,14 +377,12 @@ void Logger::LogRegExpSource(Handle<JSRegExp> regexp) {
return;
}
- if (regexp->type()->IsSmi()) {
- switch (regexp->type_tag()) {
- case JSRegExp::ATOM:
- fprintf(logfile_, "a");
- break;
- default:
- break;
- }
+ switch (regexp->TypeTag()) {
+ case JSRegExp::ATOM:
Kasper Lund 2008/10/24 06:42:50 Fix switch indentation. The cases should be indent
+ fprintf(logfile_, "a");
+ break;
+ default:
+ break;
}
fprintf(logfile_, "/");
LogString(Handle<String>::cast(source));
@@ -409,14 +407,14 @@ void Logger::LogRegExpSource(Handle<JSRegExp> regexp) {
#endif // ENABLE_LOGGING_AND_PROFILING
-void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp) {
+void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
#ifdef ENABLE_LOGGING_AND_PROFILING
if (logfile_ == NULL || !FLAG_log_regexp) return;
ScopedLock sl(mutex_);
fprintf(logfile_, "regexp-compile,");
LogRegExpSource(regexp);
- fprintf(logfile_, "\n");
+ fprintf(logfile_, in_cache ? ",hit\n" : ",miss\n");
#endif
}

Powered by Google App Engine
This is Rietveld 408576698