diff options
| -rw-r--r-- | compiler/image_writer.cc | 11 | ||||
| -rw-r--r-- | compiler/image_writer.h | 11 | ||||
| -rw-r--r-- | imgdiag/imgdiag.cc | 3 |
3 files changed, 7 insertions, 18 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 8bb462c667..c747ffa65b 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -576,16 +576,7 @@ void ImageWriter::AssignImageBinSlot(mirror::Object* object) { } } 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 0cb6aea9b2..f204b28380 100644 --- a/compiler/image_writer.h +++ b/compiler/image_writer.h @@ -149,17 +149,16 @@ class ImageWriter FINAL { 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 + // Likely-clean: + kBinString, // [String] Almost always immutable (except for obj header). // Unknown mix of clean/dirty: kBinRegular, - kBinClassInitialized, // Class initializers have been run + // Likely-dirty: // 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). + 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 cbd0c40b5a..c2a812ee09 100644 --- a/imgdiag/imgdiag.cc +++ b/imgdiag/imgdiag.cc @@ -416,8 +416,7 @@ class ImgDiagDumper { // 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; |