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

Unified Diff: dart/frog/leg/ssa/builder.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/builder.dart
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
index 765ea257ec8d90e0ba3428f8ef951d2e9ee3c7c9..ca62d484594bbc747d44e1a9f527053558ba94ff 100644
--- a/dart/frog/leg/ssa/builder.dart
+++ b/dart/frog/leg/ssa/builder.dart
@@ -711,6 +711,8 @@ class SsaBuilder implements Visitor {
// if a labeled statement is labeling a loop).
BreakHandler loopBreakHandler = null;
+ LibraryElement get currentLibrary() => work.element.getLibrary();
+
SsaBuilder(Compiler compiler, WorkItem work)
: this.compiler = compiler,
this.work = work,
@@ -896,7 +898,13 @@ class SsaBuilder implements Visitor {
body.functionParameters.forEachParameter((parameter) {
bodyCallInputs.add(localsHandler.readLocal(parameter));
});
- SourceString methodName = body.name;
+ SourceString methodName;
+ if (body.name.isPrivate()) {
ngeoffray 2012/03/13 12:47:11 Why do you need to do this and avoid it in codegen
floitsch 2012/03/13 13:28:56 I'm don't think this is necessary at all. Construc
ahe 2012/03/17 22:19:44 I'm not sure how to invoke a statically resolved m
+ methodName = new SourceString(compiler.namer.instanceMethodName(
+ constructor.getLibrary(), body.name, bodyCallInputs.length - 1));
+ } else {
+ methodName = body.name;
+ }
add(new HInvokeDynamicMethod(null, methodName, bodyCallInputs));
}
close(new HReturn(newObject)).addSuccessor(graph.exit);
@@ -1761,7 +1769,7 @@ class SsaBuilder implements Visitor {
}
addGenericSendArgumentsToList(node.arguments, inputs);
String name = compiler.namer.instanceMethodName(
- Namer.OPERATOR_EQUALS, 1);
+ currentLibrary, Namer.OPERATOR_EQUALS, 1);
push(new HForeign(new DartString.literal('\$0.$name'),
const LiteralDartString('bool'),
inputs));

Powered by Google App Engine
This is Rietveld 408576698