Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: src/builtins/builtins-promise.h

Issue 2695753002: [ESnext] Implement Promise.prototype.finally (Closed)
Patch Set: Rename GotoUnless Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-promise.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-promise.h
diff --git a/src/builtins/builtins-promise.h b/src/builtins/builtins-promise.h
index 9f7f456473546e08c9fbb68c74782d1189a35d56..df011822ff222ce3aecdf1d670c8b486881b88c7 100644
--- a/src/builtins/builtins-promise.h
+++ b/src/builtins/builtins-promise.h
@@ -36,6 +36,18 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
kCapabilitiesContextLength,
};
+ // This is used by the PromiseThenFinally and PromiseCatchFinally
+ // builtins to store the onFinally in the onFinallySlot.
+ //
+ // This is also used by the PromiseValueThunkFinally to store the
+ // value in the onFinallySlot and PromiseThrowerFinally to store the
+ // reason in the onFinallySlot.
+ enum PromiseFinallyContextSlot {
+ kOnFinallySlot = Context::MIN_CONTEXT_SLOTS,
+
+ kOnFinallyContextLength,
+ };
+
explicit PromiseBuiltinsAssembler(CodeAssemblerState* state)
: CodeStubAssembler(state) {}
// These allocate and initialize a promise with pending state and
@@ -115,6 +127,15 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
bool debug_event);
void InternalPromiseReject(Node* context, Node* promise, Node* value,
Node* debug_event);
+ std::pair<Node*, Node*> CreatePromiseFinallyFunctions(Node* on_finally,
+ Node* native_context);
+ Node* CreatePromiseFinallyContext(Node* on_finally, Node* native_context);
+
+ Node* CreateValueThunkFunction(Node* value, Node* native_context);
+ Node* CreateValueThunkFunctionContext(Node* value, Node* native_context);
+
+ Node* CreateThrowerFunctionContext(Node* reason, Node* native_context);
+ Node* CreateThrowerFunction(Node* reason, Node* native_context);
private:
Node* AllocateJSPromise(Node* context);
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698