Commit 27cff23c authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[inspector] avoid running gc before reporting scripts

It will help us to preserve some scripts for user.

R=alph@chromium.org
TBR=jgruber@chromium.org

Bug: chromium:655701
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I6d42434148c2d9eb41c3a2af906e8c14ccf8d9a9
Reviewed-on: https://chromium-review.googlesource.com/806741
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49913}
parent 9a64d7b6
...@@ -9875,9 +9875,6 @@ void debug::GetLoadedScripts(v8::Isolate* v8_isolate, ...@@ -9875,9 +9875,6 @@ void debug::GetLoadedScripts(v8::Isolate* v8_isolate,
PersistentValueVector<debug::Script>& scripts) { PersistentValueVector<debug::Script>& scripts) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
// TODO(kozyatinskiy): remove this GC once tests are dealt with.
isolate->heap()->CollectAllGarbage(i::Heap::kMakeHeapIterableMask,
i::GarbageCollectionReason::kDebugger);
{ {
i::DisallowHeapAllocation no_gc; i::DisallowHeapAllocation no_gc;
i::Script::Iterator iterator(isolate); i::Script::Iterator iterator(isolate);
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-gc
// Test whether scripts compiled after setting the break point are // Test whether scripts compiled after setting the break point are
// updated correctly. // updated correctly.
gc();
Debug = debug.Debug; Debug = debug.Debug;
var break_count = 0; var break_count = 0;
......
// Copyright 2015 the V8 project authors. All rights reserved. // Copyright 2015 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
gc();
function static() { function static() {
print("> static"); // Break print("> static"); // Break
} }
......
...@@ -116,7 +116,7 @@ function testSimpleExpressions() { ...@@ -116,7 +116,7 @@ function testSimpleExpressions() {
|_|a--; |_|a--;
|R|} |R|}
Object.defineProperty(this, 'getterFoo', { |_|Object.|C|defineProperty(this, 'getterFoo', {
get: () => |_|return42|R| get: () => |_|return42|R|
}); });
...@@ -124,7 +124,7 @@ function testGetter() { ...@@ -124,7 +124,7 @@ function testGetter() {
|C|getterFoo(); |C|getterFoo();
|R|} |R|}
var obj = { var obj = |_|{
foo: () => (|_|{ foo: () => (|_|{
boo: () => |_|return42|R| boo: () => |_|return42|R|
})|R| })|R|
...@@ -260,7 +260,7 @@ async function testPromiseComplex() { ...@@ -260,7 +260,7 @@ async function testPromiseComplex() {
|R|} |R|}
function twiceDefined() { function twiceDefined() {
return a + b; |_|return a + b;|R|
} }
function twiceDefined() { function twiceDefined() {
......
...@@ -26,4 +26,10 @@ Running test: testTailCall ...@@ -26,4 +26,10 @@ Running test: testTailCall
scriptId : <scriptId> scriptId : <scriptId>
type : return type : return
} }
[4] : {
columnNumber : 1
lineNumber : 6
scriptId : <scriptId>
type : return
}
] ]
Tests how wasm scripts are reported Tests how wasm scripts are reported
Check that inspector gets two wasm scripts at module creation time. Check that inspector gets two wasm scripts at module creation time.
Script #0 parsed. URL: v8://test/testFunction Script #0 parsed. URL: v8://test/testFunction
Script #1 parsed. URL: v8://test/runTestRunction Script #1 parsed. URL:
Script #2 parsed. URL: wasm://wasm/wasm-7b04570e/wasm-7b04570e-0 Script #2 parsed. URL: v8://test/runTestRunction
Script #3 parsed. URL: wasm://wasm/wasm-7b04570e/wasm-7b04570e-1 Script #3 parsed. URL: wasm://wasm/wasm-7b04570e/wasm-7b04570e-0
Script #4 parsed. URL: wasm://wasm/wasm-7b04570e/wasm-7b04570e-1
Source for wasm://wasm/wasm-7b04570e/wasm-7b04570e-0: Source for wasm://wasm/wasm-7b04570e/wasm-7b04570e-0:
func $nopFunction func $nopFunction
nop nop
......
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