Remove intialized static storage from dex cache.
The initialized static storage array is used by compiled code to determine if
for a sget/sput class initialization is necessary. The compiled code typically
doesn't require this test as the class is pre-initialized or the class being
accessed is the same as the current method.
Change-Id: Icbc45e692b3d0ac61e559e69edb6c9b29439e571
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index 726a8f1..6f30cc9 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -234,7 +234,6 @@
return;
}
// LOG(INFO) << "VMRuntime.preloadDexCaches static storage klass=" << class_name;
- dex_cache->GetInitializedStaticStorage()->Set(type_idx, klass);
}
// Based on ClassLinker::ResolveField.
@@ -306,12 +305,10 @@
uint32_t num_types;
uint32_t num_fields;
uint32_t num_methods;
- uint32_t num_static_storage;
DexCacheStats() : num_strings(0),
num_types(0),
num_fields(0),
- num_methods(0),
- num_static_storage(0) {}
+ num_methods(0) {}
};
static const bool kPreloadDexCachesEnabled = true;
@@ -339,7 +336,6 @@
total->num_fields += dex_file->NumFieldIds();
total->num_methods += dex_file->NumMethodIds();
total->num_types += dex_file->NumTypeIds();
- total->num_static_storage += dex_file->NumTypeIds();
}
}
@@ -378,12 +374,6 @@
filled->num_methods++;
}
}
- for (size_t i = 0; i < dex_cache->NumInitializedStaticStorage(); i++) {
- mirror::StaticStorageBase* klass = dex_cache->GetInitializedStaticStorage()->Get(i);
- if (klass != NULL) {
- filled->num_static_storage++;
- }
- }
}
}
@@ -477,10 +467,6 @@
total.num_fields, before.num_fields, after.num_fields);
LOG(INFO) << StringPrintf("VMRuntime.preloadDexCaches methods total=%d before=%d after=%d",
total.num_methods, before.num_methods, after.num_methods);
- LOG(INFO) << StringPrintf("VMRuntime.preloadDexCaches storage total=%d before=%d after=%d",
- total.num_static_storage,
- before.num_static_storage,
- after.num_static_storage);
LOG(INFO) << StringPrintf("VMRuntime.preloadDexCaches finished");
}
}