Closed
Bug 1315620
Opened 8 years ago
Closed 7 months ago
Optimize out resolved promise allocation in await.
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
firefox52 | --- | wontfix |
People
(Reporter: arai, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: triage-deferred)
(separated from bug 1314055, based on bug 1315559) https://tc39.github.io/ecmascript-asyncawait/#abstract-ops-async-function-await AsyncFunctionAwait creates resolved promise from passed value, and call then on it. if passed promise is not modified and not subclassed, we could optimize out allocation of the resolved promise, and use passed promise directly.
Reporter | ||
Comment 1•8 years ago
|
||
main concern is execution timing: 1. it may cause the execution out of order (2 jobs vs 1 job) 2. mis-optimization because of the passed promise or prototype can be modified between when we check the if it's optimizable and when we actually perform "then"
Comment 2•8 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #1) > main concern is execution timing: > 1. it may cause the execution out of order (2 jobs vs 1 job) > 2. mis-optimization because of the passed promise or prototype can be > modified between when we check the if it's optimizable and when we actually > perform "then" Both of these concerns apply to all potential optimizations of thenables handling, yes. My basic plan is to introduce a type of promise job that can delay itself one turn - essentially, the first time it is called it immediately re-enqueues itself. Extending that to handle thenables seems fairly straight-forward. All of this would be easier if we first change JSRuntime::enqueuePromiseJob to take a JSObject instead of a JSFunction, with an added JSAPI function ExecutePromiseJob that knows how to handle a job. This object would be a PromiseReactionRecord containing the required information. bz tells me that changing Gecko to enable JSObjects as promise jobs instead of JSFunctions wouldn't be trivial though, so this won't happen right-away.
Reporter | ||
Comment 3•8 years ago
|
||
filed bug 1315756 for optimizing throwawayCapability out, that is in step 7 https://tc39.github.io/ecmascript-asyncawait/#abstract-ops-async-function-await to be clear, this bug corresponds to step 2.
See Also: → 1315756
Comment 4•7 years ago
|
||
Mass wontfix for bugs affecting firefox 52.
Updated•7 years ago
|
Keywords: triage-deferred
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
Comment 5•7 months ago
|
||
As I read this bug, it seems to me this behaviour is now specified as part of 27.2.4.7.1 PromiseResolve ( C, x ); have I misunderstood or can we close this bug?
Flags: needinfo?(arai.unmht)
Reporter | ||
Comment 6•7 months ago
|
||
Yes, the promise allocation around await
had been rewritten in the spec, and this issue no longer exists.
Status: NEW → RESOLVED
Closed: 7 months ago
Flags: needinfo?(arai.unmht)
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•