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

Revert of [serializer/debugger] hide scripts in the snapshot from the...

Revert of [serializer/debugger] hide scripts in the snapshot from the debugger. (patchset #5 id:80001 of https://codereview.chromium.org/2826073004/ )

Reason for revert:
failure in the custom snapshot build: http://builders/V8%20Linux64%20-%20custom%20snapshot%20-%20debug/builds/14178

Original issue's description:
> [serializer/debugger] hide scripts in the snapshot from the debugger.
>
> R=jgruber@chromium.org
> BUG=v8:6274
>
> Review-Url: https://codereview.chromium.org/2826073004
> Cr-Commit-Position: refs/heads/master@{#44745}
> Committed: https://chromium.googlesource.com/v8/v8/+/215e668256a205aba7bacf2da8b68ddfc573d3dd

TBR=jgruber@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:6274

Review-Url: https://codereview.chromium.org/2831893002
Cr-Commit-Position: refs/heads/master@{#44747}
parent cc797ac0
......@@ -2059,13 +2059,13 @@ void Debug::OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id,
}
void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) {
if (!script->IsUserJavaScript() && script->type() != i::Script::TYPE_WASM) {
return;
}
// Attach the correct debug id to the script. The debug id is used by the
// inspector to filter scripts by native context.
script->set_context_data(isolate_->native_context()->debug_context_id());
if (ignore_events()) return;
if (!script->IsUserJavaScript() && script->type() != i::Script::TYPE_WASM) {
return;
}
if (!debug_delegate_) return;
SuppressDebug while_processing(this);
DebugScope debug_scope(this);
......
......@@ -73,10 +73,6 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
Address original_address = Foreign::cast(info->getter())->foreign_address();
Foreign::cast(info->js_getter())->set_foreign_address(original_address);
accessor_infos_.Add(info);
} else if (obj->IsScript() && Script::cast(obj)->IsUserJavaScript()) {
// Reset type for user scripts embedded in the start-up snapshot to hide
// them from the debugger.
Script::cast(obj)->set_type(Script::TYPE_EXTENSION);
}
// Object has not yet been serialized. Serialize it here.
......
......@@ -638,11 +638,6 @@ TEST(CustomSnapshotDataBlob1) {
CompileRun("f()")->Int32Value(isolate1->GetCurrentContext());
CHECK_EQ(42, result.FromJust());
CHECK(CompileRun("this.g")->IsUndefined());
v8::Local<v8::Value> f = CompileRun("f");
i::Handle<i::JSFunction> function =
i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*f));
// Being part of the snapshot hides a script from the debugger.
CHECK(!function->shared()->IsSubjectToDebugging());
}
isolate1->Dispose();
}
......
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