Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| index b42ae6af9dff58125321df4620d161b83b7f5af6..989e881a3454f32539fc2fb44a2341c8abd4109a 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| @@ -2968,10 +2968,22 @@ class SsaBuilder extends ResolvedVisitor { |
| generateInstanceGetterWithCompiledReceiver( |
| send, elements.getSelector(send), receiver); |
| } else if (Elements.isStaticOrTopLevelFunction(element)) { |
| - // TODO(5346): Try to avoid the need for calling [declaration] before |
| - // creating an [HStatic]. |
| - push(new HStatic(element.declaration, backend.nonNullType)); |
| - // TODO(ahe): This should be registered in codegen. |
| + if (element.isDeferredLoaderGetter()) { |
|
floitsch
2014/03/19 21:04:51
Can't you handle this one like all the other forei
sigurdm
2014/03/20 12:26:33
Other foreigns are only handled as calls (not in a
|
| + FunctionElement deferredLoader = element; |
| + Element loadFunction = compiler.loadLibraryFunction; |
| + PrefixElement prefixElement = deferredLoader.enclosingElement; |
| + String loadId = |
| + compiler.deferredLoadTask.importDeferName[prefixElement.import]; |
| + var inputs = [graph.addConstantString( |
| + new ast.DartString.literal(loadId), compiler)]; |
| + push(new HInvokeStatic(loadFunction, inputs, backend.nonNullType, |
| + targetCanThrow: false)); |
| + } else { |
| + // TODO(5346): Try to avoid the need for calling [declaration] before |
| + // creating an [HStatic]. |
| + push(new HStatic(element.declaration, backend.nonNullType)); |
| + // TODO(ahe): This should be registered in codegen. |
| + } |
| compiler.enqueuer.codegen.registerGetOfStaticFunction( |
| element.declaration); |
| } else if (Elements.isErroneousElement(element)) { |