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

Unified Diff: pkg/compiler/lib/src/stats/naive_analysis_result.dart

Issue 1220043005: dart2js send stats, includes: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/stats/naive_analysis_result.dart
diff --git a/pkg/compiler/lib/src/stats/naive_analysis_result.dart b/pkg/compiler/lib/src/stats/naive_analysis_result.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0061be42e4741d181ff26d1feb0768c6a36423ed
--- /dev/null
+++ b/pkg/compiler/lib/src/stats/naive_analysis_result.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// API to get results from a static analysis of the source program.
+// TODO(sigmund): split out implementations out of this file.
+library compiler.src.stats.naive_analysis_result;
+
+import 'analysis_result.dart';
+import '../tree/tree.dart' show Node;
+import '../universe/selector.dart' show Selector;
+
+/// A naive [AnalysisResult] that tells us very little. This is the most
+/// conservative we can be when we only use information from the AST structure
+/// and from resolution, but no type information.
+class NaiveAnalysisResult implements AnalysisResult {
+ NaiveAnalysisResult();
+
+ ReceiverInfo infoForReceiver(Node receiver) =>
+ new NaiveReceiverInfo(receiver);
+ SelectorInfo infoForSelector(Node receiver, Selector selector) =>
+ new NaiveSelectorInfo(receiver, selector);
+}
+
+class NaiveReceiverInfo implements ReceiverInfo {
+ final Node receiver;
+
+ NaiveReceiverInfo(this.receiver);
+ Boolish get hasNoSuchMethod => Boolish.maybe;
+ Boolish get isNull => Boolish.maybe;
+ int get possibleNsmTargets => -1;
+}
+
+class NaiveSelectorInfo implements SelectorInfo {
+ final Node receiver;
+ final Selector selector;
+
+ NaiveSelectorInfo(this.receiver, this.selector);
+
+ Boolish get exists => Boolish.maybe;
+ Boolish get usesInterceptor => Boolish.maybe;
+ int get possibleTargets => -1;
+ bool get isAccurate => false;
+}
« no previous file with comments | « pkg/compiler/lib/src/stats/builder.dart ('k') | pkg/compiler/lib/src/stats/trusted_types_analysis_result.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698