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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 649873007: Remove Math and most uses of PrintStringWriter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine; 8 library engine;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
11 import "dart:math" as math;
11 12
12 import 'package:analyzer/src/task/task_dart.dart'; 13 import 'package:analyzer/src/task/task_dart.dart';
13 14
14 import 'java_core.dart'; 15 import 'java_core.dart';
15 import 'java_engine.dart'; 16 import 'java_engine.dart';
16 import 'utilities_collection.dart'; 17 import 'utilities_collection.dart';
17 import 'utilities_general.dart'; 18 import 'utilities_general.dart';
18 import 'instrumentation.dart'; 19 import 'instrumentation.dart';
19 import 'error.dart'; 20 import 'error.dart';
20 import 'source.dart'; 21 import 'source.dart';
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 // Nothing else to do. 1855 // Nothing else to do.
1855 } 1856 }
1856 if (sources.isEmpty) { 1857 if (sources.isEmpty) {
1857 _priorityOrder = Source.EMPTY_ARRAY; 1858 _priorityOrder = Source.EMPTY_ARRAY;
1858 } 1859 }
1859 // 1860 //
1860 // Cap the size of the priority list to being less than the cache size. Fa ilure to do so can 1861 // Cap the size of the priority list to being less than the cache size. Fa ilure to do so can
1861 // result in an infinite loop in performAnalysisTask() because re-caching one AST structure 1862 // result in an infinite loop in performAnalysisTask() because re-caching one AST structure
1862 // can cause another priority source's AST structure to be flushed. 1863 // can cause another priority source's AST structure to be flushed.
1863 // 1864 //
1864 int count = Math.min(sources.length, _options.cacheSize - _PRIORITY_ORDER_ SIZE_DELTA); 1865 int count = math.min(sources.length, _options.cacheSize - _PRIORITY_ORDER_ SIZE_DELTA);
1865 _priorityOrder = new List<Source>(count); 1866 _priorityOrder = new List<Source>(count);
1866 for (int i = 0; i < count; i++) { 1867 for (int i = 0; i < count; i++) {
1867 _priorityOrder[i] = sources[i]; 1868 _priorityOrder[i] = sources[i];
1868 } 1869 }
1869 } 1870 }
1870 } 1871 }
1871 1872
1872 @override 1873 @override
1873 void setChangedContents(Source source, String contents, int offset, int oldLen gth, int newLength) { 1874 void setChangedContents(Source source, String contents, int offset, int oldLen gth, int newLength) {
1874 String originalContents = _contentCache.setContents(source, contents); 1875 String originalContents = _contentCache.setContents(source, contents);
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 missingSources.add(source); 4410 missingSources.add(source);
4410 } 4411 }
4411 } 4412 }
4412 } 4413 }
4413 int count = changedSources.length; 4414 int count = changedSources.length;
4414 for (int i = 0; i < count; i++) { 4415 for (int i = 0; i < count; i++) {
4415 _sourceChanged(changedSources[i]); 4416 _sourceChanged(changedSources[i]);
4416 } 4417 }
4417 int consistencyCheckEnd = JavaSystem.nanoTime(); 4418 int consistencyCheckEnd = JavaSystem.nanoTime();
4418 if (changedSources.length > 0 || missingSources.length > 0) { 4419 if (changedSources.length > 0 || missingSources.length > 0) {
4419 PrintStringWriter writer = new PrintStringWriter(); 4420 StringBuffer buffer = new StringBuffer();
4420 writer.print("Consistency check took "); 4421 buffer.write("Consistency check took ");
4421 writer.print((consistencyCheckEnd - consistencyCheckStart) / 1000000.0); 4422 buffer.write((consistencyCheckEnd - consistencyCheckStart) / 1000000.0);
4422 writer.println(" ms and found"); 4423 buffer.writeln(" ms and found");
4423 writer.print(" "); 4424 buffer.write(" ");
4424 writer.print(changedSources.length); 4425 buffer.write(changedSources.length);
4425 writer.println(" inconsistent entries"); 4426 buffer.writeln(" inconsistent entries");
4426 writer.print(" "); 4427 buffer.write(" ");
4427 writer.print(missingSources.length); 4428 buffer.write(missingSources.length);
4428 writer.println(" missing sources"); 4429 buffer.writeln(" missing sources");
4429 for (Source source in missingSources) { 4430 for (Source source in missingSources) {
4430 writer.print(" "); 4431 buffer.write(" ");
4431 writer.println(source.fullName); 4432 buffer.writeln(source.fullName);
4432 } 4433 }
4433 _logInformation(writer.toString()); 4434 _logInformation(buffer.toString());
4434 } 4435 }
4435 return changedSources.length > 0; 4436 return changedSources.length > 0;
4436 } 4437 }
4437 } 4438 }
4438 4439
4439 /** 4440 /**
4440 * An `AnalysisTaskResultRecorder` is used by an analysis context to record the 4441 * An `AnalysisTaskResultRecorder` is used by an analysis context to record the
4441 * results of a task. 4442 * results of a task.
4442 */ 4443 */
4443 class AnalysisContextImpl_AnalysisTaskResultRecorder implements AnalysisTaskVisi tor<SourceEntry> { 4444 class AnalysisContextImpl_AnalysisTaskResultRecorder implements AnalysisTaskVisi tor<SourceEntry> {
(...skipping 9031 matching lines...) Expand 10 before | Expand all | Expand 10 after
13475 _index++; 13476 _index++;
13476 if (_index >= _manager._workQueues[_queueIndex].length) { 13477 if (_index >= _manager._workQueues[_queueIndex].length) {
13477 _index = 0; 13478 _index = 0;
13478 _queueIndex++; 13479 _queueIndex++;
13479 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_ queueIndex].isEmpty) { 13480 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_ queueIndex].isEmpty) {
13480 _queueIndex++; 13481 _queueIndex++;
13481 } 13482 }
13482 } 13483 }
13483 } 13484 }
13484 } 13485 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/generated/util.dart ('k') | pkg/analyzer/lib/src/generated/java_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698