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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10831154: Make field-get/set work without elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 8 years, 4 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 | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 1ef09f150366d92b7012dd2e92fe84fd3cc3afb6..e7bb18399fd799743546577fa73aa1f069ac29df 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1811,7 +1811,14 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
buffer.add('$className.prototype.$methodName.call');
visitArguments(node.inputs);
} else if (superMethod.kind == ElementKind.FIELD) {
- buffer.add('this.${compiler.namer.getName(superMethod)}');
+ ClassElement currentClass = work.element.enclosingElement;
+ if (currentClass.isShadowedByField(superMethod)) {
+ buffer.add('this.${compiler.namer.shadowedFieldName(superMethod)}');
+ } else {
+ LibraryElement library = superMethod.getLibrary();
+ SourceString name = superMethod.name;
+ buffer.add('this.${compiler.namer.instanceFieldName(library, name)}');
+ }
} else {
assert(superMethod.kind == ElementKind.GETTER ||
superMethod.kind == ElementKind.SETTER);
@@ -1831,7 +1838,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
visitFieldGet(HFieldGet node) {
- String name = compiler.namer.getName(node.element);
+ String name =
+ compiler.namer.instanceFieldName(node.library, node.fieldName);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE);
buffer.add('.');
@@ -1864,7 +1872,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
backend.updateFieldConstructorSetters(node.element,
node.value.guaranteedType);
}
- String name = compiler.namer.getName(node.element);
+ String name =
+ compiler.namer.instanceFieldName(node.library, node.fieldName);
beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE);
buffer.add('.');
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698