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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 /// API to get results from a static analysis of the source program.
6 // TODO(sigmund): split out implementations out of this file.
7 library compiler.src.stats.analysis_result;
8
9 import 'analysis_result.dart';
10 import '../tree/tree.dart' show Node;
11 import '../universe/universe.dart' show Selector;
12
13 /// A naive [AnalysisResult] that tells us very little. This is the most
14 /// conservative we can be when we only use information from the AST structure
15 /// and from resolution, but no type information.
16 class NaiveAnalysisResult implements AnalysisResult {
17 NaiveAnalysisResult();
18
19 ReceiverInfo infoForReceiver(Node receiver) =>
20 new NaiveReceiverInfo(receiver);
21 SelectorInfo infoForSelector(Node receiver, Selector selector) =>
22 new NaiveSelectorInfo(receiver, selector);
23 }
24
25 class NaiveReceiverInfo implements ReceiverInfo {
26 final Node receiver;
27
28 NaiveReceiverInfo(this.receiver);
29 boolish get hasNoSuchMethod => boolish.maybe;
30 boolish get isNull => boolish.maybe;
31 }
32
33 class NaiveSelectorInfo implements SelectorInfo {
34 final Node receiver;
35 final Selector selector;
36
37 NaiveSelectorInfo(this.receiver, this.selector);
38
39 boolish get exists => boolish.maybe;
40 boolish get usesInterceptor => boolish.maybe;
41 int get possibleTargets => -1;
42 bool get isAccurate => false;
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698