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

[promises] Port promise deopt continuation to torque.

Bug: v8:9838
Change-Id: If2cbae09eb0628cd4d29bb1768d1ef7d1659e683
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1990128
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65641}
parent fb26d0bb
......@@ -711,8 +711,6 @@ namespace internal {
TFS(ForInFilter, kKey, kObject) \
\
/* Promise */ \
TFJ(PromiseConstructorLazyDeoptContinuation, 4, kReceiver, kPromise, \
kReject, kException, kResult) \
CPP(IsPromise) \
/* ES #sec-promise.all */ \
TFJ(PromiseAll, 1, kReceiver, kIterable) \
......
......@@ -380,22 +380,6 @@ void PromiseBuiltinsAssembler::SetPromiseHandledByIfTrue(
BIND(&done);
}
TF_BUILTIN(PromiseConstructorLazyDeoptContinuation, PromiseBuiltinsAssembler) {
TNode<Object> promise = CAST(Parameter(Descriptor::kPromise));
Node* reject = Parameter(Descriptor::kReject);
Node* exception = Parameter(Descriptor::kException);
Node* const context = Parameter(Descriptor::kContext);
Label finally(this);
GotoIf(IsTheHole(exception), &finally);
CallJS(CodeFactory::Call(isolate(), ConvertReceiverMode::kNotNullOrUndefined),
context, reject, UndefinedConstant(), exception);
Goto(&finally);
BIND(&finally);
Return(promise);
}
TNode<Object> PromiseBuiltinsAssembler::PerformPromiseAll(
Node* context, Node* constructor, Node* capability,
......
......@@ -535,4 +535,19 @@ namespace promise {
return Call(context, UnsafeCast<Callable>(resolve), constructor, value);
}
}
transitioning javascript builtin
PromiseConstructorLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
promise: JSAny, reject: JSAny, exception: JSAny|TheHole,
_result: JSAny): JSAny {
typeswitch (exception) {
case (e: JSAny): {
Call(context, reject, Undefined, e);
}
case (TheHole): {
}
}
return promise;
}
}
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