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

Unified Diff: pkg/compiler/lib/src/cps_ir/inline.dart

Issue 1587053003: Don't inline methods that only throw. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/inline.dart
diff --git a/pkg/compiler/lib/src/cps_ir/inline.dart b/pkg/compiler/lib/src/cps_ir/inline.dart
index cc046eec2c56c6588041c26cee5f3c652ae5b072..0a4e0502a3c72eb3f388c45718753800d681df11 100644
--- a/pkg/compiler/lib/src/cps_ir/inline.dart
+++ b/pkg/compiler/lib/src/cps_ir/inline.dart
@@ -372,6 +372,13 @@ class InliningVisitor extends TrampolineRecursiveVisitor {
return null;
}
+ // Don't inline methods that never return. They are usually helper functions
+ // that throw an exception. The throw sequence is b
Siggi Cherem (dart-lang) 2016/01/14 22:50:51 end sentence?
+ if (invoke.type.isEmpty && !invoke.type.isNullable) {
+ // TODO(sra): It would be ok to inline if doing so was shrinking.
+ return null;
+ }
+
Reference<Primitive> dartReceiver = invoke.dartReceiverReference;
TypeMask abstractReceiver =
dartReceiver == null ? null : abstractType(dartReceiver);
« 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