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

Unified Diff: dart/frog/leg/ssa/codegen.dart

Issue 9689045: Library privacy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/leg/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/codegen.dart
diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
index 8dd613c7f7840fd81862e2fee068986eb394e583..7c4d7ff18b978ee558f0723671dc52578cb301b2 100644
--- a/dart/frog/leg/ssa/codegen.dart
+++ b/dart/frog/leg/ssa/codegen.dart
@@ -108,6 +108,8 @@ class SsaCodeGenerator implements HVisitor {
// if branches.
SubGraph subGraph;
+ LibraryElement get currentLibrary() => work.element.getLibrary();
+
SsaCodeGenerator(this.compiler,
this.work,
this.buffer,
@@ -535,13 +537,17 @@ class SsaCodeGenerator implements HVisitor {
// Avoid adding the generative constructor name to the list of
// seen selectors.
if (node.inputs[0] is HForeignNew) {
+ HForeignNew foreignNew = node.inputs[0];
// Remove 'this' from the number of arguments.
int argumentCount = node.inputs.length - 1;
- buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
+
+ // TODO(ahe): The constructor name was statically resolved in
+ // SsaBuilder.buildFactory. Is there a cleaner way to do this?
+ node.name.printOn(buffer);
visitArguments(node.inputs);
} else {
buffer.add(compiler.namer.instanceMethodInvocationName(
- node.name, node.selector));
+ currentLibrary, node.name, node.selector));
visitArguments(node.inputs);
compiler.registerDynamicInvocation(node.name, node.selector);
}
@@ -552,7 +558,7 @@ class SsaCodeGenerator implements HVisitor {
beginExpression(JSPrecedence.CALL_PRECEDENCE);
use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE);
buffer.add('.');
- buffer.add(compiler.namer.setterName(node.name));
+ buffer.add(compiler.namer.setterName(currentLibrary, node.name));
visitArguments(node.inputs);
compiler.registerDynamicSetter(node.name);
endExpression(JSPrecedence.CALL_PRECEDENCE);
@@ -562,7 +568,7 @@ class SsaCodeGenerator implements HVisitor {
beginExpression(JSPrecedence.CALL_PRECEDENCE);
use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE);
buffer.add('.');
- buffer.add(compiler.namer.getterName(node.name));
+ buffer.add(compiler.namer.getterName(currentLibrary, node.name));
visitArguments(node.inputs);
compiler.registerDynamicGetter(node.name);
endExpression(JSPrecedence.CALL_PRECEDENCE);
@@ -595,7 +601,7 @@ class SsaCodeGenerator implements HVisitor {
int argumentCount = node.inputs.length - 2;
String className = compiler.namer.isolatePropertyAccess(superClass);
String methodName = compiler.namer.instanceMethodName(
- superMethod.name, argumentCount);
+ currentLibrary, superMethod.name, argumentCount);
buffer.add('$className.prototype.$methodName.call');
visitArguments(node.inputs);
endExpression(JSPrecedence.CALL_PRECEDENCE);
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/leg/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698