| Index: dart/frog/leg/ssa/builder.dart
|
| diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
|
| index 9db538b274b2a99adeeb0344025f2d09cbd55fff..cd79469ea602e2ed3a07858a01935bec4ac5753a 100644
|
| --- a/dart/frog/leg/ssa/builder.dart
|
| +++ b/dart/frog/leg/ssa/builder.dart
|
| @@ -93,6 +93,10 @@ class Interceptors {
|
| Element getExceptionUnwrapper() {
|
| return compiler.findHelper(const SourceString('unwrapException'));
|
| }
|
| +
|
| + Element getMapMaker() {
|
| + return compiler.findHelper(const SourceString('makeLiteralMap'));
|
| + }
|
| }
|
|
|
| class SsaBuilderTask extends CompilerTask {
|
| @@ -2236,11 +2240,25 @@ class SsaBuilder implements Visitor {
|
| }
|
|
|
| visitLiteralMap(LiteralMap node) {
|
| - generateUnimplemented('literal map not implemented', isExpression: true);
|
| + List<HInstruction> inputs = <HInstruction>[];
|
| + for (Link<Node> link = node.entries.nodes;
|
| + !link.isEmpty();
|
| + link = link.tail) {
|
| + visit(link.head);
|
| + inputs.addLast(pop());
|
| + inputs.addLast(pop());
|
| + }
|
| + HLiteralList keyValuePairs = new HLiteralList(inputs, node.isConst());
|
| + HStatic mapMaker = new HStatic(interceptors.getMapMaker());
|
| + add(keyValuePairs);
|
| + add(mapMaker);
|
| + inputs = <HInstruction>[mapMaker, keyValuePairs];
|
| + push(new HInvokeStatic(Selector.INVOCATION_1, inputs));
|
| }
|
|
|
| visitLiteralMapEntry(LiteralMapEntry node) {
|
| - compiler.unimplemented('SsaBuilder.visitLiteralMapEntry', node: node);
|
| + visit(node.value);
|
| + visit(node.key);
|
| }
|
|
|
| visitNamedArgument(NamedArgument node) {
|
|
|