Bug 155741 - We should not disable inlining when the debugger is enabled
Summary: We should not disable inlining when the debugger is enabled
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on: 155812
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-21 18:02 PDT by Saam Barati
Modified: 2016-03-23 16:23 PDT (History)
15 users (show)

See Also:


Attachments
WIP (6.20 KB, patch)
2016-03-22 12:20 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (14.55 KB, patch)
2016-03-22 19:40 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-03-21 18:02:50 PDT
...
Comment 1 Saam Barati 2016-03-22 12:20:50 PDT
Created attachment 274674 [details]
WIP

We probably need to do something similar for stepping mode.
Comment 2 Saam Barati 2016-03-22 12:40:14 PDT
(In reply to comment #1)
> Created attachment 274674 [details]
> WIP
> 
> We probably need to do something similar for stepping mode.

Actually I don't think we do. Setting the SteppingMode seems to target
all code blocks and jettison all optimized code blocks.
Comment 3 Saam Barati 2016-03-22 19:40:48 PDT
Created attachment 274723 [details]
patch
Comment 4 WebKit Commit Bot 2016-03-23 02:15:45 PDT
Comment on attachment 274723 [details]
patch

Clearing flags on attachment: 274723

Committed r198582: <http://trac.webkit.org/changeset/198582>
Comment 5 WebKit Commit Bot 2016-03-23 02:15:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Geoffrey Garen 2016-03-23 10:29:41 PDT
Comment on attachment 274723 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=274723&action=review

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:-451
> -            else if (m_hasDebuggerEnabled && operand == m_codeBlock->scopeRegister())
> -                flush(operand);

I think we still need to flush the scope register.

If A calls B, and both A and B are DFG-compiled, and B is not inlined, and I break in B, the debugger allows me to walk the stack and inspect A's local variables. But if the scope register is not flushed, I might crash when I try to inspect A, reading a garbage scope pointer from the stack.
Comment 7 Joseph Pecoraro 2016-03-23 10:55:07 PDT
Comment on attachment 274723 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=274723&action=review

> Source/JavaScriptCore/debugger/Debugger.cpp:268
> +        line += 1;
> +        column = column ? column + 1 : Breakpoint::unspecifiedColumn;

Would be nice to comment why these +1. It used to have a comment.

> Source/JavaScriptCore/debugger/Debugger.cpp:-266
> -    // Inspector breakpoint line and column values are zero-based but the executable
> -    // and CodeBlock line and column values are one-based.

This was the comment it used ot have.
Comment 8 Saam Barati 2016-03-23 13:02:01 PDT
(In reply to comment #6)
> Comment on attachment 274723 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=274723&action=review
> 
> > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:-451
> > -            else if (m_hasDebuggerEnabled && operand == m_codeBlock->scopeRegister())
> > -                flush(operand);
> 
> I think we still need to flush the scope register.
> 
> If A calls B, and both A and B are DFG-compiled, and B is not inlined, and I
> break in B, the debugger allows me to walk the stack and inspect A's local
> variables. But if the scope register is not flushed, I might crash when I
> try to inspect A, reading a garbage scope pointer from the stack.

Good call. I will bring these changes back.
Comment 9 Saam Barati 2016-03-23 13:05:45 PDT
(In reply to comment #7)
> Comment on attachment 274723 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=274723&action=review
> 
> > Source/JavaScriptCore/debugger/Debugger.cpp:268
> > +        line += 1;
> > +        column = column ? column + 1 : Breakpoint::unspecifiedColumn;
> 
> Would be nice to comment why these +1. It used to have a comment.
> 
> > Source/JavaScriptCore/debugger/Debugger.cpp:-266
> > -    // Inspector breakpoint line and column values are zero-based but the executable
> > -    // and CodeBlock line and column values are one-based.
> 
> This was the comment it used ot have.

Nice catch. I'll add those back.
Comment 10 WebKit Commit Bot 2016-03-23 15:29:03 PDT
Re-opened since this is blocked by bug 155812
Comment 11 Saam Barati 2016-03-23 16:23:22 PDT
Lets start by having a high fidelity profiling mode first. Then we can revisit this again.