for (constvoid* code_ptr : code_ptrs) {
uint32_t number_of_roots = 0; const uint8_t* root_table = GetRootTable(code_ptr, &number_of_roots);
uint8_t* roots_data = private_region_.IsInDataSpace(root_table)
? private_region_.GetWritableDataAddress(root_table)
: shared_region_.GetWritableDataAddress(root_table);
GcRoot<mirror::Object>* roots = reinterpret_cast<GcRoot<mirror::Object>*>(roots_data); for (uint32_t i = 0; i < number_of_roots; ++i) { // This does not need a read barrier because this is called by GC.
mirror::Object* object = roots[i].Read<kWithoutReadBarrier>(); if (object == nullptr ||
object == Runtime::GetWeakClassSentinel() ||
object->IsClass<kDefaultVerifyFlags>()) { continue;
} if (object->IsString<kDefaultVerifyFlags>()) { if (com::android::art::flags::weak_const_string()) { // Visit the `String` to keep it alive as long as the code remains in the JIT code cache.
visitor.VisitRoot(roots[i].AddressWithoutBarrier());
} continue;
} // We don't need to visit j.l.Class and j.l.String is handled above // and the only remaining possible objects are MethodType-s.
ObjPtr<mirror::Class> method_type_class =
WellKnownClasses::java_lang_invoke_MethodType.Get<kWithoutReadBarrier>();
ObjPtr<mirror::Class> klass =
object->GetClass<kDefaultVerifyFlags, kWithoutReadBarrier>();
DCHECK(klass == method_type_class ||
klass == ReadBarrier::IsMarked(method_type_class.Ptr()) ||
ReadBarrier::IsMarked(klass.Ptr()) == method_type_class);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.