Commit b3852ab3 authored by yangguo's avatar yangguo Committed by Commit bot

Remove --log-regexp.

There is no user for this log entry, and a large part of regexp log
output has long been removed already.

R=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2422593003
Cr-Commit-Position: refs/heads/master@{#40316}
parent 97fe83c7
......@@ -1060,7 +1060,6 @@ DEFINE_BOOL(prof_cpp, false, "Like --prof, but ignore generated code.")
DEFINE_IMPLICATION(prof, prof_cpp)
DEFINE_BOOL(prof_browser_mode, true,
"Used with --prof, turns on browser-compatible mode for profiling.")
DEFINE_BOOL(log_regexp, false, "Log regular expression execution.")
DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.")
DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
......
......@@ -37,7 +37,6 @@ void Log::Initialize(const char* log_file_name) {
FLAG_log_gc = true;
FLAG_log_suspect = true;
FLAG_log_handles = true;
FLAG_log_regexp = true;
FLAG_log_internal_timer_events = true;
}
......
......@@ -30,8 +30,8 @@ class Log {
static bool InitLogAtStart() {
return FLAG_log || FLAG_log_api || FLAG_log_code || FLAG_log_gc ||
FLAG_log_handles || FLAG_log_suspect || FLAG_log_regexp ||
FLAG_ll_prof || FLAG_perf_basic_prof || FLAG_perf_prof ||
FLAG_log_handles || FLAG_log_suspect || FLAG_ll_prof ||
FLAG_perf_basic_prof || FLAG_perf_prof ||
FLAG_log_internal_timer_events || FLAG_prof_cpp;
}
......
......@@ -893,64 +893,6 @@ void Logger::LeaveExternal(Isolate* isolate) {
TIMER_EVENTS_LIST(V)
#undef V
namespace {
// Emits the source code of a regexp. Used by regexp events.
void LogRegExpSource(Handle<JSRegExp> regexp, Isolate* isolate,
Log::MessageBuilder* msg) {
// Prints "/" + re.source + "/" +
// (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"")
Handle<Object> source =
JSReceiver::GetProperty(isolate, regexp, "source").ToHandleChecked();
if (!source->IsString()) {
msg->Append("no source");
return;
}
switch (regexp->TypeTag()) {
case JSRegExp::ATOM:
msg->Append('a');
break;
default:
break;
}
msg->Append('/');
msg->AppendDetailed(*Handle<String>::cast(source), false);
msg->Append('/');
// global flag
Handle<Object> global =
JSReceiver::GetProperty(isolate, regexp, "global").ToHandleChecked();
if (global->IsTrue(isolate)) {
msg->Append('g');
}
// ignorecase flag
Handle<Object> ignorecase =
JSReceiver::GetProperty(isolate, regexp, "ignoreCase").ToHandleChecked();
if (ignorecase->IsTrue(isolate)) {
msg->Append('i');
}
// multiline flag
Handle<Object> multiline =
JSReceiver::GetProperty(isolate, regexp, "multiline").ToHandleChecked();
if (multiline->IsTrue(isolate)) {
msg->Append('m');
}
}
} // namespace
void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
if (!log_->IsEnabled() || !FLAG_log_regexp) return;
Log::MessageBuilder msg(log_);
msg.Append("regexp-compile,");
LogRegExpSource(regexp, isolate_, &msg);
msg.Append(in_cache ? ",hit" : ",miss");
msg.WriteToLogFile();
}
void Logger::ApiNamedPropertyAccess(const char* tag,
JSObject* holder,
Object* name) {
......
......@@ -218,11 +218,6 @@ class Logger : public CodeEventListener {
INLINE(static void CallEventLogger(Isolate* isolate, const char* name,
StartEnd se, bool expose_to_api));
// ==== Events logged by --log-regexp ====
// Regexp compilation and execution events.
void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache);
bool is_logging() {
return is_logging_;
}
......
......@@ -141,11 +141,7 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
MaybeHandle<FixedArray> maybe_cached =
compilation_cache->LookupRegExp(pattern, flags);
Handle<FixedArray> cached;
bool in_cache = maybe_cached.ToHandle(&cached);
LOG(isolate, RegExpCompileEvent(re, in_cache));
Handle<Object> result;
if (in_cache) {
if (maybe_cached.ToHandle(&cached)) {
re->set_data(*cached);
return re;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment