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

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

Issue 2637523002: [promises] Clean up promise utils and remove dead code (Closed)
Patch Set: Fix nits 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 | « BUILD.gn ('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 #include "src/contexts.h"
6 7
7 namespace v8 { 8 namespace v8 {
8 namespace internal { 9 namespace internal {
9 10
10 typedef compiler::Node Node; 11 typedef compiler::Node Node;
11 typedef CodeStubAssembler::ParameterMode ParameterMode; 12 typedef CodeStubAssembler::ParameterMode ParameterMode;
12 typedef compiler::CodeAssemblerState CodeAssemblerState; 13 typedef compiler::CodeAssemblerState CodeAssemblerState;
13 14
14 class PromiseBuiltinsAssembler : public CodeStubAssembler { 15 class PromiseBuiltinsAssembler : public CodeStubAssembler {
15 public: 16 public:
17 enum PromiseResolvingFunctionContextSlot {
18 // Whether the resolve/reject callback was already called.
19 kAlreadyVisitedSlot = Context::MIN_CONTEXT_SLOTS,
20
21 // The promise which resolve/reject callbacks fulfill.
22 kPromiseSlot,
23
24 // Whether to trigger a debug event or not. Used in catch
25 // prediction.
26 kDebugEventSlot,
27 kPromiseContextLength,
28 };
29
30 enum FunctionContextSlot {
31 kCapabilitySlot = Context::MIN_CONTEXT_SLOTS,
32
33 kCapabilitiesContextLength,
34 };
35
16 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state) 36 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state)
17 : CodeStubAssembler(state) {} 37 : CodeStubAssembler(state) {}
18
19 // These allocate and initialize a promise with pending state and 38 // These allocate and initialize a promise with pending state and
20 // undefined fields. 39 // undefined fields.
21 // 40 //
22 // This uses undefined as the parent promise for the promise init 41 // This uses undefined as the parent promise for the promise init
23 // hook. 42 // hook.
24 Node* AllocateAndInitJSPromise(Node* context); 43 Node* AllocateAndInitJSPromise(Node* context);
25 // This uses the given parent as the parent promise for the promise 44 // This uses the given parent as the parent promise for the promise
26 // init hook. 45 // init hook.
27 Node* AllocateAndInitJSPromise(Node* context, Node* parent); 46 Node* AllocateAndInitJSPromise(Node* context, Node* parent);
28 47
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 bool debug_event); 111 bool debug_event);
93 void InternalPromiseReject(Node* context, Node* promise, Node* value, 112 void InternalPromiseReject(Node* context, Node* promise, Node* value,
94 Node* debug_event); 113 Node* debug_event);
95 114
96 private: 115 private:
97 Node* AllocateJSPromise(Node* context); 116 Node* AllocateJSPromise(Node* context);
98 }; 117 };
99 118
100 } // namespace internal 119 } // namespace internal
101 } // namespace v8 120 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins-promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698