• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_OBJECTS_PROMISE_INL_H_
6 #define V8_OBJECTS_PROMISE_INL_H_
7 
8 #include "src/objects/js-promise-inl.h"
9 #include "src/objects/promise.h"
10 
11 // Has to be the last include (doesn't have include guards):
12 #include "src/objects/object-macros.h"
13 
14 namespace v8 {
15 namespace internal {
16 
17 CAST_ACCESSOR(PromiseCapability)
18 CAST_ACCESSOR(PromiseReaction)
19 CAST_ACCESSOR(PromiseReactionJobTask)
20 CAST_ACCESSOR(PromiseFulfillReactionJobTask)
21 CAST_ACCESSOR(PromiseRejectReactionJobTask)
22 CAST_ACCESSOR(PromiseResolveThenableJobTask)
23 
24 ACCESSORS(PromiseReaction, next, Object, kNextOffset)
25 ACCESSORS(PromiseReaction, reject_handler, HeapObject, kRejectHandlerOffset)
26 ACCESSORS(PromiseReaction, fulfill_handler, HeapObject, kFulfillHandlerOffset)
27 ACCESSORS(PromiseReaction, promise_or_capability, HeapObject,
28           kPromiseOrCapabilityOffset)
29 
30 ACCESSORS(PromiseResolveThenableJobTask, context, Context, kContextOffset)
31 ACCESSORS(PromiseResolveThenableJobTask, promise_to_resolve, JSPromise,
32           kPromiseToResolveOffset)
33 ACCESSORS(PromiseResolveThenableJobTask, then, JSReceiver, kThenOffset)
34 ACCESSORS(PromiseResolveThenableJobTask, thenable, JSReceiver, kThenableOffset)
35 
36 ACCESSORS(PromiseReactionJobTask, context, Context, kContextOffset)
37 ACCESSORS(PromiseReactionJobTask, argument, Object, kArgumentOffset);
38 ACCESSORS(PromiseReactionJobTask, handler, HeapObject, kHandlerOffset);
39 ACCESSORS(PromiseReactionJobTask, promise_or_capability, HeapObject,
40           kPromiseOrCapabilityOffset);
41 
42 ACCESSORS(PromiseCapability, promise, HeapObject, kPromiseOffset)
43 ACCESSORS(PromiseCapability, resolve, Object, kResolveOffset)
44 ACCESSORS(PromiseCapability, reject, Object, kRejectOffset)
45 
46 }  // namespace internal
47 }  // namespace v8
48 
49 #include "src/objects/object-macros-undef.h"
50 
51 #endif  // V8_OBJECTS_PROMISE_INL_H_
52