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

Unified Diff: frog/leg/emitter.dart

Issue 9382041: Support getting of static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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: frog/leg/emitter.dart
diff --git a/frog/leg/emitter.dart b/frog/leg/emitter.dart
index c6642c1eef92307123593607d40b110f1100b5dc..68257067490435a8d6d6a408b43fa899fe265019 100644
--- a/frog/leg/emitter.dart
+++ b/frog/leg/emitter.dart
@@ -266,6 +266,23 @@ function(child, parent) {
namer.isolateBailoutPropertyAccess);
}
+ void emitStaticFunctionGetters(StringBuffer buffer) {
+ Set<FunctionElement> functionsNeedingGetter =
+ compiler.universe.staticFunctionsNeedingGetter;
+ for (FunctionElement element in functionsNeedingGetter) {
+ FunctionElement callElement =
ngeoffray 2012/02/13 10:21:52 Please explain why you need to create a temporary
floitsch 2012/02/13 12:34:02 Done.
+ new FunctionElement.from(Namer.CLOSURE_INVOCATION_NAME,
+ element,
+ null);
+ String staticName = namer.isolatePropertyAccess(element);
+ int parameterCount = element.parameterCount(compiler);
+ String invocationName =
+ namer.instanceMethodName(callElement.name, parameterCount);
+ buffer.add("$staticName.$invocationName = $staticName;\n");
+ addParameterStubs(callElement, staticName, buffer);
+ }
+ }
+
void emitStaticNonFinalFieldInitializations(StringBuffer buffer) {
// Adds initializations inside the Isolate constructor.
// Example:
@@ -357,6 +374,7 @@ function(child, parent) {
emitClasses(buffer);
emitNoSuchMethodCalls(buffer);
emitStaticFunctions(buffer);
+ emitStaticFunctionGetters(buffer);
emitStaticFinalFieldInitializations(buffer);
buffer.add('var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n');
Element main = compiler.mainApp.find(Compiler.MAIN);
« no previous file with comments | « frog/leg/compiler.dart ('k') | frog/leg/lib/core.dart » ('j') | frog/leg/universe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698