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

Unified Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 1873823002: Update elements, nodes and visitors for serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/serialization/equivalence.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/modelz.dart
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index 751d0c86df18c76c5399c4d40514c8ca8f3b5899..97a327a1c2b278979c3cbfd446a2aecbd9efabf0 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -439,7 +439,10 @@ class LibraryElementZ extends DeserializedElementZ
}
@override
- Element findExported(String elementName) => _unsupported('findExported');
+ Element findExported(String elementName) {
+ _ensureExports();
+ return _exportsMap.lookup(elementName);
+ }
void _ensureImports() {
if (_importsMap == null) {
@@ -1301,6 +1304,14 @@ class StaticFieldElementZ extends FieldElementZ
StaticFieldElementZ(ObjectDecoder decoder) : super(decoder);
}
+class EnumConstantElementZ extends StaticFieldElementZ
+ implements EnumConstantElement {
+ EnumConstantElementZ(ObjectDecoder decoder)
+ : super(decoder);
+
+ int get index => _decoder.getInt(Key.INDEX);
+}
+
class InstanceFieldElementZ extends FieldElementZ
with ClassMemberMixin, InstanceMemberMixin {
InstanceFieldElementZ(ObjectDecoder decoder) : super(decoder);
@@ -1777,6 +1788,48 @@ class InitializingFormalElementZ extends ParameterElementZ
ElementKind get kind => ElementKind.INITIALIZING_FORMAL;
}
+
+class LocalVariableElementZ extends DeserializedElementZ
+ with
+ AnalyzableElementMixin,
+ AstElementMixin,
+ LocalExecutableMixin,
+ TypedElementMixin
+ implements LocalVariableElement {
+ bool _isConst;
+ ConstantExpression _constant;
+
+ LocalVariableElementZ(ObjectDecoder decoder) : super(decoder);
+
+ @override
+ accept(ElementVisitor visitor, arg) {
+ return visitor.visitLocalVariableElement(this, arg);
+ }
+
+ @override
+ ElementKind get kind => ElementKind.VARIABLE;
+
+ @override
+ bool get isConst {
+ if (_isConst == null) {
+ _constant = _decoder.getConstant(Key.CONSTANT);
+ _isConst = _constant != null;
+ }
+ return _isConst;
+ }
+
+ @override
+ ConstantExpression get constant {
+ if (isConst) {
+ return _constant;
+ }
+ return null;
+ }
+
+ @override
+ Expression get initializer => _unsupported('initializer');
+}
+
class ImportElementZ extends DeserializedElementZ
with LibraryMemberMixin
implements ImportElement {
« no previous file with comments | « pkg/compiler/lib/src/serialization/equivalence.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698