diff --git a/src/api.cc b/src/api.cc index cf3cda37fb..d094dbd55c 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1637,6 +1637,12 @@ Local 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); diff --git a/src/compiler.cc b/src/compiler.cc index 1427f623b8..6f5532ed16 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1257,19 +1257,20 @@ Handle Compiler::CompileScript( int column_offset, bool is_shared_cross_origin, Handle 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);