Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/src/ast/ast-numbering.h b/src/ast/ast-numbering.h
index 0ac1ef2..a1d3137 100644
--- a/src/ast/ast-numbering.h
+++ b/src/ast/ast-numbering.h
@@ -14,11 +14,27 @@
class Zone;
namespace AstNumbering {
-// Assign type feedback IDs and bailout IDs to an AST node tree.
-//
+// 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.
+// Ignition relies on the following properties:
+// - For each loop l and each yield y of l:
+// l.first_yield_id <= y.yield_id < l.first_yield_id + l.yield_count
+// - For the generator function f itself and each yield y of f:
+// 0 <= y.yield_id < f.yield_count
+
} // namespace internal
} // namespace v8