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

Unified Diff: src/objects-printer.cc

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap Created 3 years, 11 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/objects-inl.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 9e7cc25d0b9b592dc36a827c38269599e18ecaae..b704b1dab61157e0765b9cfcd9c880c62d1b45ec 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -150,6 +150,7 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT
case JS_SPECIAL_API_OBJECT_TYPE:
case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
case JS_GENERATOR_OBJECT_TYPE:
+ case JS_ASYNC_GENERATOR_OBJECT_TYPE:
case JS_ARGUMENTS_TYPE:
case JS_ERROR_TYPE:
case JS_PROMISE_CAPABILITY_TYPE:
@@ -239,6 +240,9 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT
case JS_DATA_VIEW_TYPE:
JSDataView::cast(this)->JSDataViewPrint(os);
break;
+ case JS_ASYNC_FROM_SYNC_ITERATOR_TYPE:
+ JSAsyncFromSyncIterator::cast(this)->JSAsyncFromSyncIteratorPrint(os);
+ break;
#define MAKE_STRUCT_CASE(NAME, Name, name) \
case NAME##_TYPE: \
Name::cast(this)->Name##Print(os); \
@@ -1264,6 +1268,27 @@ void PromiseReactionJobInfo::PromiseReactionJobInfoPrint(
os << "\n";
}
+void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(
+ std::ostream& os) { // NOLINT
+ HeapObject::PrintHeader(os, "AsyncGeneratorRequest");
+ const char* mode = "Invalid!";
+ switch (resume_mode()) {
+ case JSGeneratorObject::kNext:
+ mode = ".next()";
+ break;
+ case JSGeneratorObject::kReturn:
+ mode = ".return()";
+ break;
+ case JSGeneratorObject::kThrow:
+ mode = ".throw()";
+ break;
+ }
+ os << "\n - resume mode: " << mode;
+ os << "\n - value: " << Brief(value());
+ os << "\n - next: " << Brief(next());
+ os << "\n";
+}
+
void ModuleInfoEntry::ModuleInfoEntryPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "ModuleInfoEntry");
os << "\n - export_name: " << Brief(export_name());
@@ -1603,6 +1628,13 @@ void TransitionArray::Print() {
os << "\n" << std::flush;
}
+void JSAsyncFromSyncIterator::JSAsyncFromSyncIteratorPrint(
+ std::ostream& os) { // NOLINT
+ HeapObject::PrintHeader(os, "JSAsyncFromSyncIterator");
+ std::stringstream ss;
+ os << "\n sync_iterator: " << Brief(sync_iterator());
+ os << "\n";
+}
void TransitionArray::PrintTransitions(std::ostream& os, Object* transitions,
bool print_header) { // NOLINT
« no previous file with comments | « src/objects-inl.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698