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

Unified Diff: src/objects.h

Issue 2645313003: [async-iteration] implement Async-from-Sync Iterator (Closed)
Patch Set: more stuff Created 3 years, 10 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index a8d26f41f22c29336ef6e76068ef23db8dac9589..935c508f183d9ac9acf4f7d2a6b41ba4fc7a7862 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -398,6 +398,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(JS_PROMISE_TYPE) \
V(JS_REGEXP_TYPE) \
V(JS_ERROR_TYPE) \
+ V(JS_ASYNC_FROM_SYNC_ITERATOR_TYPE) \
V(JS_STRING_ITERATOR_TYPE) \
\
V(JS_TYPED_ARRAY_KEY_ITERATOR_TYPE) \
@@ -743,6 +744,7 @@ enum InstanceType {
JS_PROMISE_TYPE,
JS_REGEXP_TYPE,
JS_ERROR_TYPE,
+ JS_ASYNC_FROM_SYNC_ITERATOR_TYPE,
JS_STRING_ITERATOR_TYPE,
JS_TYPED_ARRAY_KEY_ITERATOR_TYPE,
@@ -1039,6 +1041,7 @@ template <class C> inline bool Is(Object* obj);
V(JSArray) \
V(JSArrayBuffer) \
V(JSArrayBufferView) \
+ V(JSAsyncFromSyncIterator) \
V(JSCollection) \
V(JSTypedArray) \
V(JSArrayIterator) \
@@ -10426,6 +10429,28 @@ class JSArrayIterator : public JSObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayIterator);
};
+class JSAsyncFromSyncIterator : public JSObject {
neis 2017/02/20 11:27:59 Please add a comment here saying what these object
caitp 2017/02/20 17:09:35 Done.
+ public:
+ DECLARE_CAST(JSAsyncFromSyncIterator)
+
neis 2017/02/20 11:27:59 nit: remove empty line.
caitp 2017/02/20 17:09:35 Done.
+ DECLARE_PRINTER(JSAsyncFromSyncIterator)
+ DECLARE_VERIFIER(JSAsyncFromSyncIterator)
+
+ // Async-from-Sync Iterator instances are ordinary objects that inherit
+ // properties from the %AsyncFromSyncIteratorPrototype% intrinsic object.
+ // Async-from-Sync Iterator instances are initially created with the internal
+ // slots listed in Table 4.
+ // (proposal-async-iteration/#table-async-from-sync-iterator-internal-slots)
+ DECL_ACCESSORS(sync_iterator, JSReceiver)
+
+ // Offsets of object fields.
+ static const int kSyncIteratorOffset = JSObject::kHeaderSize;
+ static const int kSize = kSyncIteratorOffset + kPointerSize;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSAsyncFromSyncIterator);
+};
+
class JSStringIterator : public JSObject {
public:
// Dispatched behavior.

Powered by Google App Engine
This is Rietveld 408576698