Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2540363002: dart2js-kernel: Emit error trap for unimplemented features (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 4c3e52956ef8d01515794c580b893b868a748c65..b84d1ad44002580e3afb5e98a38aa4a97f763d1c 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -380,8 +380,17 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
@override
void defaultExpression(ir.Expression expression) {
- // TODO(het): This is only to get tests working
- stack.add(graph.addConstantNull(compiler));
+ // TODO(het): This is only to get tests working.
+ String message = 'Unhandled ir.${expression.runtimeType} $expression';
+ HInstruction nullValue = graph.addConstantNull(compiler);
+ HInstruction errorMessage =
+ graph.addConstantString(new DartString.literal(message), compiler);
+ HInstruction trap = new HForeignCode(
+ js.js.parseForeignJS("#.#"),
+ backend.dynamicType,
+ <HInstruction>[nullValue, errorMessage]);
+ trap.sideEffects..setAllSideEffects()..setDependsOnSomething();
+ push(trap);
}
/// Returns the current source element.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698