Chromium Code Reviews| 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..22f99de89a7390ce5b25cedabaf392f0dc909aed 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,22 @@ 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()); |
| + } |
| + push(new HLiteralList(inputs, node.isConst())); |
| + push(new HStatic(interceptors.getMapMaker())); |
|
ngeoffray
2012/03/01 08:36:09
Note that you don't really need to push, you could
ahe
2012/03/06 15:34:12
Done.
|
| + push(new HInvokeStatic(Selector.INVOCATION_1, <HInstruction>[pop(), pop()])); |
|
ngeoffray
2012/03/01 08:36:09
Line too long.
ahe
2012/03/06 15:34:12
Done.
|
| } |
| visitLiteralMapEntry(LiteralMapEntry node) { |
| - compiler.unimplemented('SsaBuilder.visitLiteralMapEntry', node: node); |
| + visit(node.value); |
| + visit(node.key); |
| } |
| visitNamedArgument(NamedArgument node) { |