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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 12753003: Recognize const/fixed/growable arrays in simple types inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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: sdk/lib/_internal/compiler/implementation/elements/elements.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/elements/elements.dart (revision 19764)
+++ sdk/lib/_internal/compiler/implementation/elements/elements.dart (working copy)
@@ -486,6 +486,23 @@
static List<Element> sortedByPosition(Iterable<Element> elements) {
return elements.toList()..sort(compareByPosition);
}
+
+ static bool isFixedListConstructorCall(Element element,
+ Node node,
+ Compiler compiler) {
+ return element == compiler.unnamedListConstructor
+ && node.isCall
+ && !node.arguments.isEmpty
+ && node.arguments.tail.isEmpty;
+ }
+
+ static bool isGrowableListConstructorCall(Element element,
+ Node node,
+ Compiler compiler) {
+ return element == compiler.unnamedListConstructor
+ && node.isCall
+ && node.arguments.isEmpty;
+ }
}
abstract class ErroneousElement extends Element implements FunctionElement {

Powered by Google App Engine
This is Rietveld 408576698