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

Unified Diff: src/ast/ast.h

Issue 1695393003: [es6] Implement for-of iterator finalization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable iterator test for Ignition 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.cc » ('j') | no next file with comments »
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..0dc76372cc941ff8d302663e540d6e38cbf440ef 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -199,8 +199,8 @@ class AstNode: public ZoneObject {
#ifdef DEBUG
void PrettyPrint(Isolate* isolate);
void PrettyPrint();
- void PrintAst(Isolate* isolate);
- void PrintAst();
+ void Print(Isolate* isolate);
+ void Print();
#endif // DEBUG
// Type testing & conversion functions overridden by concrete subclasses.
@@ -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_;
+ }
+
// 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.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698