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

Unified Diff: pkg/compiler/lib/src/elements/common.dart

Issue 2925263002: A step towards handling `new Object()` in compile_from_dill_test (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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/closure.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/common.dart
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index b307f09d5aafc99d92132f285f40413292df81e2..003efbb3e8739f485dc7834bd13a45d8d2dcfc97 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -355,7 +355,7 @@ abstract class ClassElementCommon implements ClassElement {
// example when emitting the initializers of fields.
classElement.forEachLocalMember((e) => f(classElement, e));
if (includeBackendMembers) {
- classElement.forEachBackendMember((e) => f(classElement, e));
+ classElement.forEachConstructorBody((e) => f(classElement, e));
}
if (includeInjectedMembers) {
if (classElement.isPatched) {
@@ -473,23 +473,19 @@ abstract class ClassElementCommon implements ClassElement {
// backendMembers are members that have been added by the backend to simplify
// compilation. They don't have any user-side counter-part.
- Link<Element> backendMembers = const Link<Element>();
+ List<ConstructorBodyElement> constructorBodies = <ConstructorBodyElement>[];
- bool get hasBackendMembers => !backendMembers.isEmpty;
+ bool get hasConstructorBodies => !constructorBodies.isEmpty;
- void addBackendMember(Element member) {
+ void addConstructorBody(ConstructorBodyElement member) {
// TODO(ngeoffray): Deprecate this method.
assert(member.isGenerativeConstructorBody);
- backendMembers = backendMembers.prepend(member);
- }
-
- void reverseBackendMembers() {
- backendMembers = backendMembers.reverse();
+ constructorBodies.add(member);
}
/// Lookup a synthetic element created by the backend.
- Element lookupBackendMember(String memberName) {
- for (Element element in backendMembers) {
+ ConstructorBodyElement lookupConstructorBody(String memberName) {
+ for (ConstructorBodyElement element in constructorBodies) {
if (element.name == memberName) {
return element;
}
@@ -497,8 +493,8 @@ abstract class ClassElementCommon implements ClassElement {
return null;
}
- void forEachBackendMember(void f(Element member)) {
- backendMembers.forEach(f);
+ void forEachConstructorBody(void f(ConstructorBodyElement member)) {
+ constructorBodies.forEach(f);
}
}
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698