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

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, 5 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..6053c413c455c0bfec7f0f2b56ce55d7a48df77e
--- /dev/null
+++ b/pkg/compiler/lib/src/stats/naive_analysis_result.dart
@@ -0,0 +1,43 @@
+// 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.analysis_result;
+
+import 'analysis_result.dart';
+import '../tree/tree.dart' show Node;
+import '../universe/universe.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;
+}
+
+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;
+}

Powered by Google App Engine
This is Rietveld 408576698