OLD | NEW |
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_LITERAL_REINDEXER | 5 #ifndef V8_AST_LITERAL_REINDEXER |
6 #define V8_AST_LITERAL_REINDEXER | 6 #define V8_AST_LITERAL_REINDEXER |
7 | 7 |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/scopes.h" | 9 #include "src/scopes.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 void VisitStatements(ZoneList<Statement*>* statements) override; | 26 void VisitStatements(ZoneList<Statement*>* statements) override; |
27 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; | 27 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; |
28 void VisitArguments(ZoneList<Expression*>* arguments); | 28 void VisitArguments(ZoneList<Expression*>* arguments); |
29 void VisitObjectLiteralProperty(ObjectLiteralProperty* property); | 29 void VisitObjectLiteralProperty(ObjectLiteralProperty* property); |
30 | 30 |
31 void UpdateIndex(MaterializedLiteral* literal) { | 31 void UpdateIndex(MaterializedLiteral* literal) { |
32 literal->literal_index_ = next_index_++; | 32 literal->literal_index_ = next_index_++; |
33 } | 33 } |
34 | 34 |
| 35 void UpdateIndex(RestParameter* pseudo_literal) { |
| 36 pseudo_literal->literal_index_ = next_index_++; |
| 37 } |
| 38 |
35 void Visit(AstNode* node) override { node->Accept(this); } | 39 void Visit(AstNode* node) override { node->Accept(this); } |
36 | 40 |
37 int next_index_; | 41 int next_index_; |
38 | 42 |
39 DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer); | 43 DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer); |
40 }; | 44 }; |
41 } | 45 } |
42 } // namespace v8::internal | 46 } // namespace v8::internal |
43 | 47 |
44 #endif // V8_AST_LITERAL_REINDEXER | 48 #endif // V8_AST_LITERAL_REINDEXER |
OLD | NEW |