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

Side by Side Diff: src/ast/ast-literal-reindexer.h

Issue 1537683002: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ast/ast-value-factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_AST_LITERAL_REINDEXER 5 #ifndef V8_AST_AST_LITERAL_REINDEXER
6 #define V8_AST_AST_LITERAL_REINDEXER 6 #define V8_AST_AST_LITERAL_REINDEXER
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 class AstLiteralReindexer final : public AstVisitor { 14 class AstLiteralReindexer final : public AstVisitor {
15 public: 15 public:
16 AstLiteralReindexer() : AstVisitor(), next_index_(0) {} 16 AstLiteralReindexer() : AstVisitor(), next_index_(0) {}
17 17
18 int count() const { return next_index_; } 18 int count() const { return next_index_; }
19 void Reindex(Expression* pattern); 19 void Reindex(Expression* pattern);
20 int NextIndex() { return next_index_++; }
21 20
22 private: 21 private:
23 #define DEFINE_VISIT(type) void Visit##type(type* node) override; 22 #define DEFINE_VISIT(type) void Visit##type(type* node) override;
24 AST_NODE_LIST(DEFINE_VISIT) 23 AST_NODE_LIST(DEFINE_VISIT)
25 #undef DEFINE_VISIT 24 #undef DEFINE_VISIT
26 25
27 void VisitStatements(ZoneList<Statement*>* statements) override; 26 void VisitStatements(ZoneList<Statement*>* statements) override;
28 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; 27 void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
29 void VisitArguments(ZoneList<Expression*>* arguments); 28 void VisitArguments(ZoneList<Expression*>* arguments);
30 void VisitObjectLiteralProperty(ObjectLiteralProperty* property); 29 void VisitObjectLiteralProperty(ObjectLiteralProperty* property);
31 30
32 void UpdateIndex(MaterializedLiteral* literal) { 31 void UpdateIndex(MaterializedLiteral* literal) {
33 literal->literal_index_ = next_index_++; 32 literal->literal_index_ = next_index_++;
34 } 33 }
35 34
36 void Visit(AstNode* node) override { node->Accept(this); } 35 void Visit(AstNode* node) override { node->Accept(this); }
37 36
38 int next_index_; 37 int next_index_;
39 38
40 DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer); 39 DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer);
41 }; 40 };
42 } // namespace internal 41 } // namespace internal
43 } // namespace v8 42 } // namespace v8
44 43
45 #endif // V8_AST_AST_LITERAL_REINDEXER 44 #endif // V8_AST_AST_LITERAL_REINDEXER
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ast/ast-value-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698