[inspector] take into account inlined frames in ::HasNonBlackboxedFrameOnStack

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

Review-Url: https://codereview.chromium.org/2656743003
Cr-Commit-Position: refs/heads/master@{#42715}
This commit is contained in:
kozyatinskiy 2017-01-26 13:32:53 -08:00 committed by Commit bot
parent 0ac7970a60
commit adc42c3a82
4 changed files with 34 additions and 4 deletions

View File

@ -9041,9 +9041,9 @@ bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) {
i::HandleScope scope(isolate); i::HandleScope scope(isolate);
for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) { for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) {
if (!it.is_javascript()) continue; if (!it.is_javascript()) continue;
i::Handle<i::SharedFunctionInfo> shared( if (!isolate->debug()->IsFrameBlackboxed(it.javascript_frame())) {
it.javascript_frame()->function()->shared()); return true;
if (!isolate->debug()->IsBlackboxed(shared)) return true; }
} }
return false; return false;
} }

View File

@ -387,6 +387,8 @@ class Debug {
void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
LiveEditFrameDropMode mode); LiveEditFrameDropMode mode);
bool IsFrameBlackboxed(JavaScriptFrame* frame);
// Threading support. // Threading support.
char* ArchiveDebug(char* to); char* ArchiveDebug(char* to);
char* RestoreDebug(char* from); char* RestoreDebug(char* from);
@ -496,7 +498,6 @@ class Debug {
bool IsBlackboxed(SharedFunctionInfo* shared); bool IsBlackboxed(SharedFunctionInfo* shared);
bool IsExceptionBlackboxed(bool uncaught); bool IsExceptionBlackboxed(bool uncaught);
bool IsFrameBlackboxed(JavaScriptFrame* frame);
void OnException(Handle<Object> exception, Handle<Object> promise); void OnException(Handle<Object> exception, Handle<Object> promise);

View File

@ -47,6 +47,15 @@ syncDOMBreakpoint (framework.js:33:2)
(anonymous) (user.js:0:0) (anonymous) (user.js:0:0)
Running test: testSyncDOMBreakpointWithInlinedUserFrame
> mixed, top frame in framework:
syncDOMBreakpoint (framework.js:33:2)
userFunction (user.js:70:2)
inlinedWrapper (framework.js:64:4)
syncDOMBreakpointWithInlinedUserFrame (framework.js:67:2)
(anonymous) (framework.js:0:0)
Running test: testAsyncDOMBreakpoint Running test: testAsyncDOMBreakpoint
> all frames in framework: > all frames in framework:
(anonymous) (user.js:0:0) (anonymous) (user.js:0:0)

View File

@ -59,12 +59,25 @@ function throwInlinedUncaughtError() {
inlinedWrapper(); inlinedWrapper();
} }
function syncDOMBreakpointWithInlinedUserFrame() {
function inlinedWrapper() {
userFunction();
}
%OptimizeFunctionOnNextCall(inlinedWrapper);
inlinedWrapper();
}
//# sourceURL=framework.js`, 8, 26); //# sourceURL=framework.js`, 8, 26);
InspectorTest.addScript(` InspectorTest.addScript(`
function throwUserException() { function throwUserException() {
throw new Error(); throw new Error();
} }
function userFunction() {
syncDOMBreakpoint();
}
//# sourceURL=user.js`, 64, 26) //# sourceURL=user.js`, 64, 26)
InspectorTest.setupScriptMap(); InspectorTest.setupScriptMap();
@ -167,6 +180,13 @@ InspectorTest.runTestSuite([
.then(next); .then(next);
}, },
function testSyncDOMBreakpointWithInlinedUserFrame(next) {
InspectorTest.log('> mixed, top frame in framework:');
Protocol.Runtime
.evaluate({expression: 'syncDOMBreakpointWithInlinedUserFrame()//# sourceURL=framework.js'})
.then(next);
},
function testAsyncDOMBreakpoint(next) { function testAsyncDOMBreakpoint(next) {
schedulePauseOnNextStatement('', ''); schedulePauseOnNextStatement('', '');
InspectorTest.log('> all frames in framework:'); InspectorTest.log('> all frames in framework:');