5 #ifndef V8_OBJECTS_JS_PROMISE_H_ 6 #define V8_OBJECTS_JS_PROMISE_H_ 8 #include "src/objects/js-objects.h" 9 #include "src/objects/promise.h" 12 #include "src/objects/object-macros.h" 31 DECL_ACCESSORS(reactions_or_result,
Object)
34 inline Object* result()
const;
37 inline Object* reactions()
const;
39 DECL_INT_ACCESSORS(flags)
42 DECL_BOOLEAN_ACCESSORS(has_handler)
46 DECL_BOOLEAN_ACCESSORS(handled_hint)
48 int async_task_id()
const;
49 void set_async_task_id(
int id);
60 bool debug_event =
true);
71 #define JS_PROMISE_FIELDS(V) \ 72 V(kReactionsOrResultOffset, kTaggedSize) \ 73 V(kFlagsOffset, kTaggedSize) \ 77 DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_PROMISE_FIELDS)
78 #undef JS_PROMISE_FIELDS 80 static const int kSizeWithEmbedderFields =
81 kSize + v8::Promise::kEmbedderFieldCount * kEmbedderDataSlotSize;
85 static const int kStatusBits = 2;
86 static const int kHasHandlerBit = 2;
87 static const int kHandledHintBit = 3;
90 static const int kStatusShift = 0;
91 static const int kStatusMask = 0x3;
92 STATIC_ASSERT(v8::Promise::kPending == 0);
93 STATIC_ASSERT(v8::Promise::kFulfilled == 1);
94 STATIC_ASSERT(v8::Promise::kRejected == 2);
101 PromiseReaction::Type
type);
107 #include "src/objects/object-macros-undef.h" 109 #endif // V8_OBJECTS_JS_PROMISE_H_