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

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

Issue 784623004: Remove old instrumentation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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:math" as math; 10 import "dart:math" as math;
11 import 'dart:async'; 11 import 'dart:async';
12 import 'dart:collection'; 12 import 'dart:collection';
13 13
14 import 'package:analyzer/src/task/task_dart.dart'; 14 import 'package:analyzer/src/task/task_dart.dart';
15 15
16 import 'ast.dart'; 16 import 'ast.dart';
17 import 'constant.dart'; 17 import 'constant.dart';
18 import 'element.dart'; 18 import 'element.dart';
19 import 'error.dart'; 19 import 'error.dart';
20 import 'error_verifier.dart'; 20 import 'error_verifier.dart';
21 import 'html.dart' as ht; 21 import 'html.dart' as ht;
22 import 'incremental_resolver.dart' show IncrementalResolver, 22 import 'incremental_resolver.dart' show IncrementalResolver,
23 PoorMansIncrementalResolver; 23 PoorMansIncrementalResolver;
24 import 'incremental_scanner.dart'; 24 import 'incremental_scanner.dart';
25 import 'instrumentation.dart';
26 import 'java_core.dart'; 25 import 'java_core.dart';
27 import 'java_engine.dart'; 26 import 'java_engine.dart';
28 import 'parser.dart' show Parser, IncrementalParser; 27 import 'parser.dart' show Parser, IncrementalParser;
29 import 'resolver.dart'; 28 import 'resolver.dart';
30 import 'scanner.dart'; 29 import 'scanner.dart';
31 import 'sdk.dart' show DartSdk; 30 import 'sdk.dart' show DartSdk;
32 import 'source.dart'; 31 import 'source.dart';
33 import 'utilities_collection.dart'; 32 import 'utilities_collection.dart';
34 import 'utilities_general.dart'; 33 import 'utilities_general.dart';
35 34
(...skipping 6045 matching lines...) Expand 10 before | Expand all | Expand 10 after
6081 void clearCaches() { 6080 void clearCaches() {
6082 partitionManager.clearCache(); 6081 partitionManager.clearCache();
6083 } 6082 }
6084 6083
6085 /** 6084 /**
6086 * Create a new context in which analysis can be performed. 6085 * Create a new context in which analysis can be performed.
6087 * 6086 *
6088 * @return the analysis context that was created 6087 * @return the analysis context that was created
6089 */ 6088 */
6090 AnalysisContext createAnalysisContext() { 6089 AnalysisContext createAnalysisContext() {
6091 // 6090 return new AnalysisContextImpl();
6092 // If instrumentation is ignoring data, return an uninstrumented analysis
6093 // context.
6094 //
6095 if (Instrumentation.isNullLogger) {
6096 return new AnalysisContextImpl();
6097 }
6098 return new InstrumentedAnalysisContextImpl.con1(new AnalysisContextImpl());
6099 } 6091 }
6100 6092
6101 /** 6093 /**
6102 * Return `true` if the given file name is assumed to contain Dart source code . 6094 * Return `true` if the given file name is assumed to contain Dart source code .
6103 * 6095 *
6104 * @param fileName the name of the file being tested 6096 * @param fileName the name of the file being tested
6105 * @return `true` if the given file name is assumed to contain Dart source cod e 6097 * @return `true` if the given file name is assumed to contain Dart source cod e
6106 */ 6098 */
6107 static bool isDartFileName(String fileName) { 6099 static bool isDartFileName(String fileName) {
6108 if (fileName == null) { 6100 if (fileName == null) {
(...skipping 4444 matching lines...) Expand 10 before | Expand all | Expand 10 after
10553 cache.oldLength, 10545 cache.oldLength,
10554 cache.newLength); 10546 cache.newLength);
10555 resolver.resolve(parser.updatedNode); 10547 resolver.resolve(parser.updatedNode);
10556 } 10548 }
10557 } 10549 }
10558 } 10550 }
10559 } 10551 }
10560 } 10552 }
10561 10553
10562 /** 10554 /**
10563 * Instances of the class `InstrumentedAnalysisContextImpl` implement an
10564 * [AnalysisContext] by recording instrumentation data and delegating to
10565 * another analysis context to do the non-instrumentation work.
10566 */
10567 class InstrumentedAnalysisContextImpl implements InternalAnalysisContext {
10568 /**
10569 * The unique identifier used to identify this analysis context in the instrum entation data.
10570 */
10571 String _contextId = UUID.randomUUID().toString();
10572
10573 /**
10574 * The analysis context to which all of the non-instrumentation work is delega ted.
10575 */
10576 InternalAnalysisContext _basis;
10577
10578 /**
10579 * Create a new [InstrumentedAnalysisContextImpl] which wraps a new
10580 * [AnalysisContextImpl] as the basis context.
10581 */
10582 InstrumentedAnalysisContextImpl() : this.con1(new AnalysisContextImpl());
10583
10584 /**
10585 * Create a new [InstrumentedAnalysisContextImpl] with a specified basis conte xt, aka the
10586 * context to wrap and instrument.
10587 *
10588 * @param context some [InstrumentedAnalysisContext] to wrap and instrument
10589 */
10590 InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) {
10591 _basis = context;
10592 }
10593
10594 @override
10595 AnalysisOptions get analysisOptions {
10596 InstrumentationBuilder instrumentation =
10597 Instrumentation.builder2("Analysis-getAnalysisOptions");
10598 _checkThread(instrumentation);
10599 try {
10600 instrumentation.metric3("contextId", _contextId);
10601 return _basis.analysisOptions;
10602 } finally {
10603 instrumentation.log();
10604 }
10605 }
10606
10607 @override
10608 void set analysisOptions(AnalysisOptions options) {
10609 InstrumentationBuilder instrumentation =
10610 Instrumentation.builder2("Analysis-setAnalysisOptions");
10611 _checkThread(instrumentation);
10612 try {
10613 instrumentation.metric3("contextId", _contextId);
10614 _basis.analysisOptions = options;
10615 } finally {
10616 instrumentation.log();
10617 }
10618 }
10619
10620 @override
10621 void set analysisPriorityOrder(List<Source> sources) {
10622 InstrumentationBuilder instrumentation =
10623 Instrumentation.builder2("Analysis-setAnalysisPriorityOrder");
10624 _checkThread(instrumentation);
10625 try {
10626 instrumentation.metric3("contextId", _contextId);
10627 _basis.analysisPriorityOrder = sources;
10628 } finally {
10629 instrumentation.log();
10630 }
10631 }
10632
10633 /**
10634 * @return the underlying [AnalysisContext].
10635 */
10636 AnalysisContext get basis => _basis;
10637
10638 @override
10639 DeclaredVariables get declaredVariables => _basis.declaredVariables;
10640
10641 @override
10642 List<Source> get htmlSources {
10643 InstrumentationBuilder instrumentation =
10644 Instrumentation.builder2("Analysis-getHtmlSources");
10645 _checkThread(instrumentation);
10646 try {
10647 instrumentation.metric3("contextId", _contextId);
10648 List<Source> ret = _basis.htmlSources;
10649 if (ret != null) {
10650 instrumentation.metric2("Source-count", ret.length);
10651 }
10652 return ret;
10653 } finally {
10654 instrumentation.log();
10655 }
10656 }
10657
10658 @override
10659 bool get isDisposed {
10660 InstrumentationBuilder instrumentation =
10661 Instrumentation.builder2("Analysis-isDisposed");
10662 _checkThread(instrumentation);
10663 try {
10664 instrumentation.metric3("contextId", _contextId);
10665 return _basis.isDisposed;
10666 } finally {
10667 instrumentation.log();
10668 }
10669 }
10670
10671 @override
10672 List<Source> get launchableClientLibrarySources {
10673 InstrumentationBuilder instrumentation =
10674 Instrumentation.builder2("Analysis-getLaunchableClientLibrarySources");
10675 _checkThread(instrumentation);
10676 try {
10677 instrumentation.metric3("contextId", _contextId);
10678 List<Source> ret = _basis.launchableClientLibrarySources;
10679 if (ret != null) {
10680 instrumentation.metric2("Source-count", ret.length);
10681 }
10682 return ret;
10683 } finally {
10684 instrumentation.log();
10685 }
10686 }
10687
10688 @override
10689 List<Source> get launchableServerLibrarySources {
10690 InstrumentationBuilder instrumentation =
10691 Instrumentation.builder2("Analysis-getLaunchableServerLibrarySources");
10692 _checkThread(instrumentation);
10693 try {
10694 instrumentation.metric3("contextId", _contextId);
10695 List<Source> ret = _basis.launchableServerLibrarySources;
10696 if (ret != null) {
10697 instrumentation.metric2("Source-count", ret.length);
10698 }
10699 return ret;
10700 } finally {
10701 instrumentation.log();
10702 }
10703 }
10704
10705 @override
10706 List<Source> get librarySources {
10707 InstrumentationBuilder instrumentation =
10708 Instrumentation.builder2("Analysis-getLibrarySources");
10709 _checkThread(instrumentation);
10710 try {
10711 instrumentation.metric3("contextId", _contextId);
10712 List<Source> ret = _basis.librarySources;
10713 if (ret != null) {
10714 instrumentation.metric2("Source-count", ret.length);
10715 }
10716 return ret;
10717 } finally {
10718 instrumentation.log();
10719 }
10720 }
10721
10722 @override
10723 Stream<SourcesChangedEvent> get onSourcesChanged => _basis.onSourcesChanged;
10724
10725 @override
10726 List<Source> get prioritySources {
10727 InstrumentationBuilder instrumentation =
10728 Instrumentation.builder2("Analysis-getPrioritySources");
10729 _checkThread(instrumentation);
10730 try {
10731 instrumentation.metric3("contextId", _contextId);
10732 return _basis.prioritySources;
10733 } finally {
10734 instrumentation.log();
10735 }
10736 }
10737
10738 @override
10739 List<Source> get refactoringUnsafeSources {
10740 InstrumentationBuilder instrumentation =
10741 Instrumentation.builder2("Analysis-getRefactoringUnsafeSources");
10742 _checkThread(instrumentation);
10743 try {
10744 instrumentation.metric3("contextId", _contextId);
10745 return _basis.refactoringUnsafeSources;
10746 } finally {
10747 instrumentation.log();
10748 }
10749 }
10750
10751 @override
10752 SourceFactory get sourceFactory {
10753 InstrumentationBuilder instrumentation =
10754 Instrumentation.builder2("Analysis-getSourceFactory");
10755 try {
10756 instrumentation.metric3("contextId", _contextId);
10757 return _basis.sourceFactory;
10758 } finally {
10759 instrumentation.log2(2);
10760 //Log if over 1ms
10761 }
10762 }
10763
10764 @override
10765 void set sourceFactory(SourceFactory factory) {
10766 InstrumentationBuilder instrumentation =
10767 Instrumentation.builder2("Analysis-setSourceFactory");
10768 _checkThread(instrumentation);
10769 try {
10770 instrumentation.metric3("contextId", _contextId);
10771 _basis.sourceFactory = factory;
10772 } finally {
10773 instrumentation.log();
10774 }
10775 }
10776
10777 @override
10778 AnalysisContextStatistics get statistics => _basis.statistics;
10779
10780 @override
10781 TypeProvider get typeProvider => _basis.typeProvider;
10782
10783 @override
10784 void addListener(AnalysisListener listener) {
10785 _basis.addListener(listener);
10786 }
10787
10788 @override
10789 void addSourceInfo(Source source, SourceEntry info) {
10790 _basis.addSourceInfo(source, info);
10791 }
10792
10793 @override
10794 void applyAnalysisDelta(AnalysisDelta delta) {
10795 InstrumentationBuilder instrumentation =
10796 Instrumentation.builder2("Analysis-updateAnalysis");
10797 _checkThread(instrumentation);
10798 try {
10799 instrumentation.metric3("contextId", _contextId);
10800 _basis.applyAnalysisDelta(delta);
10801 } finally {
10802 instrumentation.log();
10803 }
10804 }
10805
10806 @override
10807 void applyChanges(ChangeSet changeSet) {
10808 InstrumentationBuilder instrumentation =
10809 Instrumentation.builder2("Analysis-applyChanges");
10810 _checkThread(instrumentation);
10811 try {
10812 instrumentation.metric3("contextId", _contextId);
10813 _basis.applyChanges(changeSet);
10814 } finally {
10815 instrumentation.log();
10816 }
10817 }
10818
10819 @override
10820 String computeDocumentationComment(Element element) {
10821 InstrumentationBuilder instrumentation =
10822 Instrumentation.builder2("Analysis-computeDocumentationComment");
10823 _checkThread(instrumentation);
10824 try {
10825 instrumentation.metric3("contextId", _contextId);
10826 return _basis.computeDocumentationComment(element);
10827 } finally {
10828 instrumentation.log();
10829 }
10830 }
10831
10832 @override
10833 List<AnalysisError> computeErrors(Source source) {
10834 InstrumentationBuilder instrumentation =
10835 Instrumentation.builder2("Analysis-computeErrors");
10836 _checkThread(instrumentation);
10837 try {
10838 instrumentation.metric3("contextId", _contextId);
10839 List<AnalysisError> errors = _basis.computeErrors(source);
10840 instrumentation.metric2("Errors-count", errors.length);
10841 return errors;
10842 } finally {
10843 instrumentation.log();
10844 }
10845 }
10846
10847 @override
10848 List<Source> computeExportedLibraries(Source source) =>
10849 _basis.computeExportedLibraries(source);
10850
10851 @override
10852 HtmlElement computeHtmlElement(Source source) {
10853 InstrumentationBuilder instrumentation =
10854 Instrumentation.builder2("Analysis-computeHtmlElement");
10855 _checkThread(instrumentation);
10856 try {
10857 instrumentation.metric3("contextId", _contextId);
10858 return _basis.computeHtmlElement(source);
10859 } on AnalysisException catch (e, stackTrace) {
10860 _recordAnalysisException(
10861 instrumentation,
10862 new CaughtException(e, stackTrace));
10863 throw e;
10864 } finally {
10865 instrumentation.log();
10866 }
10867 }
10868
10869 @override
10870 List<Source> computeImportedLibraries(Source source) =>
10871 _basis.computeImportedLibraries(source);
10872
10873 @override
10874 SourceKind computeKindOf(Source source) {
10875 InstrumentationBuilder instrumentation =
10876 Instrumentation.builder2("Analysis-computeKindOf");
10877 _checkThread(instrumentation);
10878 try {
10879 instrumentation.metric3("contextId", _contextId);
10880 return _basis.computeKindOf(source);
10881 } finally {
10882 instrumentation.log();
10883 }
10884 }
10885
10886 @override
10887 LibraryElement computeLibraryElement(Source source) {
10888 InstrumentationBuilder instrumentation =
10889 Instrumentation.builder2("Analysis-computeLibraryElement");
10890 _checkThread(instrumentation);
10891 try {
10892 instrumentation.metric3("contextId", _contextId);
10893 return _basis.computeLibraryElement(source);
10894 } on AnalysisException catch (e, stackTrace) {
10895 _recordAnalysisException(
10896 instrumentation,
10897 new CaughtException(e, stackTrace));
10898 throw e;
10899 } finally {
10900 instrumentation.log();
10901 }
10902 }
10903
10904 @override
10905 LineInfo computeLineInfo(Source source) {
10906 InstrumentationBuilder instrumentation =
10907 Instrumentation.builder2("Analysis-computeLineInfo");
10908 _checkThread(instrumentation);
10909 try {
10910 instrumentation.metric3("contextId", _contextId);
10911 return _basis.computeLineInfo(source);
10912 } on AnalysisException catch (e, stackTrace) {
10913 _recordAnalysisException(
10914 instrumentation,
10915 new CaughtException(e, stackTrace));
10916 throw e;
10917 } finally {
10918 instrumentation.log();
10919 }
10920 }
10921
10922 @override
10923 CompilationUnit computeResolvableCompilationUnit(Source source) =>
10924 _basis.computeResolvableCompilationUnit(source);
10925
10926 @override
10927 void dispose() {
10928 InstrumentationBuilder instrumentation =
10929 Instrumentation.builder2("Analysis-dispose");
10930 _checkThread(instrumentation);
10931 try {
10932 instrumentation.metric3("contextId", _contextId);
10933 _basis.dispose();
10934 } finally {
10935 instrumentation.log();
10936 }
10937 }
10938
10939 @override
10940 bool exists(Source source) {
10941 InstrumentationBuilder instrumentation =
10942 Instrumentation.builder2("Analysis-exists");
10943 _checkThread(instrumentation);
10944 try {
10945 instrumentation.metric3("contextId", _contextId);
10946 return _basis.exists(source);
10947 } finally {
10948 instrumentation.log();
10949 }
10950 }
10951
10952 @override
10953 AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
10954 InstrumentationBuilder instrumentation =
10955 Instrumentation.builder2("Analysis-getAngularApplication");
10956 _checkThread(instrumentation);
10957 try {
10958 instrumentation.metric3("contextId", _contextId);
10959 return _basis.getAngularApplicationWithHtml(htmlSource);
10960 } finally {
10961 instrumentation.log();
10962 }
10963 }
10964
10965 @override
10966 CompilationUnitElement getCompilationUnitElement(Source unitSource,
10967 Source librarySource) {
10968 InstrumentationBuilder instrumentation =
10969 Instrumentation.builder2("Analysis-getCompilationUnitElement");
10970 _checkThread(instrumentation);
10971 try {
10972 instrumentation.metric3("contextId", _contextId);
10973 return _basis.getCompilationUnitElement(unitSource, librarySource);
10974 } finally {
10975 instrumentation.log();
10976 }
10977 }
10978
10979 @override
10980 TimestampedData<String> getContents(Source source) =>
10981 _basis.getContents(source);
10982
10983 @override
10984 InternalAnalysisContext getContextFor(Source source) {
10985 InstrumentationBuilder instrumentation =
10986 Instrumentation.builder2("Analysis-getContextFor");
10987 _checkThread(instrumentation);
10988 try {
10989 instrumentation.metric3("contextId", _contextId);
10990 return _basis.getContextFor(source);
10991 } finally {
10992 instrumentation.log();
10993 }
10994 }
10995
10996 @override
10997 Element getElement(ElementLocation location) {
10998 InstrumentationBuilder instrumentation =
10999 Instrumentation.builder2("Analysis-getElement");
11000 _checkThread(instrumentation);
11001 try {
11002 instrumentation.metric3("contextId", _contextId);
11003 return _basis.getElement(location);
11004 } finally {
11005 instrumentation.log();
11006 }
11007 }
11008
11009 @override
11010 AnalysisErrorInfo getErrors(Source source) {
11011 InstrumentationBuilder instrumentation =
11012 Instrumentation.builder2("Analysis-getErrors");
11013 _checkThread(instrumentation);
11014 try {
11015 instrumentation.metric3("contextId", _contextId);
11016 AnalysisErrorInfo ret = _basis.getErrors(source);
11017 if (ret != null) {
11018 instrumentation.metric2("Errors-count", ret.errors.length);
11019 }
11020 return ret;
11021 } finally {
11022 instrumentation.log();
11023 }
11024 }
11025
11026 @override
11027 HtmlElement getHtmlElement(Source source) {
11028 InstrumentationBuilder instrumentation =
11029 Instrumentation.builder2("Analysis-getHtmlElement");
11030 _checkThread(instrumentation);
11031 try {
11032 instrumentation.metric3("contextId", _contextId);
11033 return _basis.getHtmlElement(source);
11034 } finally {
11035 instrumentation.log();
11036 }
11037 }
11038
11039 @override
11040 List<Source> getHtmlFilesReferencing(Source source) {
11041 InstrumentationBuilder instrumentation =
11042 Instrumentation.builder2("Analysis-getHtmlFilesReferencing");
11043 _checkThread(instrumentation);
11044 try {
11045 instrumentation.metric3("contextId", _contextId);
11046 List<Source> ret = _basis.getHtmlFilesReferencing(source);
11047 if (ret != null) {
11048 instrumentation.metric2("Source-count", ret.length);
11049 }
11050 return ret;
11051 } finally {
11052 instrumentation.log();
11053 }
11054 }
11055
11056 @override
11057 SourceKind getKindOf(Source source) {
11058 InstrumentationBuilder instrumentation =
11059 Instrumentation.builder2("Analysis-getKindOf");
11060 _checkThread(instrumentation);
11061 try {
11062 instrumentation.metric3("contextId", _contextId);
11063 return _basis.getKindOf(source);
11064 } finally {
11065 instrumentation.log();
11066 }
11067 }
11068
11069 @override
11070 List<Source> getLibrariesContaining(Source source) {
11071 InstrumentationBuilder instrumentation =
11072 Instrumentation.builder2("Analysis-getLibrariesContaining");
11073 _checkThread(instrumentation);
11074 try {
11075 instrumentation.metric3("contextId", _contextId);
11076 List<Source> ret = _basis.getLibrariesContaining(source);
11077 if (ret != null) {
11078 instrumentation.metric2("Source-count", ret.length);
11079 }
11080 return ret;
11081 } finally {
11082 instrumentation.log2(2);
11083 //Log if 1ms
11084 }
11085 }
11086
11087 @override
11088 List<Source> getLibrariesDependingOn(Source librarySource) {
11089 InstrumentationBuilder instrumentation =
11090 Instrumentation.builder2("Analysis-getLibrariesDependingOn");
11091 _checkThread(instrumentation);
11092 try {
11093 instrumentation.metric3("contextId", _contextId);
11094 List<Source> ret = _basis.getLibrariesDependingOn(librarySource);
11095 if (ret != null) {
11096 instrumentation.metric2("Source-count", ret.length);
11097 }
11098 return ret;
11099 } finally {
11100 instrumentation.log();
11101 }
11102 }
11103
11104 @override
11105 List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
11106 InstrumentationBuilder instrumentation =
11107 Instrumentation.builder2("Analysis-getLibrariesReferencedFromHtml");
11108 _checkThread(instrumentation);
11109 try {
11110 instrumentation.metric3("contextId", _contextId);
11111 return _basis.getLibrariesReferencedFromHtml(htmlSource);
11112 } finally {
11113 instrumentation.log();
11114 }
11115 }
11116
11117 @override
11118 LibraryElement getLibraryElement(Source source) {
11119 InstrumentationBuilder instrumentation =
11120 Instrumentation.builder2("Analysis-getLibraryElement");
11121 _checkThread(instrumentation);
11122 try {
11123 instrumentation.metric3("contextId", _contextId);
11124 return _basis.getLibraryElement(source);
11125 } finally {
11126 instrumentation.log();
11127 }
11128 }
11129
11130 @override
11131 LineInfo getLineInfo(Source source) {
11132 InstrumentationBuilder instrumentation =
11133 Instrumentation.builder2("Analysis-getLineInfo");
11134 _checkThread(instrumentation);
11135 try {
11136 instrumentation.metric3("contextId", _contextId);
11137 return _basis.getLineInfo(source);
11138 } finally {
11139 instrumentation.log();
11140 }
11141 }
11142
11143 @override
11144 int getModificationStamp(Source source) {
11145 InstrumentationBuilder instrumentation =
11146 Instrumentation.builder2("Analysis-getModificationStamp");
11147 _checkThread(instrumentation);
11148 try {
11149 instrumentation.metric3("contextId", _contextId);
11150 return _basis.getModificationStamp(source);
11151 } finally {
11152 instrumentation.log();
11153 }
11154 }
11155
11156 @override
11157 Namespace getPublicNamespace(LibraryElement library) =>
11158 _basis.getPublicNamespace(library);
11159
11160 @override
11161 CompilationUnit getResolvedCompilationUnit(Source unitSource,
11162 LibraryElement library) {
11163 InstrumentationBuilder instrumentation =
11164 Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
11165 _checkThread(instrumentation);
11166 try {
11167 instrumentation.metric3("contextId", _contextId);
11168 return _basis.getResolvedCompilationUnit(unitSource, library);
11169 } finally {
11170 instrumentation.log();
11171 }
11172 }
11173
11174 @override
11175 CompilationUnit getResolvedCompilationUnit2(Source unitSource,
11176 Source librarySource) {
11177 InstrumentationBuilder instrumentation =
11178 Instrumentation.builder2("Analysis-getResolvedCompilationUnit");
11179 _checkThread(instrumentation);
11180 try {
11181 instrumentation.metric3("contextId", _contextId);
11182 return _basis.getResolvedCompilationUnit2(unitSource, librarySource);
11183 } finally {
11184 instrumentation.log2(2);
11185 //Log if over 1ms
11186 }
11187 }
11188
11189 @override
11190 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
11191 InstrumentationBuilder instrumentation =
11192 Instrumentation.builder2("Analysis-getResolvedHtmlUnit");
11193 _checkThread(instrumentation);
11194 try {
11195 instrumentation.metric3("contextId", _contextId);
11196 return _basis.getResolvedHtmlUnit(htmlSource);
11197 } finally {
11198 instrumentation.log2(2);
11199 //Log if over 1ms
11200 }
11201 }
11202
11203 @override
11204 bool isClientLibrary(Source librarySource) {
11205 InstrumentationBuilder instrumentation =
11206 Instrumentation.builder2("Analysis-isClientLibrary");
11207 _checkThread(instrumentation);
11208 try {
11209 instrumentation.metric3("contextId", _contextId);
11210 return _basis.isClientLibrary(librarySource);
11211 } finally {
11212 instrumentation.log();
11213 }
11214 }
11215
11216 @override
11217 bool isServerLibrary(Source librarySource) {
11218 InstrumentationBuilder instrumentation =
11219 Instrumentation.builder2("Analysis-isServerLibrary");
11220 _checkThread(instrumentation);
11221 try {
11222 instrumentation.metric3("contextId", _contextId);
11223 return _basis.isServerLibrary(librarySource);
11224 } finally {
11225 instrumentation.log();
11226 }
11227 }
11228
11229 @override
11230 CompilationUnit parseCompilationUnit(Source source) {
11231 InstrumentationBuilder instrumentation =
11232 Instrumentation.builder2("Analysis-parseCompilationUnit");
11233 _checkThread(instrumentation);
11234 try {
11235 instrumentation.metric3("contextId", _contextId);
11236 return _basis.parseCompilationUnit(source);
11237 } on AnalysisException catch (e, stackTrace) {
11238 _recordAnalysisException(
11239 instrumentation,
11240 new CaughtException(e, stackTrace));
11241 throw e;
11242 } finally {
11243 instrumentation.log();
11244 }
11245 }
11246
11247 @override
11248 ht.HtmlUnit parseHtmlUnit(Source source) {
11249 InstrumentationBuilder instrumentation =
11250 Instrumentation.builder2("Analysis-parseHtmlUnit");
11251 _checkThread(instrumentation);
11252 try {
11253 instrumentation.metric3("contextId", _contextId);
11254 return _basis.parseHtmlUnit(source);
11255 } on AnalysisException catch (e, stackTrace) {
11256 _recordAnalysisException(
11257 instrumentation,
11258 new CaughtException(e, stackTrace));
11259 throw e;
11260 } finally {
11261 instrumentation.log();
11262 }
11263 }
11264
11265 @override
11266 AnalysisResult performAnalysisTask() {
11267 InstrumentationBuilder instrumentation =
11268 Instrumentation.builder2("Analysis-performAnalysisTask");
11269 _checkThread(instrumentation);
11270 try {
11271 instrumentation.metric3("contextId", _contextId);
11272 AnalysisResult result = _basis.performAnalysisTask();
11273 if (result.changeNotices != null) {
11274 instrumentation.metric2(
11275 "ChangeNotice-count",
11276 result.changeNotices.length);
11277 }
11278 return result;
11279 } finally {
11280 instrumentation.log2(15);
11281 //Log if >= 15ms
11282 }
11283 }
11284
11285 @override
11286 void recordLibraryElements(Map<Source, LibraryElement> elementMap) {
11287 _basis.recordLibraryElements(elementMap);
11288 }
11289
11290 @override
11291 void removeListener(AnalysisListener listener) {
11292 _basis.removeListener(listener);
11293 }
11294
11295 @override
11296 CompilationUnit resolveCompilationUnit(Source unitSource,
11297 LibraryElement library) {
11298 InstrumentationBuilder instrumentation =
11299 Instrumentation.builder2("Analysis-resolveCompilationUnit");
11300 _checkThread(instrumentation);
11301 try {
11302 instrumentation.metric3("contextId", _contextId);
11303 return _basis.resolveCompilationUnit(unitSource, library);
11304 } on AnalysisException catch (e, stackTrace) {
11305 _recordAnalysisException(
11306 instrumentation,
11307 new CaughtException(e, stackTrace));
11308 throw e;
11309 } finally {
11310 instrumentation.log();
11311 }
11312 }
11313
11314 @override
11315 CompilationUnit resolveCompilationUnit2(Source unitSource,
11316 Source librarySource) {
11317 InstrumentationBuilder instrumentation =
11318 Instrumentation.builder2("Analysis-resolveCompilationUnit");
11319 _checkThread(instrumentation);
11320 try {
11321 instrumentation.metric3("contextId", _contextId);
11322 return _basis.resolveCompilationUnit2(unitSource, librarySource);
11323 } on AnalysisException catch (e, stackTrace) {
11324 _recordAnalysisException(
11325 instrumentation,
11326 new CaughtException(e, stackTrace));
11327 throw e;
11328 } finally {
11329 instrumentation.log();
11330 }
11331 }
11332
11333 @override
11334 ht.HtmlUnit resolveHtmlUnit(Source htmlSource) {
11335 InstrumentationBuilder instrumentation =
11336 Instrumentation.builder2("Analysis-resolveHtmlUnit");
11337 _checkThread(instrumentation);
11338 try {
11339 instrumentation.metric3("contextId", _contextId);
11340 return _basis.resolveHtmlUnit(htmlSource);
11341 } on AnalysisException catch (e, stackTrace) {
11342 _recordAnalysisException(
11343 instrumentation,
11344 new CaughtException(e, stackTrace));
11345 throw e;
11346 } finally {
11347 instrumentation.log();
11348 }
11349 }
11350
11351 @override
11352 void setChangedContents(Source source, String contents, int offset,
11353 int oldLength, int newLength) {
11354 InstrumentationBuilder instrumentation =
11355 Instrumentation.builder2("Analysis-setChangedContents");
11356 _checkThread(instrumentation);
11357 try {
11358 instrumentation.metric3("contextId", _contextId);
11359 _basis.setChangedContents(source, contents, offset, oldLength, newLength);
11360 } finally {
11361 instrumentation.log();
11362 }
11363 }
11364
11365 @override
11366 void setContents(Source source, String contents) {
11367 InstrumentationBuilder instrumentation =
11368 Instrumentation.builder2("Analysis-setContents");
11369 _checkThread(instrumentation);
11370 try {
11371 instrumentation.metric3("contextId", _contextId);
11372 _basis.setContents(source, contents);
11373 } finally {
11374 instrumentation.log();
11375 }
11376 }
11377
11378 @override
11379 void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
11380 DataDescriptor rowDesc, CacheState state)) {
11381 _basis.visitCacheItems(callback);
11382 }
11383
11384 /**
11385 * If the current thread is the UI thread, then note this in the specified ins trumentation and
11386 * append this information to the log.
11387 *
11388 * @param instrumentation the instrumentation, not `null`
11389 */
11390 static void _checkThread(InstrumentationBuilder instrumentation) {
11391 }
11392
11393 /**
11394 * Record an exception that was thrown during analysis.
11395 *
11396 * @param instrumentation the instrumentation builder being used to record the exception
11397 * @param exception the exception being reported
11398 */
11399 static void _recordAnalysisException(InstrumentationBuilder instrumentation,
11400 CaughtException exception) {
11401 instrumentation.record(exception);
11402 }
11403 }
11404
11405 /**
11406 * The interface `InternalAnalysisContext` defines additional behavior for an an alysis context 10555 * The interface `InternalAnalysisContext` defines additional behavior for an an alysis context
11407 * that is required by internal users of the context. 10556 * that is required by internal users of the context.
11408 */ 10557 */
11409 abstract class InternalAnalysisContext implements AnalysisContext { 10558 abstract class InternalAnalysisContext implements AnalysisContext {
11410 /** 10559 /**
11411 * Return an array containing all of the sources that have been marked as prio rity sources. 10560 * Return an array containing all of the sources that have been marked as prio rity sources.
11412 * Clients must not modify the returned array. 10561 * Clients must not modify the returned array.
11413 * 10562 *
11414 * @return the sources that have been marked as priority sources 10563 * @return the sources that have been marked as priority sources
11415 */ 10564 */
(...skipping 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
14457 void _setFlag(int index, bool value) { 13606 void _setFlag(int index, bool value) {
14458 _flags = BooleanArray.set(_flags, index, value); 13607 _flags = BooleanArray.set(_flags, index, value);
14459 } 13608 }
14460 13609
14461 /** 13610 /**
14462 * If the state of the value described by the given [descriptor] is changing 13611 * If the state of the value described by the given [descriptor] is changing
14463 * from ERROR to anything else, capture the information. This is an attempt to 13612 * from ERROR to anything else, capture the information. This is an attempt to
14464 * discover the underlying cause of a long-standing bug. 13613 * discover the underlying cause of a long-standing bug.
14465 */ 13614 */
14466 void _validateStateChange(DataDescriptor descriptor, CacheState newState) { 13615 void _validateStateChange(DataDescriptor descriptor, CacheState newState) {
14467 if (descriptor != CONTENT) { 13616 // TODO(brianwilkerson) Decide whether we still want to capture this data.
14468 return; 13617 // if (descriptor != CONTENT) {
14469 } 13618 // return;
14470 CachedResult result = resultMap[CONTENT]; 13619 // }
14471 if (result != null && result.state == CacheState.ERROR) { 13620 // CachedResult result = resultMap[CONTENT];
14472 String message = 13621 // if (result != null && result.state == CacheState.ERROR) {
14473 "contentState changing from ${result.state} to $newState"; 13622 // String message =
14474 InstrumentationBuilder builder = 13623 // "contentState changing from ${result.state} to $newState";
14475 Instrumentation.builder2("SourceEntry-validateStateChange"); 13624 // InstrumentationBuilder builder =
14476 builder.data3("message", message); 13625 // Instrumentation.builder2("SourceEntry-validateStateChange");
14477 //builder.data("source", source.getFullName()); 13626 // builder.data3("message", message);
14478 builder.record(new CaughtException(new AnalysisException(message), null)); 13627 // //builder.data("source", source.getFullName());
14479 builder.log(); 13628 // builder.record(new CaughtException(new AnalysisException(message), null) );
14480 } 13629 // builder.log();
13630 // }
14481 } 13631 }
14482 13632
14483 /** 13633 /**
14484 * Write a textual representation of the difference between the [oldEntry] and 13634 * Write a textual representation of the difference between the [oldEntry] and
14485 * this entry to the given string [buffer]. Return `true` if some difference 13635 * this entry to the given string [buffer]. Return `true` if some difference
14486 * was written. 13636 * was written.
14487 */ 13637 */
14488 bool _writeDiffOn(StringBuffer buffer, SourceEntry oldEntry) { 13638 bool _writeDiffOn(StringBuffer buffer, SourceEntry oldEntry) {
14489 bool needsSeparator = false; 13639 bool needsSeparator = false;
14490 CaughtException oldException = oldEntry.exception; 13640 CaughtException oldException = oldEntry.exception;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
14976 14126
14977 @override 14127 @override
14978 Object visitPolymerTagDartElement(PolymerTagDartElement element) { 14128 Object visitPolymerTagDartElement(PolymerTagDartElement element) {
14979 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { 14129 if (element.name == PolymerHtmlUnitBuilder_this._elementName) {
14980 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( 14130 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError(
14981 element as PolymerTagDartElementImpl); 14131 element as PolymerTagDartElementImpl);
14982 } 14132 }
14983 return null; 14133 return null;
14984 } 14134 }
14985 } 14135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698