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

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

Issue 1650873002: Fix memory leak in incremental resolver (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 CompilationUnit oldUnit = 1868 CompilationUnit oldUnit =
1869 getResolvedCompilationUnit2(unitSource, librarySource); 1869 getResolvedCompilationUnit2(unitSource, librarySource);
1870 if (oldUnit == null) { 1870 if (oldUnit == null) {
1871 return false; 1871 return false;
1872 } 1872 }
1873 // do resolution 1873 // do resolution
1874 Stopwatch perfCounter = new Stopwatch()..start(); 1874 Stopwatch perfCounter = new Stopwatch()..start();
1875 PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver( 1875 PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
1876 typeProvider, 1876 typeProvider,
1877 unitSource, 1877 unitSource,
1878 _cache,
1878 sourceEntry, 1879 sourceEntry,
1879 unitEntry, 1880 unitEntry,
1880 oldUnit, 1881 oldUnit,
1881 analysisOptions.incrementalApi); 1882 analysisOptions.incrementalApi);
1882 bool success = resolver.resolve(newCode); 1883 bool success = resolver.resolve(newCode);
1883 AnalysisEngine.instance.instrumentationService.logPerformance( 1884 AnalysisEngine.instance.instrumentationService.logPerformance(
1884 AnalysisPerformanceKind.INCREMENTAL, 1885 AnalysisPerformanceKind.INCREMENTAL,
1885 perfCounter, 1886 perfCounter,
1886 'success=$success,context_id=$_id,code_length=${newCode.length}'); 1887 'success=$success,context_id=$_id,code_length=${newCode.length}');
1887 if (!success) { 1888 if (!success) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 } 2106 }
2106 DartSdk sdk = factory.dartSdk; 2107 DartSdk sdk = factory.dartSdk;
2107 if (sdk == null) { 2108 if (sdk == null) {
2108 throw new IllegalArgumentException( 2109 throw new IllegalArgumentException(
2109 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2110 "The source factory for an SDK analysis context must have a DartUriRes olver");
2110 } 2111 }
2111 return new AnalysisCache( 2112 return new AnalysisCache(
2112 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 2113 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
2113 } 2114 }
2114 } 2115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698