Commit adc42c3a authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[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}
parent 0ac7970a
......@@ -9041,9 +9041,9 @@ bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) {
i::HandleScope scope(isolate);
for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) {
if (!it.is_javascript()) continue;
i::Handle<i::SharedFunctionInfo> shared(
it.javascript_frame()->function()->shared());
if (!isolate->debug()->IsBlackboxed(shared)) return true;
if (!isolate->debug()->IsFrameBlackboxed(it.javascript_frame())) {
return true;
}
}
return false;
}
......
......@@ -387,6 +387,8 @@ class Debug {
void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
LiveEditFrameDropMode mode);
bool IsFrameBlackboxed(JavaScriptFrame* frame);
// Threading support.
char* ArchiveDebug(char* to);
char* RestoreDebug(char* from);
......@@ -496,7 +498,6 @@ class Debug {
bool IsBlackboxed(SharedFunctionInfo* shared);
bool IsExceptionBlackboxed(bool uncaught);
bool IsFrameBlackboxed(JavaScriptFrame* frame);
void OnException(Handle<Object> exception, Handle<Object> promise);
......
......@@ -47,6 +47,15 @@ syncDOMBreakpoint (framework.js:33:2)
(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
> all frames in framework:
(anonymous) (user.js:0:0)
......
......@@ -59,12 +59,25 @@ function throwInlinedUncaughtError() {
inlinedWrapper();
}
function syncDOMBreakpointWithInlinedUserFrame() {
function inlinedWrapper() {
userFunction();
}
%OptimizeFunctionOnNextCall(inlinedWrapper);
inlinedWrapper();
}
//# sourceURL=framework.js`, 8, 26);
InspectorTest.addScript(`
function throwUserException() {
throw new Error();
}
function userFunction() {
syncDOMBreakpoint();
}
//# sourceURL=user.js`, 64, 26)
InspectorTest.setupScriptMap();
......@@ -167,6 +180,13 @@ InspectorTest.runTestSuite([
.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) {
schedulePauseOnNextStatement('', '');
InspectorTest.log('> all frames in framework:');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment