Bug 181999 - DFG should always flush `this`
Summary: DFG should always flush `this`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-23 11:54 PST by Filip Pizlo
Modified: 2018-01-23 12:17 PST (History)
6 users (show)

See Also:


Attachments
the patch (10.69 KB, patch)
2018-01-23 11:58 PST, Filip Pizlo
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2018-01-23 11:54:32 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2018-01-23 11:58:38 PST
Created attachment 332053 [details]
the patch
Comment 2 Saam Barati 2018-01-23 12:06:44 PST
Comment on attachment 332053 [details]
the patch

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

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:539
> +        addFlushDirect(remapOperand(inlineCallFrame, virtualRegisterForArgument(0)));

This should just go in the above loop and make it loop over the zero index
Comment 3 Mark Lam 2018-01-23 12:09:46 PST
Comment on attachment 332053 [details]
the patch

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

r=me with suggested simplification.

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:539
> +        for (unsigned argument = numArguments; argument-- > 1;)
> +            addFlushDirect(remapOperand(inlineCallFrame, virtualRegisterForArgument(argument)));
> +
> +        addFlushDirect(remapOperand(inlineCallFrame, virtualRegisterForArgument(0)));

Why not just do all the flushing in the for loop?

    for (unsigned argument = numArguments; argument--;)
        addFlushDirect(remapOperand(inlineCallFrame, virtualRegisterForArgument(argument)));
Comment 4 Filip Pizlo 2018-01-23 12:14:51 PST
(In reply to Saam Barati from comment #2)
> Comment on attachment 332053 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=332053&action=review
> 
> > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:539
> > +        addFlushDirect(remapOperand(inlineCallFrame, virtualRegisterForArgument(0)));
> 
> This should just go in the above loop and make it loop over the zero index

Oh. Right.
Comment 5 Radar WebKit Bug Importer 2018-01-23 12:15:10 PST
<rdar://problem/36787959>
Comment 6 Filip Pizlo 2018-01-23 12:17:18 PST
Landed in https://trac.webkit.org/changeset/227431/webkit