| Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
|
| index 946cdb55d82f09bdc4ebbaee426677fffabc4715..8963247eb9d4510d4812b190ecaa65947a79de88 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
|
| @@ -95,6 +95,9 @@ class IrBuilderTask extends CompilerTask {
|
| }
|
|
|
| bool canBuild(Element element) {
|
| + // If using JavaScript backend, don't try to bail out early.
|
| + if (compiler.backend is JavaScriptBackend) return true;
|
| +
|
| if (element is TypedefElement) return false;
|
| if (element is FunctionElement) {
|
| // TODO(sigurdm): Support native functions for dart2js.
|
| @@ -1754,21 +1757,6 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
|
| });
|
| }
|
|
|
| - @override
|
| - ir.Primitive handleConstructorInvoke(
|
| - ast.NewExpression node,
|
| - ConstructorElement constructor,
|
| - DartType type,
|
| - ast.NodeList arguments,
|
| - Selector selector, _) {
|
| - List<ir.Primitive> arguments =
|
| - node.send.arguments.mapToList(visit, growable:false);
|
| - arguments = normalizeStaticArguments(
|
| - selector.callStructure, constructor, arguments);
|
| - return irBuilder.buildConstructorInvocation(
|
| - constructor, selector, type, arguments);
|
| - }
|
| -
|
| ir.Primitive visitStringJuxtaposition(ast.StringJuxtaposition node) {
|
| assert(irBuilder.isOpen);
|
| ir.Primitive first = visit(node.first);
|
| @@ -2121,6 +2109,22 @@ class DartIrBuilderVisitor extends IrBuilderVisitor {
|
| irBuilder.add(new ir.LetPrim(prim));
|
| return prim;
|
| }
|
| +
|
| + @override
|
| + ir.Primitive handleConstructorInvoke(
|
| + ast.NewExpression node,
|
| + ConstructorElement constructor,
|
| + DartType type,
|
| + ast.NodeList arguments,
|
| + Selector selector, _) {
|
| + List<ir.Primitive> arguments =
|
| + node.send.arguments.mapToList(visit, growable:false);
|
| + return irBuilder.buildConstructorInvocation(
|
| + constructor,
|
| + selector,
|
| + type,
|
| + arguments);
|
| + }
|
| }
|
|
|
| /// The [IrBuilder]s view on the information about the program that has been
|
| @@ -2707,6 +2711,24 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
|
| irBuilder.add(new ir.LetPrim(type));
|
| return type;
|
| }
|
| +
|
| + @override
|
| + ir.Primitive handleConstructorInvoke(
|
| + ast.NewExpression node,
|
| + ConstructorElement constructor,
|
| + DartType type,
|
| + ast.NodeList arguments,
|
| + Selector selector, _) {
|
| + List<ir.Primitive> arguments =
|
| + node.send.arguments.mapToList(visit, growable:false);
|
| + arguments = normalizeStaticArguments(
|
| + selector.callStructure, constructor, arguments);
|
| + return irBuilder.buildConstructorInvocation(
|
| + constructor.effectiveTarget,
|
| + selector,
|
| + constructor.computeEffectiveTargetType(type),
|
| + arguments);
|
| + }
|
| }
|
|
|
| /// Interface for generating [SourceInformation] for the CPS.
|
|
|