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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 13947004: dart2js: Allow 'throw' when inlining (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nicolas' Code review feedback Created 7 years, 8 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
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 42f055a7eda9f9a03265b893735585b4d292ce2d..c0cdc93366aeb18232605026dab9355a1772dcc8 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1917,7 +1917,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
use(node.inputs[0]);
pushStatement(new js.Throw(pop()), node);
} else {
- generateThrowWithHelper(r'$throw', node.inputs[0]);
+ generateThrowWithHelper('wrapException', node.inputs[0]);
}
}
@@ -1995,6 +1995,20 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
pushStatement(new js.Throw(value));
}
+ visitThrowExpression(HThrowExpression node) {
+ HInstruction argument = node.inputs[0];
+ use(argument);
+
+ Element helper = compiler.findHelper(new SourceString("throwExpression"));
+ world.registerStaticUse(helper);
+
+ js.VariableUse jsHelper =
+ new js.VariableUse(backend.namer.isolateAccess(helper));
+ js.Call value = new js.Call(jsHelper, [pop()]);
+ attachLocation(value, argument);
+ push(value, node);
+ }
+
void visitSwitch(HSwitch node) {
// Switches are handled using [visitSwitchInfo].
}

Powered by Google App Engine
This is Rietveld 408576698