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

Side by Side Diff: pkg/compiler/lib/src/helpers/track_map.dart

Issue 1762723002: Cleanup 1: split parts into their own libraries, remove unused imports (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of dart2js.helpers;
6 5
7 /** 6 /**
8 * The track map is a simple wrapper around a map that keeps track 7 * The track map is a simple wrapper around a map that keeps track
9 * of the 'final' size of maps grouped by description. It allows 8 * of the 'final' size of maps grouped by description. It allows
10 * determining the distribution of sizes for a specific allocation 9 * determining the distribution of sizes for a specific allocation
11 * site and it can be used like this: 10 * site and it can be used like this:
12 * 11 *
13 * Map<String, int> map = new TrackMap<String, int>("my-map"); 12 * Map<String, int> map = new TrackMap<String, int>("my-map");
14 * 13 *
15 * After finishing the compilaton, the histogram of track map sizes 14 * After finishing the compilaton, the histogram of track map sizes
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 int newLength = oldLength + delta; 103 int newLength = oldLength + delta;
105 _counts[oldLength]--; 104 _counts[oldLength]--;
106 if (newLength < _counts.length) { 105 if (newLength < _counts.length) {
107 _counts[newLength]++; 106 _counts[newLength]++;
108 } else { 107 } else {
109 _counts.add(1); 108 _counts.add(1);
110 assert(newLength == _counts.length - 1); 109 assert(newLength == _counts.length - 1);
111 } 110 }
112 } 111 }
113 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698