Commit 9598e6eb authored by machenbach's avatar machenbach Committed by Commit bot

Revert of [debugger] simplify fetching scripts for inspector. (patchset #6...

Revert of [debugger] simplify fetching scripts for inspector. (patchset #6 id:100001 of https://codereview.chromium.org/2465833002/ )

Reason for revert:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11118

Rule of thumb: As long as the tests have not migrated yet, you most certainly need a blink rebase whenever you change expectations.

Original issue's description:
> [debugger] simplify fetching scripts for inspector.
>
> The old code path is going to be removed with the debug context api.
>
> R=kozyatinskiy@chromium.org

TBR=kozyatinskiy@chromium.org,yangguo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2473273005
Cr-Commit-Position: refs/heads/master@{#40764}
parent 7294f110
......@@ -8949,18 +8949,13 @@ void DebugInterface::GetLoadedScripts(
PersistentValueVector<DebugInterface::Script>& scripts) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
{
i::DisallowHeapAllocation no_gc;
i::Script::Iterator iterator(isolate);
i::Script* script;
while ((script = iterator.Next())) {
if (script->type() != i::Script::TYPE_NORMAL) continue;
if (script->HasValidSource()) {
i::HandleScope handle_scope(isolate);
i::Handle<i::Script> script_handle(script, isolate);
scripts.Append(ToApiHandle<Script>(script_handle));
}
}
i::Handle<i::FixedArray> instances = isolate->debug()->GetLoadedScripts();
for (int i = 0; i < instances->length(); i++) {
i::Handle<i::Script> script =
i::Handle<i::Script>(i::Script::cast(instances->get(i)));
if (script->type() != i::Script::TYPE_NORMAL) continue;
scripts.Append(ToApiHandle<Script>(script));
}
}
......
......@@ -661,4 +661,4 @@ scriptParsed
startLine : 0
url :
}
Remove script references and re-enable debugger.
Run gc and then Debugger.enable()..
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose_gc
print("Checks that inspector correctly process compiled scripts");
......@@ -48,10 +49,9 @@ addScripts()
.then(() => Protocol.Debugger.enable())
.then(addScripts)
.then(() => Protocol.Debugger.disable())
.then(() => InspectorTest.log("Remove script references and re-enable debugger."))
.then(() => Protocol.Runtime.evaluate(
{ expression: "for (let i = 1; i < 20; ++i) eval(`foo${i} = undefined`);" }))
.then(() => Protocol.HeapProfiler.collectGarbage())
.then(() => InspectorTest.log("Run gc and then Debugger.enable().."))
.then(() => Protocol.Runtime.evaluate({ expression: "for (let i = 1; i < 20; ++i) eval(`foo${i} = undefined`); gc();" }))
.then(() => Protocol.Debugger.enable())
.then(InspectorTest.completeTest);
......
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