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

Unified Diff: src/ast/ast.h

Issue 1564083002: Add spread rewriting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase to remove things added in separate CLs Created 4 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 | « no previous file | src/parsing/parser.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 7f00955a644fcaeeeca1be192c67a5afa7ec0b70..54b5c4eca782ff616259a0bcce409b46dcf6fa0e 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1683,6 +1683,19 @@ class ArrayLiteral final : public MaterializedLiteral {
return flags;
}
+ // Provide a mechanism for iterating through values to rewrite spreads.
+ ZoneList<Expression*>::iterator FirstSpread() const {
+ return (first_spread_index_ >= 0) ? values_->begin() + first_spread_index_
+ : values_->end();
+ }
+ ZoneList<Expression*>::iterator EndValue() const { return values_->end(); }
+
+ // Rewind an array literal omitting everything from the first spread on.
+ void RewindSpreads() {
+ values_->Rewind(first_spread_index_);
+ first_spread_index_ = -1;
+ }
+
enum Flags {
kNoFlags = 0,
kShallowElements = 1,
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698