Skip to content

Commit

Permalink
Bug 1495072 - Part 3: Implement new, faster proposed await semantics.…
Browse files Browse the repository at this point in the history
… r=arai

This patch implements the change in this pull request:
<tc39/ecma262#1250>

Differential Revision: https://phabricator.services.mozilla.com/D21816

UltraBlame original commit: 269654f1eeb2b6e099af2e5e3e48d07bc1488268
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent dc1e392 commit 876f717
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 8 deletions.
77 changes: 74 additions & 3 deletions js/src/builtin/Promise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14735,12 +14735,41 @@ Rooted
PromiseObject
*
>
unwrappedPromise
(
cx
)
;
if
(
cx
-
>
realm
(
)
-
>
creationOptions
(
)
.
getAwaitFixEnabled
(
)
)
{
RootedObject
promise
(
cx
CreatePromiseObjectWithoutResolutionFunctions
PromiseObject
:
:
unforgeableResolve
(
cx
value
)
)
;
Expand All @@ -14754,13 +14783,54 @@ return
false
;
}
unwrappedPromise
=
UnwrapAndDowncastObject
<
PromiseObject
>
(
cx
promise
)
;
if
(
!
unwrappedPromise
)
{
return
false
;
}
}
else
{
unwrappedPromise
=
CreatePromiseObjectWithoutResolutionFunctions
(
cx
)
;
if
(
!
unwrappedPromise
)
{
return
false
;
}
if
(
!
ResolvePromiseInternal
(
cx
promise
unwrappedPromise
value
)
)
Expand All @@ -14769,6 +14839,7 @@ return
false
;
}
}
Rooted
<
PromiseCapability
Expand Down Expand Up @@ -14829,7 +14900,7 @@ return
PerformPromiseThenWithReaction
(
cx
promise
unwrappedPromise
reaction
)
;
Expand Down
7 changes: 2 additions & 5 deletions js/src/jit-test/tests/debug/onEnterFrame-async-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,10 @@ repeat
+
"
(
job
t5
)
"
+
"
(
t5
job
)
(
t5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,13 @@ resolve
(
)
;
await
Promise
.
resolve
(
)
;
worker
.
terminate
Expand Down

0 comments on commit 876f717

Please sign in to comment.