[snapshot] no longer disable code caching when debugging

This is no longer necessary since we removed the debug context.

R=jgruber@chromium.org

Bug: v8:5530
Change-Id: Ibb9df3a1f139ee076296faedb80204e7fcc23197
Reviewed-on: https://chromium-review.googlesource.com/1134746
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54521}
This commit is contained in:
Yang Guo 2018-07-12 09:40:05 +02:00 committed by Commit Bot
parent b819afeb4f
commit a4e0aee306
3 changed files with 9 additions and 5 deletions

View File

@ -1621,8 +1621,7 @@ MaybeHandle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
MaybeHandle<SharedFunctionInfo> maybe_result;
if (extension == nullptr) {
bool can_consume_code_cache =
compile_options == ScriptCompiler::kConsumeCodeCache &&
!isolate->debug()->is_active();
compile_options == ScriptCompiler::kConsumeCodeCache;
if (can_consume_code_cache) {
compile_timer.set_consuming_code_cache();
}
@ -1712,8 +1711,7 @@ MaybeHandle<JSFunction> Compiler::GetWrappedFunction(
MaybeHandle<SharedFunctionInfo> maybe_result;
bool can_consume_code_cache =
compile_options == ScriptCompiler::kConsumeCodeCache &&
!isolate->debug()->is_active();
compile_options == ScriptCompiler::kConsumeCodeCache;
if (can_consume_code_cache) {
compile_timer.set_consuming_code_cache();
// Then check cached code provided by embedder.

View File

@ -57,7 +57,6 @@ ScriptCompiler::CachedData* CodeSerializer::Serialize(
// TODO(7110): Enable serialization of Asm modules once the AsmWasmData is
// context independent.
if (script->ContainsAsmModule()) return nullptr;
if (isolate->debug()->is_active()) return nullptr;
isolate->heap()->read_only_space()->ClearStringPaddingIfNeeded();

View File

@ -1439,6 +1439,13 @@ void TestCodeSerializerOnePlusOneImpl() {
TEST(CodeSerializerOnePlusOne) { TestCodeSerializerOnePlusOneImpl(); }
TEST(CodeSerializerOnePlusOneWithDebugger) {
v8::HandleScope scope(CcTest::isolate());
static v8::debug::DebugDelegate dummy_delegate;
v8::debug::SetDebugDelegate(CcTest::isolate(), &dummy_delegate);
TestCodeSerializerOnePlusOneImpl();
}
TEST(CodeSerializerOnePlusOne1) {
FLAG_serialization_chunk_size = 1;
TestCodeSerializerOnePlusOneImpl();