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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2616263002: dart2js-kernel: implement rethrow (Closed)
Patch Set: format 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | 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 '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 bool old = _inExpressionOfThrow; 2207 bool old = _inExpressionOfThrow;
2208 try { 2208 try {
2209 _inExpressionOfThrow = true; 2209 _inExpressionOfThrow = true;
2210 expression.accept(this); 2210 expression.accept(this);
2211 } finally { 2211 } finally {
2212 _inExpressionOfThrow = old; 2212 _inExpressionOfThrow = old;
2213 } 2213 }
2214 } 2214 }
2215 2215
2216 @override 2216 @override
2217 void visitRethrow(ir.Rethrow rethrowNode) {
2218 HInstruction exception = rethrowableException;
2219 if (exception == null) {
2220 exception = graph.addConstantNull(closedWorld);
2221 compiler.reporter.internalError(astAdapter.getNode(rethrowNode),
2222 'rethrowableException should not be null.');
2223 }
2224 SourceInformation sourceInformation = null;
Siggi Cherem (dart-lang) 2017/01/11 19:13:04 what do we generally want to do for with source-in
Emily Fortuna 2017/01/11 21:19:54 I had been avoiding them and adding TODOs, but it'
2225 closeAndGotoExit(new HThrow(exception, sourceInformation, isRethrow: true));
2226 // ir.Rethrow is an expression so we need to push a value - a constant with
2227 // no type.
2228 stack.add(graph.addConstantUnreachable(closedWorld));
2229 }
2230
2231 @override
2217 void visitThisExpression(ir.ThisExpression thisExpression) { 2232 void visitThisExpression(ir.ThisExpression thisExpression) {
2218 stack.add(localsHandler.readThis()); 2233 stack.add(localsHandler.readThis());
2219 } 2234 }
2220 2235
2221 @override 2236 @override
2222 void visitNot(ir.Not not) { 2237 void visitNot(ir.Not not) {
2223 not.operand.accept(this); 2238 not.operand.accept(this);
2224 push(new HNot(popBoolified(), commonMasks.boolType)); 2239 push(new HNot(popBoolified(), commonMasks.boolType));
2225 } 2240 }
2226 2241
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 kernelBuilder.open(exitBlock); 2501 kernelBuilder.open(exitBlock);
2487 enterBlock.setBlockFlow( 2502 enterBlock.setBlockFlow(
2488 new HTryBlockInformation( 2503 new HTryBlockInformation(
2489 kernelBuilder.wrapStatementGraph(bodyGraph), 2504 kernelBuilder.wrapStatementGraph(bodyGraph),
2490 exception, 2505 exception,
2491 kernelBuilder.wrapStatementGraph(catchGraph), 2506 kernelBuilder.wrapStatementGraph(catchGraph),
2492 kernelBuilder.wrapStatementGraph(finallyGraph)), 2507 kernelBuilder.wrapStatementGraph(finallyGraph)),
2493 exitBlock); 2508 exitBlock);
2494 } 2509 }
2495 } 2510 }
OLDNEW
« 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