| Index: dart/frog/leg/ssa/builder.dart
|
| diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
|
| index 54dc67bbbeab5b57c390a96e5af19677b15aa208..7ceeae0e28885e3cd7c04b347c65b60f7e376cd2 100644
|
| --- a/dart/frog/leg/ssa/builder.dart
|
| +++ b/dart/frog/leg/ssa/builder.dart
|
| @@ -329,7 +329,8 @@ class LocalsHandler {
|
| HInstruction readLocal(Element element) {
|
| if (isAccessedDirectly(element)) {
|
| if (directLocals[element] == null) {
|
| - builder.compiler.internalError("Cannot find value", element: element);
|
| + builder.compiler.internalError("Cannot find value $element",
|
| + element: element);
|
| }
|
| return directLocals[element];
|
| } else if (isStoredInClosureField(element)) {
|
| @@ -2068,9 +2069,7 @@ class SsaBuilder implements Visitor {
|
| visitContinueStatement(ContinueStatement node) {
|
| // TODO(lrn): Replace this with a real implementation of continue.
|
| compiler.reportWarning(node, 'continue not implemented');
|
| - DartString string = new DartString.literal('continue not implemented');
|
| - HInstruction message = graph.addNewLiteralString(string);
|
| - close(new HThrow(message));
|
| + generateUnimplemented('continue not implemented');
|
| }
|
|
|
| BreakHandler getLoopBreakHandler(Loop node) {
|
| @@ -2219,7 +2218,7 @@ class SsaBuilder implements Visitor {
|
| }
|
|
|
| visitLiteralMap(LiteralMap node) {
|
| - compiler.unimplemented('SsaBuilder.visitLiteralMap', node: node);
|
| + generateUnimplemented('literal map not implemented', isExpression: true);
|
| }
|
|
|
| visitLiteralMapEntry(LiteralMapEntry node) {
|
| @@ -2231,7 +2230,7 @@ class SsaBuilder implements Visitor {
|
| }
|
|
|
| visitSwitchStatement(SwitchStatement node) {
|
| - compiler.unimplemented('SsaBuilder.visitSwitchStatement', node: node);
|
| + generateUnimplemented('switch statement not implemented');
|
| }
|
|
|
| visitTryStatement(TryStatement node) {
|
| @@ -2341,4 +2340,18 @@ class SsaBuilder implements Visitor {
|
| visitTypedef(Typedef node) {
|
| compiler.unimplemented('SsaBuilder.visitTypedef', node: node);
|
| }
|
| +
|
| + generateUnimplemented(String reason, [bool isExpression = false]) {
|
| + DartString string = new DartString.literal(reason);
|
| + HInstruction message = graph.addNewLiteralString(string);
|
| +
|
| + // Normally, we would call [close] here. However, then we hit
|
| + // another unimplemented feature: aborting loop body. Simply
|
| + // calling [add] does not work as it asserts that the instruction
|
| + // isn't a control flow instruction. So we inline parts of [add].
|
| + current.addAfter(current.last, new HThrow(message));
|
| + if (isExpression) {
|
| + stack.add(graph.addNewLiteralNull());
|
| + }
|
| + }
|
| }
|
|
|