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

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

Issue 1681953002: dart2js cps: Do not count no-check bounds checks in size visitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 972241e138952849eef411d0f1d7e0d3dda025be..87892d3a1fe888ce912bfbe58baa9ef96d9bd7d7 100644
--- a/pkg/compiler/lib/src/cps_ir/inline.dart
+++ b/pkg/compiler/lib/src/cps_ir/inline.dart
@@ -246,15 +246,19 @@ class SizeVisitor extends TrampolineRecursiveVisitor {
// Inlining a function incurs a cost equal to the number of primitives and
// non-jump tail expressions.
// TODO(kmillikin): Tune the size computation and size bound.
- processLetPrim(LetPrim node) {
- if (node.primitive is! Refinement) {
- ++size;
- }
- }
+ processLetPrim(LetPrim node) => ++size;
processLetMutable(LetMutable node) => ++size;
processBranch(Branch node) => ++size;
processThrow(Throw nose) => ++size;
processRethrow(Rethrow node) => ++size;
+
+ // Discount primitives that do not generate code.
+ processRefinement(Refinement node) => --size;
+ processBoundsCheck(BoundsCheck node) {
+ if (node.hasNoChecks) {
+ --size;
+ }
+ }
}
class InliningVisitor extends TrampolineRecursiveVisitor {
« 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