| 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 #include "src/ast/ast-literal-reindexer.h" | 5 #include "src/ast/ast-literal-reindexer.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 Visit(node->expression()); | 278 Visit(node->expression()); |
| 279 VisitArguments(node->arguments()); | 279 VisitArguments(node->arguments()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 void AstLiteralReindexer::VisitCallNew(CallNew* node) { | 283 void AstLiteralReindexer::VisitCallNew(CallNew* node) { |
| 284 Visit(node->expression()); | 284 Visit(node->expression()); |
| 285 VisitArguments(node->arguments()); | 285 VisitArguments(node->arguments()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 void AstLiteralReindexer::VisitStatements( |
| 289 void AstLiteralReindexer::VisitStatements(ZoneList<Statement*>* statements) { | 289 ZoneChunkList<Statement*>* statements) { |
| 290 if (statements == NULL) return; | 290 if (statements == NULL) return; |
| 291 for (int i = 0; i < statements->length(); i++) { | 291 for (Statement* statement : *statements) { |
| 292 Visit(statements->at(i)); | 292 Visit(statement); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 void AstLiteralReindexer::VisitDeclarations( | 297 void AstLiteralReindexer::VisitDeclarations( |
| 298 ZoneList<Declaration*>* declarations) { | 298 ZoneList<Declaration*>* declarations) { |
| 299 for (int i = 0; i < declarations->length(); i++) { | 299 for (int i = 0; i < declarations->length(); i++) { |
| 300 Visit(declarations->at(i)); | 300 Visit(declarations->at(i)); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 void AstLiteralReindexer::VisitArguments(ZoneList<Expression*>* arguments) { | 305 void AstLiteralReindexer::VisitArguments(ZoneList<Expression*>* arguments) { |
| 306 for (int i = 0; i < arguments->length(); i++) { | 306 for (int i = 0; i < arguments->length(); i++) { |
| 307 Visit(arguments->at(i)); | 307 Visit(arguments->at(i)); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 | 311 |
| 312 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { | 312 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { |
| 313 // We don't recurse into the declarations or body of the function literal: | 313 // We don't recurse into the declarations or body of the function literal: |
| 314 } | 314 } |
| 315 | 315 |
| 316 void AstLiteralReindexer::Reindex(Expression* pattern) { Visit(pattern); } | 316 void AstLiteralReindexer::Reindex(Expression* pattern) { Visit(pattern); } |
| 317 } // namespace internal | 317 } // namespace internal |
| 318 } // namespace v8 | 318 } // namespace v8 |
| OLD | NEW |