WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
201158
[JSC] JSPromise should work with object-allocation-sinking
https://bugs.webkit.org/show_bug.cgi?id=201158
Summary
[JSC] JSPromise should work with object-allocation-sinking
Yusuke Suzuki
Reported
2019-08-26 16:08:10 PDT
...
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-08-26 16:08:32 PDT
<
rdar://problem/54726575
>
Saam Barati
Comment 2
2019-08-30 15:29:27 PDT
won't inlining the constructor which will be written in JS now sink the executor function?
Yusuke Suzuki
Comment 3
2019-08-30 15:37:03 PDT
(In reply to Saam Barati from
comment #2
)
> won't inlining the constructor which will be written in JS now sink the > executor function?
I would like to sink JSPromise object itself too when it can be done.
Yusuke Suzuki
Comment 4
2019-08-30 15:38:23 PDT
One possible thing (I'm not talking about whether it is possible in our implementation) is, Promise.resolve(42).then(function (value) { // }); Promise.resolve's returning promise is essentially unnecessary.
Saam Barati
Comment 5
2019-08-30 16:28:52 PDT
(In reply to Yusuke Suzuki from
comment #4
)
> One possible thing (I'm not talking about whether it is possible in our > implementation) is, > > Promise.resolve(42).then(function (value) { > // > }); > > Promise.resolve's returning promise is essentially unnecessary.
Yeah it would be nice too. But is this common? Maybe through inlining it might become common. That said, don't we need the intermediate promise because "function (value)" isn't called until next run loop tick?
Yusuke Suzuki
Comment 6
2019-08-30 16:59:23 PDT
(In reply to Saam Barati from
comment #5
)
> (In reply to Yusuke Suzuki from
comment #4
) > > One possible thing (I'm not talking about whether it is possible in our > > implementation) is, > > > > Promise.resolve(42).then(function (value) { > > // > > }); > > > > Promise.resolve's returning promise is essentially unnecessary. > > Yeah it would be nice too. But is this common? > > Maybe through inlining it might become common. That said, don't we need the > intermediate promise because "function (value)" isn't called until next run > loop tick?
In the above example, Promise.resolve's promise is unnecessary. It is already resolved. Microtask only contains reactions of Promises, and value for resolution, so Promise object itself is not necessary.
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