Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick 6be2f6e26e8d #35055

Merged
merged 1 commit into from Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.15',
'v8_embedder_string': '-node.16',

##### V8 defaults for Node.js #####

Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/debug/debug-evaluate.cc
Expand Up @@ -473,6 +473,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) {
case Bytecode::kToNumeric:
case Bytecode::kToString:
// Misc.
case Bytecode::kIncBlockCounter: // Coverage counters.
case Bytecode::kForInEnumerate:
case Bytecode::kForInPrepare:
case Bytecode::kForInContinue:
Expand Down
@@ -0,0 +1,3 @@
Tests side-effect-free evaluation with coverage enabled
Paused on 'debugger;'
f() returns 1
@@ -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();
}
1 change: 1 addition & 0 deletions deps/v8/test/inspector/inspector.status
Expand Up @@ -33,6 +33,7 @@
'debugger/eval-scopes': [PASS, FAIL],
'debugger/scope-skip-variables-with-empty-name': [PASS, FAIL],
'debugger/update-call-frame-scopes': [PASS, FAIL],
'debugger/side-effect-free-coverage-enabled': [PASS, FAIL],
'debugger/side-effect-free-debug-evaluate': [PASS, FAIL],
'debugger/evaluate-on-call-frame-in-module': [PASS, FAIL],
}], # variant != default
Expand Down