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

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

Issue 2604273003: [csa] Refactor promises API (Closed)
Patch Set: comments Created 3 years, 12 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 | « no previous file | 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 4ceedfac22b11e56a36ca0af0c41604ec711cfbb..eea91ab5c4bd65a41671b79fdd4e2fad9f0c008a 100644
--- a/src/builtins/builtins-promise.h
+++ b/src/builtins/builtins-promise.h
@@ -16,7 +16,19 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
explicit PromiseBuiltinsAssembler(CodeAssemblerState* state)
: CodeStubAssembler(state) {}
- Node* AllocateAndInitPromise(Node* context, Node* parent);
+ // These allocate and initialize a promise with pending state and
+ // undefined fields.
+ //
+ // This uses undefined as the parent promise for the promise init
+ // hook.
+ Node* AllocateAndInitJSPromise(Node* context);
+ // This uses the given parent as the parent promise for the promise
+ // init hook.
+ Node* AllocateAndInitJSPromise(Node* context, Node* parent);
+
+ // This allocates and initializes a promise with the given state and
+ // fields.
+ Node* AllocateAndSetJSPromise(Node* context, Node* status, Node* result);
Node* ThrowIfNotJSReceiver(Node* context, Node* value,
MessageTemplate::Template msg_template);
@@ -57,6 +69,12 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
Node* NewPromiseCapability(Node* context, Node* constructor,
Node* debug_event = nullptr);
+
+ protected:
+ void PromiseInit(Node* promise);
+
+ private:
+ Node* AllocateJSPromise(Node* context);
};
} // namespace internal
« no previous file with comments | « no previous file | src/builtins/builtins-promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698