| Index: pkg/analyzer/lib/src/generated/engine.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
|
| index b63fb1f69cdcfaaa4b2be1bbdbefe282fb153a3f..4b27d6e9f1e75318e23b2528254191010eefe216 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -22,7 +22,6 @@ import 'html.dart' as ht;
|
| import 'incremental_resolver.dart' show IncrementalResolver,
|
| PoorMansIncrementalResolver;
|
| import 'incremental_scanner.dart';
|
| -import 'instrumentation.dart';
|
| import 'java_core.dart';
|
| import 'java_engine.dart';
|
| import 'parser.dart' show Parser, IncrementalParser;
|
| @@ -6088,14 +6087,7 @@ class AnalysisEngine {
|
| * @return the analysis context that was created
|
| */
|
| AnalysisContext createAnalysisContext() {
|
| - //
|
| - // If instrumentation is ignoring data, return an uninstrumented analysis
|
| - // context.
|
| - //
|
| - if (Instrumentation.isNullLogger) {
|
| - return new AnalysisContextImpl();
|
| - }
|
| - return new InstrumentedAnalysisContextImpl.con1(new AnalysisContextImpl());
|
| + return new AnalysisContextImpl();
|
| }
|
|
|
| /**
|
| @@ -10560,849 +10552,6 @@ class IncrementalAnalysisTask extends AnalysisTask {
|
| }
|
|
|
| /**
|
| - * Instances of the class `InstrumentedAnalysisContextImpl` implement an
|
| - * [AnalysisContext] by recording instrumentation data and delegating to
|
| - * another analysis context to do the non-instrumentation work.
|
| - */
|
| -class InstrumentedAnalysisContextImpl implements InternalAnalysisContext {
|
| - /**
|
| - * The unique identifier used to identify this analysis context in the instrumentation data.
|
| - */
|
| - String _contextId = UUID.randomUUID().toString();
|
| -
|
| - /**
|
| - * The analysis context to which all of the non-instrumentation work is delegated.
|
| - */
|
| - InternalAnalysisContext _basis;
|
| -
|
| - /**
|
| - * Create a new [InstrumentedAnalysisContextImpl] which wraps a new
|
| - * [AnalysisContextImpl] as the basis context.
|
| - */
|
| - InstrumentedAnalysisContextImpl() : this.con1(new AnalysisContextImpl());
|
| -
|
| - /**
|
| - * Create a new [InstrumentedAnalysisContextImpl] with a specified basis context, aka the
|
| - * context to wrap and instrument.
|
| - *
|
| - * @param context some [InstrumentedAnalysisContext] to wrap and instrument
|
| - */
|
| - InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) {
|
| - _basis = context;
|
| - }
|
| -
|
| - @override
|
| - AnalysisOptions get analysisOptions {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getAnalysisOptions");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.analysisOptions;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void set analysisOptions(AnalysisOptions options) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-setAnalysisOptions");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.analysisOptions = options;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void set analysisPriorityOrder(List<Source> sources) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-setAnalysisPriorityOrder");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.analysisPriorityOrder = sources;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - /**
|
| - * @return the underlying [AnalysisContext].
|
| - */
|
| - AnalysisContext get basis => _basis;
|
| -
|
| - @override
|
| - DeclaredVariables get declaredVariables => _basis.declaredVariables;
|
| -
|
| - @override
|
| - List<Source> get htmlSources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getHtmlSources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.htmlSources;
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - bool get isDisposed {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-isDisposed");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.isDisposed;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> get launchableClientLibrarySources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLaunchableClientLibrarySources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.launchableClientLibrarySources;
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> get launchableServerLibrarySources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLaunchableServerLibrarySources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.launchableServerLibrarySources;
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> get librarySources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLibrarySources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.librarySources;
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Stream<SourcesChangedEvent> get onSourcesChanged => _basis.onSourcesChanged;
|
| -
|
| - @override
|
| - List<Source> get prioritySources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getPrioritySources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.prioritySources;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> get refactoringUnsafeSources {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getRefactoringUnsafeSources");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.refactoringUnsafeSources;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - SourceFactory get sourceFactory {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getSourceFactory");
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.sourceFactory;
|
| - } finally {
|
| - instrumentation.log2(2);
|
| - //Log if over 1ms
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void set sourceFactory(SourceFactory factory) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-setSourceFactory");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.sourceFactory = factory;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - AnalysisContextStatistics get statistics => _basis.statistics;
|
| -
|
| - @override
|
| - TypeProvider get typeProvider => _basis.typeProvider;
|
| -
|
| - @override
|
| - void addListener(AnalysisListener listener) {
|
| - _basis.addListener(listener);
|
| - }
|
| -
|
| - @override
|
| - void addSourceInfo(Source source, SourceEntry info) {
|
| - _basis.addSourceInfo(source, info);
|
| - }
|
| -
|
| - @override
|
| - void applyAnalysisDelta(AnalysisDelta delta) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-updateAnalysis");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.applyAnalysisDelta(delta);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void applyChanges(ChangeSet changeSet) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-applyChanges");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.applyChanges(changeSet);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - String computeDocumentationComment(Element element) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeDocumentationComment");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.computeDocumentationComment(element);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<AnalysisError> computeErrors(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeErrors");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<AnalysisError> errors = _basis.computeErrors(source);
|
| - instrumentation.metric2("Errors-count", errors.length);
|
| - return errors;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> computeExportedLibraries(Source source) =>
|
| - _basis.computeExportedLibraries(source);
|
| -
|
| - @override
|
| - HtmlElement computeHtmlElement(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeHtmlElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.computeHtmlElement(source);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> computeImportedLibraries(Source source) =>
|
| - _basis.computeImportedLibraries(source);
|
| -
|
| - @override
|
| - SourceKind computeKindOf(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeKindOf");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.computeKindOf(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - LibraryElement computeLibraryElement(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeLibraryElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.computeLibraryElement(source);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - LineInfo computeLineInfo(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-computeLineInfo");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.computeLineInfo(source);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - CompilationUnit computeResolvableCompilationUnit(Source source) =>
|
| - _basis.computeResolvableCompilationUnit(source);
|
| -
|
| - @override
|
| - void dispose() {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-dispose");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.dispose();
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - bool exists(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-exists");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.exists(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getAngularApplication");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getAngularApplicationWithHtml(htmlSource);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - CompilationUnitElement getCompilationUnitElement(Source unitSource,
|
| - Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getCompilationUnitElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getCompilationUnitElement(unitSource, librarySource);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - TimestampedData<String> getContents(Source source) =>
|
| - _basis.getContents(source);
|
| -
|
| - @override
|
| - InternalAnalysisContext getContextFor(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getContextFor");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getContextFor(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Element getElement(ElementLocation location) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getElement(location);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - AnalysisErrorInfo getErrors(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getErrors");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - AnalysisErrorInfo ret = _basis.getErrors(source);
|
| - if (ret != null) {
|
| - instrumentation.metric2("Errors-count", ret.errors.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - HtmlElement getHtmlElement(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getHtmlElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getHtmlElement(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> getHtmlFilesReferencing(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getHtmlFilesReferencing");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.getHtmlFilesReferencing(source);
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - SourceKind getKindOf(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getKindOf");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getKindOf(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> getLibrariesContaining(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLibrariesContaining");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.getLibrariesContaining(source);
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log2(2);
|
| - //Log if 1ms
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> getLibrariesDependingOn(Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLibrariesDependingOn");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - List<Source> ret = _basis.getLibrariesDependingOn(librarySource);
|
| - if (ret != null) {
|
| - instrumentation.metric2("Source-count", ret.length);
|
| - }
|
| - return ret;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLibrariesReferencedFromHtml");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getLibrariesReferencedFromHtml(htmlSource);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - LibraryElement getLibraryElement(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLibraryElement");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getLibraryElement(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - LineInfo getLineInfo(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getLineInfo");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getLineInfo(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - int getModificationStamp(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getModificationStamp");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getModificationStamp(source);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Namespace getPublicNamespace(LibraryElement library) =>
|
| - _basis.getPublicNamespace(library);
|
| -
|
| - @override
|
| - CompilationUnit getResolvedCompilationUnit(Source unitSource,
|
| - LibraryElement library) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getResolvedCompilationUnit(unitSource, library);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - CompilationUnit getResolvedCompilationUnit2(Source unitSource,
|
| - Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getResolvedCompilationUnit2(unitSource, librarySource);
|
| - } finally {
|
| - instrumentation.log2(2);
|
| - //Log if over 1ms
|
| - }
|
| - }
|
| -
|
| - @override
|
| - ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-getResolvedHtmlUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.getResolvedHtmlUnit(htmlSource);
|
| - } finally {
|
| - instrumentation.log2(2);
|
| - //Log if over 1ms
|
| - }
|
| - }
|
| -
|
| - @override
|
| - bool isClientLibrary(Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-isClientLibrary");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.isClientLibrary(librarySource);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - bool isServerLibrary(Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-isServerLibrary");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.isServerLibrary(librarySource);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - CompilationUnit parseCompilationUnit(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-parseCompilationUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.parseCompilationUnit(source);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - ht.HtmlUnit parseHtmlUnit(Source source) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-parseHtmlUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.parseHtmlUnit(source);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - AnalysisResult performAnalysisTask() {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-performAnalysisTask");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - AnalysisResult result = _basis.performAnalysisTask();
|
| - if (result.changeNotices != null) {
|
| - instrumentation.metric2(
|
| - "ChangeNotice-count",
|
| - result.changeNotices.length);
|
| - }
|
| - return result;
|
| - } finally {
|
| - instrumentation.log2(15);
|
| - //Log if >= 15ms
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
|
| - _basis.recordLibraryElements(elementMap);
|
| - }
|
| -
|
| - @override
|
| - void removeListener(AnalysisListener listener) {
|
| - _basis.removeListener(listener);
|
| - }
|
| -
|
| - @override
|
| - CompilationUnit resolveCompilationUnit(Source unitSource,
|
| - LibraryElement library) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-resolveCompilationUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.resolveCompilationUnit(unitSource, library);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - CompilationUnit resolveCompilationUnit2(Source unitSource,
|
| - Source librarySource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-resolveCompilationUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.resolveCompilationUnit2(unitSource, librarySource);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-resolveHtmlUnit");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - return _basis.resolveHtmlUnit(htmlSource);
|
| - } on AnalysisException catch (e, stackTrace) {
|
| - _recordAnalysisException(
|
| - instrumentation,
|
| - new CaughtException(e, stackTrace));
|
| - throw e;
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void setChangedContents(Source source, String contents, int offset,
|
| - int oldLength, int newLength) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-setChangedContents");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.setChangedContents(source, contents, offset, oldLength, newLength);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void setContents(Source source, String contents) {
|
| - InstrumentationBuilder instrumentation =
|
| - Instrumentation.builder2("Analysis-setContents");
|
| - _checkThread(instrumentation);
|
| - try {
|
| - instrumentation.metric3("contextId", _contextId);
|
| - _basis.setContents(source, contents);
|
| - } finally {
|
| - instrumentation.log();
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
|
| - DataDescriptor rowDesc, CacheState state)) {
|
| - _basis.visitCacheItems(callback);
|
| - }
|
| -
|
| - /**
|
| - * If the current thread is the UI thread, then note this in the specified instrumentation and
|
| - * append this information to the log.
|
| - *
|
| - * @param instrumentation the instrumentation, not `null`
|
| - */
|
| - static void _checkThread(InstrumentationBuilder instrumentation) {
|
| - }
|
| -
|
| - /**
|
| - * Record an exception that was thrown during analysis.
|
| - *
|
| - * @param instrumentation the instrumentation builder being used to record the exception
|
| - * @param exception the exception being reported
|
| - */
|
| - static void _recordAnalysisException(InstrumentationBuilder instrumentation,
|
| - CaughtException exception) {
|
| - instrumentation.record(exception);
|
| - }
|
| -}
|
| -
|
| -/**
|
| * The interface `InternalAnalysisContext` defines additional behavior for an analysis context
|
| * that is required by internal users of the context.
|
| */
|
| @@ -14464,20 +13613,21 @@ abstract class SourceEntry {
|
| * discover the underlying cause of a long-standing bug.
|
| */
|
| void _validateStateChange(DataDescriptor descriptor, CacheState newState) {
|
| - if (descriptor != CONTENT) {
|
| - return;
|
| - }
|
| - CachedResult result = resultMap[CONTENT];
|
| - if (result != null && result.state == CacheState.ERROR) {
|
| - String message =
|
| - "contentState changing from ${result.state} to $newState";
|
| - InstrumentationBuilder builder =
|
| - Instrumentation.builder2("SourceEntry-validateStateChange");
|
| - builder.data3("message", message);
|
| - //builder.data("source", source.getFullName());
|
| - builder.record(new CaughtException(new AnalysisException(message), null));
|
| - builder.log();
|
| - }
|
| + // TODO(brianwilkerson) Decide whether we still want to capture this data.
|
| +// if (descriptor != CONTENT) {
|
| +// return;
|
| +// }
|
| +// CachedResult result = resultMap[CONTENT];
|
| +// if (result != null && result.state == CacheState.ERROR) {
|
| +// String message =
|
| +// "contentState changing from ${result.state} to $newState";
|
| +// InstrumentationBuilder builder =
|
| +// Instrumentation.builder2("SourceEntry-validateStateChange");
|
| +// builder.data3("message", message);
|
| +// //builder.data("source", source.getFullName());
|
| +// builder.record(new CaughtException(new AnalysisException(message), null));
|
| +// builder.log();
|
| +// }
|
| }
|
|
|
| /**
|
|
|