5 #ifndef V8_OBJECTS_PROMISE_H_ 6 #define V8_OBJECTS_PROMISE_H_ 8 #include "src/objects/microtask.h" 11 #include "src/objects/object-macros.h" 29 DECL_ACCESSORS(argument,
Object)
30 DECL_ACCESSORS2(context,
Context)
34 DECL_ACCESSORS(promise_or_capability,
HeapObject)
36 static const int kArgumentOffset = Microtask::kHeaderSize;
37 static const int kContextOffset = kArgumentOffset + kPointerSize;
38 static const int kHandlerOffset = kContextOffset + kPointerSize;
39 static const int kPromiseOrCapabilityOffset = kHandlerOffset + kPointerSize;
40 static const int kSize = kPromiseOrCapabilityOffset + kPointerSize;
77 DECL_ACCESSORS2(context,
Context)
78 DECL_ACCESSORS(promise_to_resolve,
JSPromise)
82 static const int kContextOffset = Microtask::kHeaderSize;
83 static const int kPromiseToResolveOffset = kContextOffset + kPointerSize;
84 static const int kThenOffset = kPromiseToResolveOffset + kPointerSize;
85 static const int kThenableOffset = kThenOffset + kPointerSize;
86 static const int kSize = kThenableOffset + kPointerSize;
101 DECL_ACCESSORS(resolve,
Object)
102 DECL_ACCESSORS(reject,
Object)
104 static const int kPromiseOffset = Struct::kHeaderSize;
105 static const int kResolveOffset = kPromiseOffset + kPointerSize;
106 static const int kRejectOffset = kResolveOffset + kPointerSize;
107 static const int kSize = kRejectOffset + kPointerSize;
137 enum Type { kFulfill, kReject };
139 DECL_ACCESSORS(next,
Object)
144 DECL_ACCESSORS(promise_or_capability,
HeapObject)
146 static const int kNextOffset = Struct::kHeaderSize;
147 static const int kRejectHandlerOffset = kNextOffset + kPointerSize;
148 static const int kFulfillHandlerOffset = kRejectHandlerOffset + kPointerSize;
149 static const int kPromiseOrCapabilityOffset =
150 kFulfillHandlerOffset + kPointerSize;
151 static const int kSize = kPromiseOrCapabilityOffset + kPointerSize;
165 #include "src/objects/object-macros-undef.h" 167 #endif // V8_OBJECTS_PROMISE_H_