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

Unified Diff: src/ast/ast.h

Issue 1695583003: [WIP] for-of iterator finalization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | src/parsing/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 0174a13478c458671a60bb0b0041e9c00acddf60..21cafcce3e2daa9e80cd3afbacb8bf3e7a60f1fd 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -883,11 +883,13 @@ class ForOfStatement final : public ForEachStatement {
void Initialize(Expression* each,
Expression* subject,
Statement* body,
+ Variable* iterator,
Expression* assign_iterator,
Expression* next_result,
Expression* result_done,
Expression* assign_each) {
ForEachStatement::Initialize(each, subject, body);
+ iterator_ = iterator;
assign_iterator_ = assign_iterator;
next_result_ = next_result;
result_done_ = result_done;
@@ -898,6 +900,10 @@ class ForOfStatement final : public ForEachStatement {
return subject();
}
+ Variable* iterator() const {
+ return iterator_;
+ }
+
neis 2016/02/12 12:30:13 Instead of having iterator_, we could extract the
// iterator = subject[Symbol.iterator]()
Expression* assign_iterator() const {
return assign_iterator_;
@@ -932,6 +938,7 @@ class ForOfStatement final : public ForEachStatement {
protected:
ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
: ForEachStatement(zone, labels, pos),
+ iterator_(NULL),
assign_iterator_(NULL),
next_result_(NULL),
result_done_(NULL),
@@ -941,6 +948,7 @@ class ForOfStatement final : public ForEachStatement {
private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+ Variable* iterator_;
Expression* assign_iterator_;
Expression* next_result_;
Expression* result_done_;
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698