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

Unified Diff: runtime/bin/vmservice/client/lib/src/service/cache.dart

Issue 197803004: Add dead CodeRegionTable for tracking overwritten Dart code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/service/cache.dart
diff --git a/runtime/bin/vmservice/client/lib/src/service/cache.dart b/runtime/bin/vmservice/client/lib/src/service/cache.dart
index 02604ce9915599aa50a2dc91f657fdf68b5bd999..6feb94a2b468b4b8c46d1651c2c3d212158ce459 100644
--- a/runtime/bin/vmservice/client/lib/src/service/cache.dart
+++ b/runtime/bin/vmservice/client/lib/src/service/cache.dart
@@ -53,6 +53,9 @@ abstract class ServiceObjectCache<T extends ServiceObject> {
assert(ServiceObject.isServiceMap(obj));
String id = obj['id'];
var type = obj['type'];
+ if (!cachesId(id)) {
+ Logger.root.warning('Cache does not cache this id: $id');
+ }
assert(cachesId(id));
if (contains(id)) {
return this[id];
@@ -117,11 +120,11 @@ class CodeCache extends ServiceObjectCache<Code> {
}
void _updateProfileData(ServiceMap profile, List<Code> codeTable) {
- var codes = profile['codes'];
+ var codeRegions = profile['codes'];
var sampleCount = profile['samples'];
- for (var profileCode in codes) {
- Code code = profileCode['code'];
- code.updateProfileData(profileCode, codeTable, sampleCount);
+ for (var codeRegion in codeRegions) {
+ Code code = codeRegion['code'];
+ code.updateProfileData(codeRegion, codeTable, sampleCount);
}
}
}
@@ -136,3 +139,23 @@ class ClassCache extends ServiceObjectCache<ServiceMap> {
static final RegExp _matcher = new RegExp(r'classes/\d+$');
}
+
+class FunctionCache extends ServiceObjectCache<ServiceMap> {
+ FunctionCache(Isolate isolate) : super(isolate);
+
+ bool cachesId(String id) => _matcher.hasMatch(id);
+
+ bool cachesType(String type) => ServiceObject.stripRef(type) == 'Function';
+ ServiceMap _upgrade(ObservableMap obj) =>
+ new ServiceMap.fromMap(isolate, obj);
+
+ static final RegExp _matcher =
+ new RegExp(r'^functions/native-.+|'
+ r'^functions/collected-.+|'
+ r'^functions/reused-.+|'
+ r'^functions/stub-.+|'
+ r'^classes/\d+/functions/.+|'
+ r'^classes/\d+/closures/.+|'
+ r'^classes/\d+/implicit_closures/.+|'
+ r'^classes/\d+/dispatchers/.+');
+}

Powered by Google App Engine
This is Rietveld 408576698