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( ...@@ -8949,18 +8949,13 @@ void DebugInterface::GetLoadedScripts(
PersistentValueVector<DebugInterface::Script>& scripts) { PersistentValueVector<DebugInterface::Script>& scripts) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_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::HandleScope handle_scope(isolate);
i::Handle<i::Script> script_handle(script, isolate); i::Handle<i::FixedArray> instances = isolate->debug()->GetLoadedScripts();
scripts.Append(ToApiHandle<Script>(script_handle)); 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 ...@@ -661,4 +661,4 @@ scriptParsed
startLine : 0 startLine : 0
url : url :
} }
Remove script references and re-enable debugger. Run gc and then Debugger.enable()..
// Copyright 2016 the V8 project authors. All rights reserved. // Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --expose_gc
print("Checks that inspector correctly process compiled scripts"); print("Checks that inspector correctly process compiled scripts");
...@@ -48,10 +49,9 @@ addScripts() ...@@ -48,10 +49,9 @@ addScripts()
.then(() => Protocol.Debugger.enable()) .then(() => Protocol.Debugger.enable())
.then(addScripts) .then(addScripts)
.then(() => Protocol.Debugger.disable()) .then(() => Protocol.Debugger.disable())
.then(() => InspectorTest.log("Remove script references and re-enable debugger."))
.then(() => Protocol.Runtime.evaluate( .then(() => InspectorTest.log("Run gc and then Debugger.enable().."))
{ expression: "for (let i = 1; i < 20; ++i) eval(`foo${i} = undefined`);" })) .then(() => Protocol.Runtime.evaluate({ expression: "for (let i = 1; i < 20; ++i) eval(`foo${i} = undefined`); gc();" }))
.then(() => Protocol.HeapProfiler.collectGarbage())
.then(() => Protocol.Debugger.enable()) .then(() => Protocol.Debugger.enable())
.then(InspectorTest.completeTest); .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