Bug 210253

Summary: Web Inspector: Debugger: debug hooks should also be emitted for the first sub-expression in a comma expression
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Bug Depends on: 209998    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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>