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

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

Issue 2616263002: dart2js-kernel: implement rethrow (Closed)
Patch Set: fix type of residual Created 3 years, 11 months 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 | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | 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 013ef4be68741a32f025b15a4e042afc1ef59ed0..08958fdf7d5c33a47087d6281c89c8958aa42d87 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -15,12 +15,14 @@ import '../constants/values.dart'
ConstantValue,
InterceptorConstantValue,
StringConstantValue,
+ SyntheticConstantValue,
+ //SyntheticConstantKind,
sra1 2017/01/09 19:20:17 I'm fixing this now and reformatting
TypeConstantValue;
import '../elements/resolution_types.dart';
import '../elements/elements.dart';
import '../io/source_information.dart';
import '../js/js.dart' as js;
-import '../js_backend/backend.dart' show JavaScriptBackend;
+import '../js_backend/backend.dart' show JavaScriptBackend, SyntheticConstantKind;
import '../kernel/kernel.dart';
import '../native/native.dart' as native;
import '../resolution/tree_elements.dart';
@@ -2214,6 +2216,20 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
@override
+ void visitRethrow(ir.Rethrow rethrowNode) {
+ HInstruction exception = rethrowableException;
+ if (exception == null) {
+ exception = graph.addConstantNull(closedWorld);
+ reporter.internalError(node, 'rethrowableException should not be null.');
+ }
+ Sourceinformation sourceInformation = null;
+ closeAndGotoExit(new HThrow(exception, sourceInformation, isRethrow: true));
+ // ir.Rethrow is an expression so we need to push a value - a constant with
+ // no type.
+ stack.add(graph.addConstantUnreachable(closedWorld));
+ }
+
+ @override
void visitThisExpression(ir.ThisExpression thisExpression) {
stack.add(localsHandler.readThis());
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698