WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
199474
[WHLSL] Remove the phase resolveCallsInFunctions
https://bugs.webkit.org/show_bug.cgi?id=199474
Summary
[WHLSL] Remove the phase resolveCallsInFunctions
Robin Morisset
Reported
2019-07-03 15:52:16 PDT
This pass only stores into each property access and call expression vectors of all the functions it might be calling, for use by the Checker afterwards. But the checker is perfectly able to compute a pointer to these vectors by itself. So by removing this pass, we gain the following: - One less pass over the AST - No need to copy these vectors (which can be large for heavily overloaded functions, of which there are quite a few in the stdlib) - No need to have these vectors in the expressions, saving 24 bytes per CallExpression and 72 bytes per PropertyAccessExpression - No need to allocate and then destroy these vectors.
Attachments
Patch
(19.00 KB, patch)
2019-07-03 16:57 PDT
,
Robin Morisset
no flags
Details
Formatted Diff
Diff
Patch
(18.84 KB, patch)
2019-07-03 16:59 PDT
,
Robin Morisset
no flags
Details
Formatted Diff
Diff
Patch
(20.71 KB, patch)
2019-07-05 12:00 PDT
,
Robin Morisset
no flags
Details
Formatted Diff
Diff
Patch
(20.71 KB, patch)
2019-07-05 12:02 PDT
,
Robin Morisset
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Robin Morisset
Comment 1
2019-07-03 16:31:34 PDT
Turns out this pass is also used for some other miscellaneous name resolving, so it cannot be removed altogether. But the vector copying and storing at least should be avoidable.
Robin Morisset
Comment 2
2019-07-03 16:55:34 PDT
I was confused, this pass is truly not necessary.
Robin Morisset
Comment 3
2019-07-03 16:57:17 PDT
Created
attachment 373438
[details]
Patch
Robin Morisset
Comment 4
2019-07-03 16:59:03 PDT
Created
attachment 373439
[details]
Patch
Myles C. Maxfield
Comment 5
2019-07-03 17:14:10 PDT
Comment on
attachment 373439
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=373439&action=review
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:1028 > + getterFunction = resolveFunction(m_program, getterFunctions, getterArgumentTypes, getterName, propertyAccessExpression.origin(), m_intrinsics);
nit: if ((getterFunction = resolveFunction(...))
Robin Morisset
Comment 6
2019-07-03 17:18:08 PDT
(In reply to Myles C. Maxfield from
comment #5
)
> Comment on
attachment 373439
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=373439&action=review
> > > Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:1028 > > + getterFunction = resolveFunction(m_program, getterFunctions, getterArgumentTypes, getterName, propertyAccessExpression.origin(), m_intrinsics); > > nit: if ((getterFunction = resolveFunction(...))
I tried that at first, but it no longer fit on one line on my screen, and was not really a readability improvement.
WebKit Commit Bot
Comment 7
2019-07-03 18:15:44 PDT
Comment on
attachment 373439
[details]
Patch Clearing flags on attachment: 373439 Committed
r247127
: <
https://trac.webkit.org/changeset/247127
>
WebKit Commit Bot
Comment 8
2019-07-03 18:15:46 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9
2019-07-03 18:18:21 PDT
<
rdar://problem/52622712
>
Ryan Haddad
Comment 10
2019-07-04 11:53:44 PDT
Reverted
r247127
for reason: Broke the watchOS build. Committed
r247144
: <
https://trac.webkit.org/changeset/247144
>
Robin Morisset
Comment 11
2019-07-05 11:50:38 PDT
Found the problem: we replace in-place a PropertyAccessExpression by a CallExpression. Since I've shrunk PropertyAccessExpression, this is no longer safe on 32-bit platforms. The good news is that there is no bare PropertyAccessExpression, all of them are either DotExpressions or IndexExpressions, both of which have an extra field that make them large enough to replace by a CallExpression in-place. So I just have to add a downcast to the right subclass before the call to replaceWith<CallExpression>.
Robin Morisset
Comment 12
2019-07-05 12:00:24 PDT
Created
attachment 373519
[details]
Patch
Robin Morisset
Comment 13
2019-07-05 12:02:11 PDT
Created
attachment 373520
[details]
Patch
WebKit Commit Bot
Comment 14
2019-07-05 13:09:45 PDT
Comment on
attachment 373520
[details]
Patch Clearing flags on attachment: 373520 Committed
r247170
: <
https://trac.webkit.org/changeset/247170
>
WebKit Commit Bot
Comment 15
2019-07-05 13:09:47 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug