Commit aa0664e5 authored by jochen's avatar jochen Committed by Commit bot

Disable generating of code cache if the debugger is loaded

BUG=440880
R=yangguo@chromium.org,dcarney@chromium.org,vogelheim@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/796823002

Cr-Commit-Position: refs/heads/master@{#25774}
parent 49baecc4
......@@ -1637,6 +1637,12 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
options = kConsumeParserCache;
}
// Don't try to produce any kind of cache when the debugger is loaded.
if (isolate->debug()->is_loaded() &&
(options == kProduceParserCache || options == kProduceCodeCache)) {
options = kNoCompileOptions;
}
i::ScriptData* script_data = NULL;
if (options == kConsumeParserCache || options == kConsumeCodeCache) {
DCHECK(source->cached_data);
......
......@@ -1257,19 +1257,20 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(
int column_offset, bool is_shared_cross_origin, Handle<Context> context,
v8::Extension* extension, ScriptData** cached_data,
ScriptCompiler::CompileOptions compile_options, NativesFlag natives) {
Isolate* isolate = source->GetIsolate();
if (compile_options == ScriptCompiler::kNoCompileOptions) {
cached_data = NULL;
} else if (compile_options == ScriptCompiler::kProduceParserCache ||
compile_options == ScriptCompiler::kProduceCodeCache) {
DCHECK(cached_data && !*cached_data);
DCHECK(extension == NULL);
DCHECK(!isolate->debug()->is_loaded());
} else {
DCHECK(compile_options == ScriptCompiler::kConsumeParserCache ||
compile_options == ScriptCompiler::kConsumeCodeCache);
DCHECK(cached_data && *cached_data);
DCHECK(extension == NULL);
}
Isolate* isolate = source->GetIsolate();
int source_length = source->length();
isolate->counters()->total_load_size()->Increment(source_length);
isolate->counters()->total_compile_size()->Increment(source_length);
......
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