Bug 210253 - Web Inspector: Debugger: debug hooks should also be emitted for the first sub-expression in a comma expression
Summary: Web Inspector: Debugger: debug hooks should also be emitted for the first sub...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 209998
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-09 00:51 PDT by Devin Rousso
Modified: 2020-04-09 11:23 PDT (History)
10 users (show)

See Also:


Attachments
Patch (24.62 KB, patch)
2020-04-09 01:01 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (24.69 KB, patch)
2020-04-09 09:34 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (24.69 KB, patch)
2020-04-09 09:45 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2020-04-09 00:51:30 PDT
After r259781, debug hooks are now generated for all but the first sub-expression in a comma expression.

[Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp](http://trac.webkit.org/changeset/259781/webkit/trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp):
```
    RegisterID* CommaNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
    {
        for (; node->next(); node = node->next()) {
            generator.emitNode(generator.ignoredResult(), node->m_expr);

            // Don't emit a debug hook for the first expression, as that should've already happened in
            // the containing statement.
            generator.emitDebugHook(node->next()->m_expr);
        }
        return generator.emitNodeInTailPosition(dst, node->m_expr);
    }
```

This comment is inaccurate, as in the simple case of `true && (a(), b())`.
Comment 1 Devin Rousso 2020-04-09 01:01:13 PDT
Created attachment 395920 [details]
Patch
Comment 2 Joseph Pecoraro 2020-04-09 01:27:09 PDT
Comment on attachment 395920 [details]
Patch

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

r=me

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:3539
>      if (!shouldEmitDebugHooks())
>          return;

Maybe we could use LIKELY macros here.
Comment 3 Devin Rousso 2020-04-09 09:34:13 PDT
Created attachment 395963 [details]
Patch
Comment 4 Devin Rousso 2020-04-09 09:44:10 PDT
Comment on attachment 395963 [details]
Patch

Oops, that should be a `LIKELY` 😅
Comment 5 Devin Rousso 2020-04-09 09:45:43 PDT
Created attachment 395967 [details]
Patch
Comment 6 EWS 2020-04-09 11:22:06 PDT
Committed r259810: <https://trac.webkit.org/changeset/259810>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395967 [details].
Comment 7 Radar WebKit Bug Importer 2020-04-09 11:23:14 PDT
<rdar://problem/61528617>