Use the fast path object size for RosAlloc asm stubs
Also address comments. MemAllocTest perf on N5X speedup in the noise.
Bug: 9986565
Test: test-art-host -j32, N5X booting
Change-Id: Ic22ca92aab88b37fd66928949bf11264ee3476dc
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index b60c573..c979c28 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -109,12 +109,11 @@
// alloc path sees a valid object size, we would know that it's initialized as long as it has a
// load-acquire/fake dependency.
if (new_status == kStatusInitialized && !h_this->IsVariableSize()) {
- uint32_t object_size = RoundUp(h_this->GetObjectSize(), kObjectAlignment);
- if (h_this->IsFinalizable()) {
- // Finalizable objects must always go slow path.
- object_size = std::numeric_limits<int32_t>::max();
+ DCHECK_EQ(h_this->GetObjectSizeAllocFastPath(), std::numeric_limits<uint32_t>::max());
+ // Finalizable objects must always go slow path.
+ if (!h_this->IsFinalizable()) {
+ h_this->SetObjectSizeAllocFastPath(RoundUp(h_this->GetObjectSize(), kObjectAlignment));
}
- h_this->SetObjectSizeAllocFastPath(object_size);
}
if (!class_linker_initialized) {
@@ -149,7 +148,7 @@
if (kIsDebugBuild && new_class_size < GetClassSize()) {
DumpClass(LOG(INTERNAL_FATAL), kDumpClassFullDetail);
LOG(INTERNAL_FATAL) << new_class_size << " vs " << GetClassSize();
- LOG(FATAL) << " class=" << PrettyTypeOf(this);
+ LOG(FATAL) << "class=" << PrettyTypeOf(this);
}
// Not called within a transaction.
SetField32<false>(OFFSET_OF_OBJECT_MEMBER(Class, class_size_), new_class_size);