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

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
Index: dart/frog/leg/ssa/codegen.dart
diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
index a7291bcb8fe9e0bf4af7310836ac4d8ad3a995b9..398e763c041e8109ffa1dcbb943b1a96df1395a5 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,
@@ -521,13 +523,19 @@ 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));
+ if (node.name.isPrivate()) {
floitsch 2012/03/13 13:28:56 static elements don't need to be mangled wrt priva
ahe 2012/03/17 22:19:44 Done.
+ buffer.add(node.name);
+ } else {
+ buffer.add(compiler.namer.instanceMethodName(currentLibrary,
+ node.name, argumentCount));
+ }
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);
}
@@ -538,7 +546,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);
@@ -548,7 +556,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);
@@ -581,7 +589,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);

Powered by Google App Engine
This is Rietveld 408576698