| Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
|
| index 974f5616b6b3d1fc00013fa34400c5585e43d9cb..6c9ae788f734b747881595d7fbb2f6533e43c00c 100644
|
| --- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
|
| +++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
|
| @@ -593,6 +593,36 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
|
| }
|
|
|
| @override
|
| + void visitCheckLibraryIsLoaded(ir.CheckLibraryIsLoaded checkLoad) {
|
| + HInstruction prefixConstant = graph.addConstantString(
|
| + new DartString.literal(checkLoad.import.name), closedWorld);
|
| + // TODO(efortuna): Optimization opportunity! Make this constant file name
|
| + // some sort of global constant (or a constant in the check loaded function)
|
| + // to look up rather than always passing in. Also note that the URI passed
|
| + // here is longer that in the original one, which called
|
| + // compiler.deferredLoadTask.getImportDeferName and then also needed the
|
| + // previsit function to hold the prefix element.
|
| + HInstruction uriConstant = graph.addConstantString(
|
| + new DartString.literal(
|
| + checkLoad.import.importedLibrary.importUri.toString()), closedWorld);
|
| + _pushStaticInvocation(astAdapter.checkDeferredIsLoaded,
|
| + [prefixConstant, uriConstant], astAdapter.checkDeferredIsLoadedType);
|
| + }
|
| +
|
| + @override
|
| + void visitLoadLibrary(ir.LoadLibrary loadLibrary) {
|
| + // TODO(efortuna): Source information!
|
| + push(new HInvokeStatic(
|
| + backend.helpers.loadLibraryWrapper,
|
| + [
|
| + graph.addConstantString(
|
| + new DartString.literal(loadLibrary.import.name), closedWorld)
|
| + ],
|
| + commonMasks.nonNullType,
|
| + targetCanThrow: false));
|
| + }
|
| +
|
| + @override
|
| void visitBlock(ir.Block block) {
|
| assert(!isAborted());
|
| for (ir.Statement statement in block.statements) {
|
| @@ -1830,8 +1860,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
|
| // Invoke the getter
|
| _pushStaticInvocation(staticTarget, const <HInstruction>[],
|
| astAdapter.returnTypeOf(staticTarget));
|
| - } else if (staticTarget is ir.Field && staticTarget.isConst) {
|
| - assert(staticTarget.initializer != null);
|
| + } else if (staticTarget is ir.Field &&
|
| + (staticTarget.isConst ||
|
| + staticTarget.isFinal && !_isLazyStatic(staticTarget))) {
|
| stack.add(graph.addConstant(
|
| astAdapter.getConstantFor(staticTarget.initializer), closedWorld));
|
| } else {
|
|
|