[inspector] ignores debugger; in blackboxed code

Current state and proposed changes for blackboxing: https://docs.google.com/document/d/1hnzaXPAN8_QC5ENxIgxgMNDbXLraM_OXT73rAyijTF8/edit?usp=sharing

BUG=v8:5842,chromium:583193
R=yangguo@chromium.org,dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2648353006
Cr-Commit-Position: refs/heads/master@{#42668}
This commit is contained in:
kozyatinskiy 2017-01-25 15:30:40 -08:00 committed by Commit bot
parent 6d42c4504a
commit c8691efb38
3 changed files with 10 additions and 10 deletions

View File

@ -2194,10 +2194,16 @@ void Debug::HandleDebugBreak() {
DCHECK(!it.done());
Object* fun = it.frame()->function();
if (fun && fun->IsJSFunction()) {
// Don't stop in builtin functions.
if (!JSFunction::cast(fun)->shared()->IsSubjectToDebugging()) return;
if (isolate_->stack_guard()->CheckDebugBreak() &&
// Don't stop in builtin and blackboxed functions.
if (!JSFunction::cast(fun)->shared()->IsSubjectToDebugging() ||
IsBlackboxed(JSFunction::cast(fun)->shared())) {
// Inspector uses pause on next statement for asynchronous breakpoints.
// When breakpoint is fired we try to break on first not blackboxed
// statement. To achieve this goal we need to deoptimize current
// function and don't clear requested DebugBreak even if it's blackboxed
// to be able to break on not blackboxed function call.
// TODO(yangguo): introduce break_on_function_entry since current
// implementation is slow.
Deoptimizer::DeoptimizeFunction(JSFunction::cast(fun));
return;
}

View File

@ -27,13 +27,7 @@ breakpoint (framework.js:24:2)
Running test: testDebuggerStatement
> all frames in framework:
debuggerStatement (framework.js:28:2)
(anonymous) (framework.js:0:0)
> mixed, top frame in framework:
debuggerStatement (framework.js:28:2)
(anonymous) (user.js:0:0)
Running test: testSyncDOMBreakpoint
> all frames in framework:

View File

@ -11,7 +11,7 @@ function frameworkCall(funcs) {
}
function frameworkBreakAndCall(funcs) {
debugger;
breakProgram('', '');
for (var f of funcs) f();
}
//# sourceURL=framework.js`,