Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44c739c

Browse filesBrowse files
Benjamin CoeMylesBorins
authored andcommitted
deps: V8: cherry-pick 6be2f6e26e8d
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: #35055 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent f22672d commit 44c739c
Copy full SHA for 44c739c

File tree

Expand file treeCollapse file tree

5 files changed

+49
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+49
-1
lines changed
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Reset this number to 0 on major V8 upgrades.
3636
# Increment by one for each non-official patch applied to deps/v8.
37-
'v8_embedder_string': '-node.44',
37+
'v8_embedder_string': '-node.45',
3838

3939
##### V8 defaults for Node.js #####
4040

Collapse file

‎deps/v8/src/debug/debug-evaluate.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/debug/debug-evaluate.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) {
457457
case Bytecode::kToNumeric:
458458
case Bytecode::kToString:
459459
// Misc.
460+
case Bytecode::kIncBlockCounter: // Coverage counters.
460461
case Bytecode::kForInEnumerate:
461462
case Bytecode::kForInPrepare:
462463
case Bytecode::kForInContinue:
Collapse file
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Tests side-effect-free evaluation with coverage enabled
2+
Paused on 'debugger;'
3+
f() returns 1
Collapse file
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2020 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
let {session, contextGroup, Protocol} = InspectorTest.start('Tests side-effect-free evaluation with coverage enabled');
6+
7+
contextGroup.addScript(`
8+
function testFunction()
9+
{
10+
var o = 0;
11+
function f() { return 1; }
12+
function g() { o = 2; return o; }
13+
f,g;
14+
debugger;
15+
}
16+
//# sourceURL=foo.js`);
17+
18+
// Side effect free call should not result in EvalError when coverage
19+
// is enabled:
20+
Protocol.Profiler.enable()
21+
Protocol.Profiler.startPreciseCoverage({callCount: true, detailed: true})
22+
23+
Protocol.Debugger.enable();
24+
25+
Protocol.Debugger.oncePaused().then(debuggerPaused);
26+
27+
Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0)" });
28+
29+
var topFrameId;
30+
31+
function debuggerPaused(messageObject)
32+
{
33+
InspectorTest.log("Paused on 'debugger;'");
34+
35+
topFrameId = messageObject.params.callFrames[0].callFrameId;
36+
Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "f()", throwOnSideEffect: true}).then(evaluatedFirst);
37+
}
38+
39+
function evaluatedFirst(response)
40+
{
41+
InspectorTest.log("f() returns " + response.result.result.value);
42+
InspectorTest.completeTest();
43+
}
Collapse file

‎deps/v8/test/inspector/inspector.status‎

Copy file name to clipboardExpand all lines: deps/v8/test/inspector/inspector.status
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
'debugger/eval-scopes': [PASS, FAIL],
3232
'debugger/scope-skip-variables-with-empty-name': [PASS, FAIL],
3333
'debugger/update-call-frame-scopes': [PASS, FAIL],
34+
'debugger/side-effect-free-coverage-enabled': [PASS, FAIL],
3435
'debugger/side-effect-free-debug-evaluate': [PASS, FAIL],
3536
'debugger/evaluate-on-call-frame-in-module': [PASS, FAIL],
3637
}], # variant != default

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.