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

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

Issue 2637523002: [promises] Clean up promise utils and remove dead code (Closed)
Patch Set: 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 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;
11 typedef CodeStubAssembler::ParameterMode ParameterMode; 11 typedef CodeStubAssembler::ParameterMode ParameterMode;
12 typedef compiler::CodeAssemblerState CodeAssemblerState; 12 typedef compiler::CodeAssemblerState CodeAssemblerState;
13 13
14 class PromiseBuiltinsAssembler : public CodeStubAssembler { 14 class PromiseBuiltinsAssembler : public CodeStubAssembler {
15 public: 15 public:
16 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state) 16 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state)
17 : CodeStubAssembler(state) {} 17 : CodeStubAssembler(state) {}
18 18
19 enum PromiseResolvingFunctionContextSlot {
adamk 2017/01/13 22:45:08 Style: These enums should go at the top of the pub
gsathya 2017/01/17 16:36:47 Done.
20 // Whether the resolve/reject callback was already called.
21 kAlreadyVisitedSlot = Context::MIN_CONTEXT_SLOTS,
adamk 2017/01/13 22:45:08 Please add an #include for contexts.h
gsathya 2017/01/17 16:36:47 Done.
22
23 // The promise which resolve/reject callbacks fulfill.
24 kPromiseSlot,
25
26 // Whether to trigger a debug event or not. Used in catch
27 // prediction.
28 kDebugEventSlot,
29 kPromiseContextLength,
30 };
31
32 enum FunctionContextSlot {
33 kCapabilitySlot = Context::MIN_CONTEXT_SLOTS,
34
35 kCapabilitiesContextLength,
36 };
37
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 109
91 void InternalPromiseReject(Node* context, Node* promise, Node* value, 110 void InternalPromiseReject(Node* context, Node* promise, Node* value,
92 Node* debug_event); 111 Node* debug_event);
93 112
94 private: 113 private:
95 Node* AllocateJSPromise(Node* context); 114 Node* AllocateJSPromise(Node* context);
96 }; 115 };
97 116
98 } // namespace internal 117 } // namespace internal
99 } // namespace v8 118 } // 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