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

Side by Side Diff: pkg/analyzer/lib/src/dart/ast/ast.dart

Issue 2653343002: Improve performance of visiting large invalid compilation units (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.ast.ast; 5 library analyzer.src.dart.ast.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/syntactic_entity.dart'; 10 import 'package:analyzer/dart/ast/syntactic_entity.dart';
(...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2515 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => 2515 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
2516 visitor.visitCompilationUnit(this); 2516 visitor.visitCompilationUnit(this);
2517 2517
2518 @override 2518 @override
2519 void visitChildren(AstVisitor visitor) { 2519 void visitChildren(AstVisitor visitor) {
2520 _scriptTag?.accept(visitor); 2520 _scriptTag?.accept(visitor);
2521 if (_directivesAreBeforeDeclarations) { 2521 if (_directivesAreBeforeDeclarations) {
2522 _directives.accept(visitor); 2522 _directives.accept(visitor);
2523 _declarations.accept(visitor); 2523 _declarations.accept(visitor);
2524 } else { 2524 } else {
2525 int length = sortedDirectivesAndDeclarations.length; 2525 List<AstNode> sortedMembers = sortedDirectivesAndDeclarations;
2526 int length = sortedMembers.length;
2526 for (int i = 0; i < length; i++) { 2527 for (int i = 0; i < length; i++) {
2527 AstNode child = sortedDirectivesAndDeclarations[i]; 2528 AstNode child = sortedMembers[i];
2528 child.accept(visitor); 2529 child.accept(visitor);
2529 } 2530 }
2530 } 2531 }
2531 } 2532 }
2532 } 2533 }
2533 2534
2534 /** 2535 /**
2535 * A node that declares one or more names within the scope of a compilation 2536 * A node that declares one or more names within the scope of a compilation
2536 * unit. 2537 * unit.
2537 * 2538 *
(...skipping 8929 matching lines...) Expand 10 before | Expand all | Expand 10 after
11467 11468
11468 @override 11469 @override
11469 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => 11470 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
11470 visitor.visitYieldStatement(this); 11471 visitor.visitYieldStatement(this);
11471 11472
11472 @override 11473 @override
11473 void visitChildren(AstVisitor visitor) { 11474 void visitChildren(AstVisitor visitor) {
11474 _expression?.accept(visitor); 11475 _expression?.accept(visitor);
11475 } 11476 }
11476 } 11477 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698