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

Unified Diff: src/objects.h

Issue 2567333002: [promises] port NewPromiseCapability to TF (Closed)
Patch Set: Make gcmole happy Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/promise.js ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index b7055d10cbce70c9eea0ac4bb0e076cb476ab1ae..816322955b3283ab2f575042fb3d1dca9efacc10 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -422,6 +422,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(JS_MAP_ITERATOR_TYPE) \
V(JS_WEAK_MAP_TYPE) \
V(JS_WEAK_SET_TYPE) \
+ V(JS_PROMISE_CAPABILITY_TYPE) \
V(JS_PROMISE_TYPE) \
V(JS_REGEXP_TYPE) \
V(JS_ERROR_TYPE) \
@@ -767,6 +768,7 @@ enum InstanceType {
JS_MAP_ITERATOR_TYPE,
JS_WEAK_MAP_TYPE,
JS_WEAK_SET_TYPE,
+ JS_PROMISE_CAPABILITY_TYPE,
JS_PROMISE_TYPE,
JS_REGEXP_TYPE,
JS_ERROR_TYPE,
@@ -1089,6 +1091,7 @@ template <class C> inline bool Is(Object* obj);
V(JSDataView) \
V(JSProxy) \
V(JSError) \
+ V(JSPromiseCapability) \
V(JSPromise) \
V(JSStringIterator) \
V(JSSet) \
@@ -8638,6 +8641,36 @@ class JSMessageObject: public JSObject {
kSize> BodyDescriptor;
};
+class JSPromise;
+
+// TODO(caitp): Make this a Struct once properties are no longer accessed from
+// JS
+class JSPromiseCapability : public JSObject {
+ public:
+ DECLARE_CAST(JSPromiseCapability)
+
+ DECLARE_VERIFIER(JSPromiseCapability)
+
+ DECL_ACCESSORS(promise, Object)
+ DECL_ACCESSORS(resolve, Object)
+ DECL_ACCESSORS(reject, Object)
+
+ static const int kPromiseOffset = JSObject::kHeaderSize;
+ static const int kResolveOffset = kPromiseOffset + kPointerSize;
+ static const int kRejectOffset = kResolveOffset + kPointerSize;
+ static const int kSize = kRejectOffset + kPointerSize;
+
+ enum InObjectPropertyIndex {
+ kPromiseIndex,
+ kResolveIndex,
+ kRejectIndex,
+ kInObjectPropertyCount // Dummy.
+ };
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSPromiseCapability);
+};
+
class JSPromise : public JSObject {
public:
DECL_INT_ACCESSORS(status)
« no previous file with comments | « src/js/promise.js ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698