Chromium Code Reviews| 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); |