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

Unified Diff: pkg/compiler/lib/src/ssa/builder.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/modelz.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index ba809faf01b0508593a5bca2abe17c42b722ec8d..a05158d6d1282f1404f9ad730232ab16683a7868 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -4145,13 +4145,13 @@ class SsaBuilder extends ast.Visitor
}
Element element = elements[argument];
if (element == null ||
- element is! FieldElement ||
+ element is! EnumConstantElement ||
element.enclosingClass != helpers.jsGetNameEnum) {
reporter.reportErrorMessage(argument, MessageKind.GENERIC,
{'text': 'Error: Expected a JsGetName enum value.'});
}
- EnumClassElement enumClass = element.enclosingClass;
- int index = enumClass.enumValues.indexOf(element);
+ EnumConstantElement enumConstant = element;
+ int index = enumConstant.index;
stack.add(addConstantStringFromName(
backend.namer.getNameForJsGetName(argument, JsGetName.values[index])));
}
@@ -4166,13 +4166,13 @@ class SsaBuilder extends ast.Visitor
Element builtinElement = elements[arguments[1]];
if (builtinElement == null ||
- (builtinElement is! FieldElement) ||
+ (builtinElement is! EnumConstantElement) ||
builtinElement.enclosingClass != helpers.jsBuiltinEnum) {
reporter.reportErrorMessage(argument, MessageKind.GENERIC,
{'text': 'Error: Expected a JsBuiltin enum value.'});
}
- EnumClassElement enumClass = builtinElement.enclosingClass;
- int index = enumClass.enumValues.indexOf(builtinElement);
+ EnumConstantElement enumConstant = builtinElement;
+ int index = enumConstant.index;
js.Template template =
backend.emitter.builtinTemplateFor(JsBuiltin.values[index]);
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698