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

Side by Side Diff: src/builtins/builtins-promise.h

Issue 2592933004: [promises] Move Promise.resolve to TF (Closed)
Patch Set: fix rebase Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-promise.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/code-stub-assembler.h" 5 #include "src/code-stub-assembler.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 typedef compiler::Node Node; 10 typedef compiler::Node Node;
(...skipping 13 matching lines...) Expand all
24 Node* AllocateAndInitJSPromise(Node* context); 24 Node* AllocateAndInitJSPromise(Node* context);
25 // This uses the given parent as the parent promise for the promise 25 // This uses the given parent as the parent promise for the promise
26 // init hook. 26 // init hook.
27 Node* AllocateAndInitJSPromise(Node* context, Node* parent); 27 Node* AllocateAndInitJSPromise(Node* context, Node* parent);
28 28
29 // This allocates and initializes a promise with the given state and 29 // This allocates and initializes a promise with the given state and
30 // fields. 30 // fields.
31 Node* AllocateAndSetJSPromise(Node* context, Node* status, Node* result); 31 Node* AllocateAndSetJSPromise(Node* context, Node* status, Node* result);
32 32
33 Node* ThrowIfNotJSReceiver(Node* context, Node* value, 33 Node* ThrowIfNotJSReceiver(Node* context, Node* value,
34 MessageTemplate::Template msg_template); 34 MessageTemplate::Template msg_template,
35 const char* method_name = nullptr);
35 36
36 Node* SpeciesConstructor(Node* context, Node* object, 37 Node* SpeciesConstructor(Node* context, Node* object,
37 Node* default_constructor); 38 Node* default_constructor);
38 39
39 Node* PromiseHasHandler(Node* promise); 40 Node* PromiseHasHandler(Node* promise);
40 41
41 void PromiseSetHasHandler(Node* promise); 42 void PromiseSetHasHandler(Node* promise);
42 43
43 void AppendPromiseCallback(int offset, compiler::Node* promise, 44 void AppendPromiseCallback(int offset, compiler::Node* promise,
44 compiler::Node* value); 45 compiler::Node* value);
45 46
46 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve, 47 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve,
47 Node* on_reject); 48 Node* on_reject);
48 49
49 Node* InternalPerformPromiseThen(Node* context, Node* promise, 50 Node* InternalPerformPromiseThen(Node* context, Node* promise,
50 Node* on_resolve, Node* on_reject, 51 Node* on_resolve, Node* on_reject,
51 Node* deferred_promise, 52 Node* deferred_promise,
52 Node* deferred_on_resolve, 53 Node* deferred_on_resolve,
53 Node* deferred_on_reject); 54 Node* deferred_on_reject);
54 55
55 void InternalResolvePromise(Node* context, Node* promise, Node* result); 56 void InternalResolvePromise(Node* context, Node* promise, Node* result);
56 57
57 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified, 58 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified,
58 Label* if_ismodified); 59 Label* if_ismodified);
59 60
61 void BranchIfFastPath(Node* native_context, Node* promise_fun, Node* promise,
62 Label* if_isunmodified, Label* if_ismodified);
63
60 Node* CreatePromiseContext(Node* native_context, int slots); 64 Node* CreatePromiseContext(Node* native_context, int slots);
61 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event, 65 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event,
62 Node* native_context); 66 Node* native_context);
63 67
64 std::pair<Node*, Node*> CreatePromiseResolvingFunctions( 68 std::pair<Node*, Node*> CreatePromiseResolvingFunctions(
65 Node* promise, Node* native_context, Node* promise_context); 69 Node* promise, Node* native_context, Node* promise_context);
66 70
67 Node* CreatePromiseGetCapabilitiesExecutorContext(Node* native_context, 71 Node* CreatePromiseGetCapabilitiesExecutorContext(Node* native_context,
68 Node* promise_capability); 72 Node* promise_capability);
69 73
70 void PromiseFulfill(Node* context, Node* promise, Node* result, 74 void PromiseFulfill(Node* context, Node* promise, Node* result,
71 v8::Promise::PromiseState status); 75 v8::Promise::PromiseState status);
72 76
73 Node* NewPromiseCapability(Node* context, Node* constructor, 77 Node* NewPromiseCapability(Node* context, Node* constructor,
74 Node* debug_event = nullptr); 78 Node* debug_event = nullptr);
75 79
76 protected: 80 protected:
77 void PromiseInit(Node* promise); 81 void PromiseInit(Node* promise);
78 82
79 private: 83 private:
80 Node* AllocateJSPromise(Node* context); 84 Node* AllocateJSPromise(Node* context);
81 }; 85 };
82 86
83 } // namespace internal 87 } // namespace internal
84 } // namespace v8 88 } // namespace v8
OLDNEW
« 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