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}
This commit is contained in:
parent
49baecc42b
commit
aa0664e58f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user