-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: [coverage] IncBlockCounter should not be side-effect Incrementing coverage counter was triggering EvalError for evaluateOnCallFrame when throwOnSideEffect is true. R=jgruber@chromium.org, sigurds@chromium.org, yangguo@chromium.org Bug: v8:10856 Change-Id: I0552e19a3a14ff61a9cb626494fb4a21979d535e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2384011 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#69628} Refs: v8/v8@6be2f6e PR-URL: #35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
- Loading branch information
Showing
5 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
deps/v8/test/inspector/debugger/side-effect-free-coverage-enabled-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Tests side-effect-free evaluation with coverage enabled | ||
Paused on 'debugger;' | ||
f() returns 1 |
43 changes: 43 additions & 0 deletions
43
deps/v8/test/inspector/debugger/side-effect-free-coverage-enabled.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2020 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. | ||
|
||
let {session, contextGroup, Protocol} = InspectorTest.start('Tests side-effect-free evaluation with coverage enabled'); | ||
|
||
contextGroup.addScript(` | ||
function testFunction() | ||
{ | ||
var o = 0; | ||
function f() { return 1; } | ||
function g() { o = 2; return o; } | ||
f,g; | ||
debugger; | ||
} | ||
//# sourceURL=foo.js`); | ||
|
||
// Side effect free call should not result in EvalError when coverage | ||
// is enabled: | ||
Protocol.Profiler.enable() | ||
Protocol.Profiler.startPreciseCoverage({callCount: true, detailed: true}) | ||
|
||
Protocol.Debugger.enable(); | ||
|
||
Protocol.Debugger.oncePaused().then(debuggerPaused); | ||
|
||
Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0)" }); | ||
|
||
var topFrameId; | ||
|
||
function debuggerPaused(messageObject) | ||
{ | ||
InspectorTest.log("Paused on 'debugger;'"); | ||
|
||
topFrameId = messageObject.params.callFrames[0].callFrameId; | ||
Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "f()", throwOnSideEffect: true}).then(evaluatedFirst); | ||
} | ||
|
||
function evaluatedFirst(response) | ||
{ | ||
InspectorTest.log("f() returns " + response.result.result.value); | ||
InspectorTest.completeTest(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters