Revert "Reduce dirty image pages by improving binning"
This reverts commit 794bff5f622c79fd7bd9899e700cf052a375c675.
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 8bb462c..c747ffa 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -576,16 +576,7 @@
}
} else if (object->GetClass<kVerifyNone>()->IsStringClass()) {
bin = kBinString; // Strings are almost always immutable (except for object header).
- } else if (object->GetClass<kVerifyNone>() ==
- Runtime::Current()->GetClassLinker()->GetClassRoot(ClassLinker::kJavaLangObject)) {
- // Instance of java lang object, probably a lock object. This means it will be dirty when we
- // synchronize on it.
- bin = kBinMiscDirty;
- } else if (object->IsDexCache()) {
- // Dex file field becomes dirty when the image is loaded.
- bin = kBinMiscDirty;
- }
- // else bin = kBinRegular
+ } // else bin = kBinRegular
}
size_t oat_index = GetOatIndex(object);
diff --git a/compiler/image_writer.h b/compiler/image_writer.h
index 0cb6aea..f204b28 100644
--- a/compiler/image_writer.h
+++ b/compiler/image_writer.h
@@ -149,17 +149,16 @@
void RecordImageAllocations() SHARED_REQUIRES(Locks::mutator_lock_);
// Classify different kinds of bins that objects end up getting packed into during image writing.
- // Ordered from dirtiest to cleanest (until ArtMethods).
enum Bin {
- kBinMiscDirty, // Dex caches, object locks, etc...
- kBinClassVerified, // Class verified, but initializers haven't been run
- // Unknown mix of clean/dirty:
- kBinRegular,
- kBinClassInitialized, // Class initializers have been run
- // All classes get their own bins since their fields often dirty
- kBinClassInitializedFinalStatics, // Class initializers have been run, no non-final statics
// Likely-clean:
kBinString, // [String] Almost always immutable (except for obj header).
+ // Unknown mix of clean/dirty:
+ kBinRegular,
+ // Likely-dirty:
+ // All classes get their own bins since their fields often dirty
+ kBinClassInitializedFinalStatics, // Class initializers have been run, no non-final statics
+ kBinClassInitialized, // Class initializers have been run
+ kBinClassVerified, // Class verified, but initializers haven't been run
// Add more bins here if we add more segregation code.
// Non mirror fields must be below.
// ArtFields should be always clean.
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index 92232ba..5c0eb3f 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -405,8 +405,7 @@
// Look up local classes by their descriptor
std::map<std::string, mirror::Class*> local_class_map;
- // Use set to have sorted output.
- std::set<mirror::Object*> dirty_objects;
+ std::unordered_set<mirror::Object*> dirty_objects;
size_t dirty_object_bytes = 0;
const uint8_t* begin_image_ptr = image_begin_unaligned;