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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
9 import '../common/names.dart'; 9 import '../common/names.dart';
10 import '../common/tasks.dart' show CompilerTask; 10 import '../common/tasks.dart' show CompilerTask;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 374
375 /// Pushes a boolean checking [expression] against null. 375 /// Pushes a boolean checking [expression] against null.
376 pushCheckNull(HInstruction expression) { 376 pushCheckNull(HInstruction expression) {
377 push(new HIdentity( 377 push(new HIdentity(
378 expression, graph.addConstantNull(compiler), null, backend.boolType)); 378 expression, graph.addConstantNull(compiler), null, backend.boolType));
379 } 379 }
380 380
381 @override 381 @override
382 void defaultExpression(ir.Expression expression) { 382 void defaultExpression(ir.Expression expression) {
383 // TODO(het): This is only to get tests working 383 // TODO(het): This is only to get tests working.
384 stack.add(graph.addConstantNull(compiler)); 384 String message = 'Unhandled ir.${expression.runtimeType} $expression';
385 HInstruction nullValue = graph.addConstantNull(compiler);
386 HInstruction errorMessage =
387 graph.addConstantString(new DartString.literal(message), compiler);
388 HInstruction trap = new HForeignCode(
389 js.js.parseForeignJS("#.#"),
390 backend.dynamicType,
391 <HInstruction>[nullValue, errorMessage]);
392 trap.sideEffects..setAllSideEffects()..setDependsOnSomething();
393 push(trap);
385 } 394 }
386 395
387 /// Returns the current source element. 396 /// Returns the current source element.
388 /// 397 ///
389 /// The returned element is a declaration element. 398 /// The returned element is a declaration element.
390 // TODO(efortuna): Update this when we implement inlining. 399 // TODO(efortuna): Update this when we implement inlining.
391 @override 400 @override
392 Element get sourceElement => astAdapter.getElement(target); 401 Element get sourceElement => astAdapter.getElement(target);
393 402
394 @override 403 @override
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 push(new HNot(popBoolified(), backend.boolType)); 1675 push(new HNot(popBoolified(), backend.boolType));
1667 } 1676 }
1668 1677
1669 @override 1678 @override
1670 void visitStringConcatenation(ir.StringConcatenation stringConcat) { 1679 void visitStringConcatenation(ir.StringConcatenation stringConcat) {
1671 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); 1680 KernelStringBuilder stringBuilder = new KernelStringBuilder(this);
1672 stringConcat.accept(stringBuilder); 1681 stringConcat.accept(stringBuilder);
1673 stack.add(stringBuilder.result); 1682 stack.add(stringBuilder.result);
1674 } 1683 }
1675 } 1684 }
OLDNEW
« 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