Bug 187968 - Refactoring: make DFG::Plan a class.
Summary: Refactoring: make DFG::Plan a class.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-24 12:26 PDT by Mark Lam
Modified: 2018-07-24 16:15 PDT (History)
8 users (show)

See Also:


Attachments
proposed patch. (96.98 KB, patch)
2018-07-24 12:40 PDT, Mark Lam
saam: review+
Details | Formatted Diff | Diff
patch for landing. (97.74 KB, patch)
2018-07-24 15:03 PDT, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2018-07-24 12:26:40 PDT
Let's make all the fields private, and provide accessor methods for them.  This makes it easier to reason about how these fields are used and modified.
Comment 1 Mark Lam 2018-07-24 12:40:18 PDT
Created attachment 345702 [details]
proposed patch.
Comment 2 EWS Watchlist 2018-07-24 12:42:17 PDT
Attachment 345702 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:139:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:140:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:141:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:142:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:143:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:144:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:145:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:146:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:147:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:148:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:149:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:224:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 12 in 39 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Saam Barati 2018-07-24 12:48:27 PDT
Comment on attachment 345702 [details]
proposed patch.

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

r=me

> Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:574
> +                if (!isFTL(m_graph.m_plan.mode()))

might be nice to have a function like:

bool Plan::isFTL()
Comment 4 Mark Lam 2018-07-24 13:33:20 PDT
(In reply to Saam Barati from comment #3)
> Comment on attachment 345702 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=345702&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:574
> > +                if (!isFTL(m_graph.m_plan.mode()))
> 
> might be nice to have a function like:
> 
> bool Plan::isFTL()

Good suggestion.  I'll make the change.
Comment 5 Mark Lam 2018-07-24 15:03:29 PDT
Created attachment 345717 [details]
patch for landing.
Comment 6 EWS Watchlist 2018-07-24 15:05:27 PDT
Attachment 345717 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:139:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:140:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:141:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:142:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:143:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:144:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:145:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:146:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:147:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:148:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:149:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:224:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 12 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Mark Lam 2018-07-24 16:14:44 PDT
Landed in r234178: <http://trac.webkit.org/r234178>.
Comment 8 Radar WebKit Bug Importer 2018-07-24 16:15:17 PDT
<rdar://problem/42560897>