| Index: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
|
| index 9c6d99fea1fa9ef1702ca33c2325425e20502a31..777c6d22d9e8123004fd0aa49a45a64778f2bab3 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
|
| @@ -350,6 +350,14 @@ class IrBuilder {
|
| return environment.lookup(local);
|
| }
|
|
|
| + /// Create a get access of the static [element].
|
| + ir.Primitive buildGetStatic(Element element, Selector selector) {
|
| + assert(isOpen);
|
| + assert(selector.isGetter);
|
| + return continueWithExpression(
|
| + (k) => new ir.InvokeStatic(element, selector, k, []));
|
| + }
|
| +
|
| /**
|
| * Add an explicit `return null` for functions that don't have a return
|
| * statement on each branch. This includes functions with an empty body,
|
| @@ -1438,7 +1446,7 @@ class IrBuilderVisitor extends ResolvedVisitor<ir.Primitive> with IrBuilder {
|
| Elements.isInstanceField(element) ||
|
| Elements.isInstanceMethod(element) ||
|
| selector.isIndex ||
|
| - // TODO(johnniwinther): clean up semantics of resultion.
|
| + // TODO(johnniwinther): clean up semantics of resolution.
|
| node.isSuperCall) {
|
| // Dynamic dispatch to a getter. Sometimes resolution will suggest a
|
| // target element, but in these cases we must still emit a dynamic
|
| @@ -1458,13 +1466,13 @@ class IrBuilderVisitor extends ResolvedVisitor<ir.Primitive> with IrBuilder {
|
| (k) => createDynamicInvoke(node, selector, receiver, k, arguments));
|
| } else if (element.isField || element.isGetter || element.isErroneous ||
|
| element.isSetter) {
|
| + // TODO(johnniwinther): Change handling of setter selectors.
|
| // Access to a static field or getter (non-static case handled above).
|
| // Even if there is only a setter, we compile as if it was a getter,
|
| // so the vm can fail at runtime.
|
| assert(selector.kind == SelectorKind.GETTER ||
|
| selector.kind == SelectorKind.SETTER);
|
| - result = continueWithExpression(
|
| - (k) => new ir.InvokeStatic(element, selector, k, []));
|
| + result = buildGetStatic(element, selector);
|
| } else if (Elements.isStaticOrTopLevelFunction(element)) {
|
| // Convert a top-level or static function to a function object.
|
| result = translateConstant(node);
|
|
|