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

Unified Diff: src/ast/ast-numbering.h

Issue 1927943003: Assign yield ids in ast-numbering rather than in bytecode-generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/ast/ast-numbering.h
diff --git a/src/ast/ast-numbering.h b/src/ast/ast-numbering.h
index 9c178b4c517743a218a3b4524e98bb8c99ea6a2c..c9c003c9501a3560846c0125289343babc1b87e8 100644
--- a/src/ast/ast-numbering.h
+++ b/src/ast/ast-numbering.h
@@ -14,12 +14,25 @@ class Isolate;
class Zone;
namespace AstNumbering {
-// Assign type feedback IDs and bailout IDs to an AST node tree. For a
-// generator function, also annotate the function itself and any loops therein
-// with the number of contained yields.
+// Assign type feedback IDs, bailout IDs, and generator yield IDs to an AST node
+// tree.
bool Renumber(Isolate* isolate, Zone* zone, FunctionLiteral* function);
}
+// Some details on yield IDs
+// -------------------------
+//
+// In order to assist Ignition in generating bytecode for a generator function,
+// we assign a unique number (the yield ID) to each Yield node in its AST. We
+// also annotate loops with the number of yields they contain
+// (loop->yield_count()) and the smallest ID of those (loop->first_yield_id()),
+// and we annotate the function itself with the number of yields it contains
+// (function->yield_count()).
+//
+// The way in which we choose the IDs is simply by enumerating the Yield nodes,
+// starting with 0. While Ignition does not completely depend on this particular
+// scheme, it does rely on some of its properties.
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698