Commit e9811a74 authored by Joshua Litt's avatar Joshua Litt Committed by Commit Bot

[promises] Add back deferred labels to PromiseThen

Bug: v8:9838, chromium:1028016
Change-Id: Iae195ac12c8fc01506f04ed5e62fc3c0983c56e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1944280Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65295}
parent cfd32bee
......@@ -84,10 +84,10 @@ namespace promise {
try {
return ExtractHandlerContext(primary) otherwise NotFound;
}
label NotFound {
label NotFound deferred {
return ExtractHandlerContext(secondary) otherwise Default;
}
label Default {
label Default deferred {
return context;
}
}
......@@ -449,15 +449,16 @@ namespace promise {
map = PromiseFulfillReactionJobTaskMapConstant();
handler = onFulfilled;
handlerContext = ExtractHandlerContext(onFulfilled, onRejected);
} else {
assert(promise.Status() == kPromiseRejected);
map = PromiseRejectReactionJobTaskMapConstant();
handler = onRejected;
handlerContext = ExtractHandlerContext(onRejected, onFulfilled);
if (!promise.HasHandler()) {
runtime::PromiseRevokeReject(promise);
} else
deferred {
assert(promise.Status() == kPromiseRejected);
map = PromiseRejectReactionJobTaskMapConstant();
handler = onRejected;
handlerContext = ExtractHandlerContext(onRejected, onFulfilled);
if (!promise.HasHandler()) {
runtime::PromiseRevokeReject(promise);
}
}
}
const reactionsOrResult = promise.reactions_or_result;
const microtask = AllocatePromiseReactionJobTask(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment