Bug 175585 - Support the 'with' keyword in FTL
Summary: Support the 'with' keyword in FTL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-15 10:37 PDT by Robin Morisset
Modified: 2017-08-15 18:10 PDT (History)
7 users (show)

See Also:


Attachments
Patch (17.10 KB, patch)
2017-08-15 16:12 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch, scopeObject => object (19.17 KB, patch)
2017-08-15 17:33 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2017-08-15 10:37:00 PDT
What it says in the title. This is an extension of https://bugs.webkit.org/show_bug.cgi?id=175470.
Comment 1 Robin Morisset 2017-08-15 16:12:46 PDT
Created attachment 318192 [details]
Patch
Comment 2 Saam Barati 2017-08-15 16:19:29 PDT
Comment on attachment 318192 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:5655
> +            Node* scopeObject = get(VirtualRegister(currentInstruction[3].u.operand));

FWIW, I think a less confusing variable name would just be "object" instead of "scopeObject" here and in other places

> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:1713
> +        case PushWithScope:

I think it's nice to document like before as KnownCellUse instead of CellUse.
Comment 3 Keith Miller 2017-08-15 16:21:42 PDT
Comment on attachment 318192 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:5656
> -            Node* scopeObject = get(VirtualRegister(currentInstruction[2].u.operand));
> -            Node* currentScope = get(VirtualRegister(currentInstruction[3].u.operand));
> -            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(PushWithScope, scopeObject, currentScope));
> +            Node* currentScope = get(VirtualRegister(currentInstruction[2].u.operand));
> +            Node* scopeObject = get(VirtualRegister(currentInstruction[3].u.operand));
> +            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(PushWithScope, currentScope, scopeObject));

If you want to be fancy you can use my new bytecode names feature :)
Comment 4 Robin Morisset 2017-08-15 17:33:50 PDT
Created attachment 318203 [details]
Patch, scopeObject => object
Comment 5 Robin Morisset 2017-08-15 17:35:11 PDT
I will refine the type in DFGFixupPhase.cpp in a separate patch since it also applies to other opcodes (CreateActivation, CreateScopedArguments, NewFunction, NewGeneratorFunction, NewAsyncFunction).
Comment 6 Build Bot 2017-08-15 17:36:47 PDT
Attachment 318203 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/jit/JITOperations.h:422:  The parameter name "object" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 18 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 WebKit Commit Bot 2017-08-15 18:10:05 PDT
Comment on attachment 318203 [details]
Patch, scopeObject => object

Clearing flags on attachment: 318203

Committed r220778: <http://trac.webkit.org/changeset/220778>
Comment 8 WebKit Commit Bot 2017-08-15 18:10:07 PDT
All reviewed patches have been landed.  Closing bug.