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

Side by Side Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library elements; 5 library elements;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constructors.dart'; 10 import '../constants/constructors.dart';
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 abstract class LocalElement extends Element 989 abstract class LocalElement extends Element
990 implements AstElement, TypedElement, Local {} 990 implements AstElement, TypedElement, Local {}
991 991
992 /// A top level, static or instance field, a formal parameter or local variable. 992 /// A top level, static or instance field, a formal parameter or local variable.
993 abstract class VariableElement extends ExecutableElement { 993 abstract class VariableElement extends ExecutableElement {
994 @override 994 @override
995 VariableDefinitions get node; 995 VariableDefinitions get node;
996 996
997 Expression get initializer; 997 Expression get initializer;
998 998
999 /// The constant expression defining the value of the variable if `const`, 999 /// The constant expression defining the (initial) value of the variable.
1000 /// `null` otherwise. 1000 ///
1001 /// If the variable is `const` the value is always non-null, possibly an
1002 /// [ErroneousConstantExpression], otherwise, the value is null when the
1003 /// initializer isn't a constant expression.
1001 ConstantExpression get constant; 1004 ConstantExpression get constant;
1002 } 1005 }
1003 1006
1004 /// An entity that defines a local entity (memory slot) in generated code. 1007 /// An entity that defines a local entity (memory slot) in generated code.
1005 /// 1008 ///
1006 /// Parameters, local variables and local functions (can) define local entity 1009 /// Parameters, local variables and local functions (can) define local entity
1007 /// and thus implement [Local] through [LocalElement]. For non-element locals, 1010 /// and thus implement [Local] through [LocalElement]. For non-element locals,
1008 /// like `this` and boxes, specialized [Local] classes are created. 1011 /// like `this` and boxes, specialized [Local] classes are created.
1009 /// 1012 ///
1010 /// Type variables can introduce locals in factories and constructors 1013 /// Type variables can introduce locals in factories and constructors
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 /// by a field. 1797 /// by a field.
1795 bool get isDeclaredByField; 1798 bool get isDeclaredByField;
1796 1799
1797 /// Returns `true` if this member is abstract. 1800 /// Returns `true` if this member is abstract.
1798 bool get isAbstract; 1801 bool get isAbstract;
1799 1802
1800 /// If abstract, [implementation] points to the overridden concrete member, 1803 /// If abstract, [implementation] points to the overridden concrete member,
1801 /// if any. Otherwise [implementation] points to the member itself. 1804 /// if any. Otherwise [implementation] points to the member itself.
1802 Member get implementation; 1805 Member get implementation;
1803 } 1806 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698