WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
190671
The parser should not emit a ApplyFunctionCallDotNode for Reflect.apply.
https://bugs.webkit.org/show_bug.cgi?id=190671
Summary
The parser should not emit a ApplyFunctionCallDotNode for Reflect.apply.
Mark Lam
Reported
2018-10-17 10:49:07 PDT
The bytecode generator does not currently know how to inline Reflect.apply (see
https://bugs.webkit.org/show_bug.cgi?id=190668
). Hence, it's a waste of time to emit the ApplyFunctionCallDotNode since the function check against Function.apply that it will generate will always fail. It also causes DFG graph dumping to crash. <
rdar://problem/45201145
>
Attachments
proposed patch.
(3.89 KB, patch)
2018-10-17 11:00 PDT
,
Mark Lam
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews100 for mac-sierra
(273.00 KB, application/zip)
2018-10-17 11:35 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews106 for mac-sierra-wk2
(1.18 MB, application/zip)
2018-10-17 11:48 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews124 for ios-simulator-wk2
(190.89 KB, application/zip)
2018-10-17 12:09 PDT
,
EWS Watchlist
no flags
Details
proposed patch.
(4.83 KB, patch)
2018-10-17 13:56 PDT
,
Mark Lam
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Mark Lam
Comment 1
2018-10-17 11:00:55 PDT
Created
attachment 352592
[details]
proposed patch. Let's get some EWS testing first.
Saam Barati
Comment 2
2018-10-17 11:08:13 PDT
Comment on
attachment 352592
[details]
proposed patch. View in context:
https://bugs.webkit.org/attachment.cgi?id=352592&action=review
> Source/JavaScriptCore/ChangeLog:12 > + that it will generate will always fail. It can also cause DFG graph dumping to
I agree with this from a performance perspective. However, it seems like you’re sidestepping a crash. Why does the dumper crash? Seems like that should be fixed
Mark Lam
Comment 3
2018-10-17 11:24:39 PDT
(In reply to Saam Barati from
comment #2
)
> Comment on
attachment 352592
[details]
> proposed patch. > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=352592&action=review
> > > Source/JavaScriptCore/ChangeLog:12 > > + that it will generate will always fail. It can also cause DFG graph dumping to > > I agree with this from a performance perspective. However, it seems like > you’re sidestepping a crash. Why does the dumper crash? Seems like that > should be fixed
It crashed because it's expecting the callee in a CallVariant to be a function or executable of some form. Because we're creating a ApplyFunctionCallDotNode for Reflect.apply, we end up passing the Reflect object as the callee. This is wrong, and is the reason the dumper crashed. We should be passing the first argument of Reflect.apply as the callee instead (when we support inlining Reflect.apply). Hmmm ... that said, I haven't explored what happens in we can properly inline Reflect.apply later and pass a non-function value as the first argument. I think we can leave that as an exercise for
https://bugs.webkit.org/show_bug.cgi?id=190668
.
EWS Watchlist
Comment 4
2018-10-17 11:35:12 PDT
Comment on
attachment 352592
[details]
proposed patch.
Attachment 352592
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/9638635
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 5
2018-10-17 11:35:14 PDT
Created
attachment 352601
[details]
Archive of layout-test-results from ews100 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 6
2018-10-17 11:48:08 PDT
Comment on
attachment 352592
[details]
proposed patch.
Attachment 352592
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/9638736
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 7
2018-10-17 11:48:09 PDT
Created
attachment 352602
[details]
Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Saam Barati
Comment 8
2018-10-17 11:51:36 PDT
(In reply to Mark Lam from
comment #3
)
> (In reply to Saam Barati from
comment #2
) > > Comment on
attachment 352592
[details]
> > proposed patch. > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=352592&action=review
> > > > > Source/JavaScriptCore/ChangeLog:12 > > > + that it will generate will always fail. It can also cause DFG graph dumping to > > > > I agree with this from a performance perspective. However, it seems like > > you’re sidestepping a crash. Why does the dumper crash? Seems like that > > should be fixed > > It crashed because it's expecting the callee in a CallVariant to be a > function or executable of some form. Because we're creating a > ApplyFunctionCallDotNode for Reflect.apply, we end up passing the Reflect > object as the callee. This is wrong, and is the reason the dumper crashed. > We should be passing the first argument of Reflect.apply as the callee > instead (when we support inlining Reflect.apply).
I don't see how this matters at all that the callee here is Reflect. Seems like any code can trigger this.
> > Hmmm ... that said, I haven't explored what happens in we can properly > inline Reflect.apply later and pass a non-function value as the first > argument. I think we can leave that as an exercise for >
https://bugs.webkit.org/show_bug.cgi?id=190668
.
EWS Watchlist
Comment 9
2018-10-17 12:09:57 PDT
Comment on
attachment 352592
[details]
proposed patch.
Attachment 352592
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/9638622
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 10
2018-10-17 12:09:59 PDT
Created
attachment 352605
[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Mark Lam
Comment 11
2018-10-17 13:06:08 PDT
(In reply to Saam Barati from
comment #8
)
> I don't see how this matters at all that the callee here is Reflect. Seems > like any code can trigger this.
You are right. I stand corrected. Will fix.
Mark Lam
Comment 12
2018-10-17 13:56:39 PDT
Created
attachment 352635
[details]
proposed patch. Let's try on the EWS again.
Saam Barati
Comment 13
2018-10-17 16:27:20 PDT
Comment on
attachment 352635
[details]
proposed patch. View in context:
https://bugs.webkit.org/attachment.cgi?id=352635&action=review
r=me
> Source/JavaScriptCore/ChangeLog:11 > +
https://bugs.webkit.org/show_bug.cgi?id=190668
). Hence, it's a waste of time to > + emit the ApplyFunctionCallDotNode since the function check against Function.apply
What you're doing is a heuristic, FWIW. I agree with your change, because it's probably better, but it's still a heuristic. A user could write code where this new heuristic is worse: ``` function Reflect() { ... } Reflect.apply ```
Mark Lam
Comment 14
2018-10-17 16:31:34 PDT
Thanks for the review. (In reply to Saam Barati from
comment #13
)
> > Source/JavaScriptCore/ChangeLog:11 > > +
https://bugs.webkit.org/show_bug.cgi?id=190668
). Hence, it's a waste of time to > > + emit the ApplyFunctionCallDotNode since the function check against Function.apply > > What you're doing is a heuristic, FWIW. I agree with your change, because > it's probably better, but it's still a heuristic. A user could write code > where this new heuristic is worse: > ``` > function Reflect() { ... } > Reflect.apply > ```
Yes, I thought of that. My thinking is that if the user wrote code like that, he/she is just asking for it. For most normal code, I would not expect the user to create a function named Reflect with a member named apply. So, I opted to go with this heuristic.
WebKit Commit Bot
Comment 15
2018-10-17 16:57:05 PDT
Comment on
attachment 352635
[details]
proposed patch. Clearing flags on attachment: 352635 Committed
r237241
: <
https://trac.webkit.org/changeset/237241
>
WebKit Commit Bot
Comment 16
2018-10-17 16:57:07 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