diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-11-26 12:00:11 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-12-10 16:00:58 -0800 |
commit | c528dba35b5faece51ca658fc008b688f8b690ad (patch) | |
tree | d95c113a639d07f7e3b88e8a6caa9b5f6e044801 /runtime/entrypoints/entrypoint_utils.h | |
parent | 76f552307ee980221626d1dff0ada56c989d24ca (diff) | |
download | art-c528dba35b5faece51ca658fc008b688f8b690ad.zip art-c528dba35b5faece51ca658fc008b688f8b690ad.tar.gz art-c528dba35b5faece51ca658fc008b688f8b690ad.tar.bz2 |
Enable moving classes.
Slight reduction in Zygote size, memory savings are in the noise.
Before: Zygote size: 8739224
After: Zygote size: 8733568
Fixed a bug where we didn't set the concurrent start bytes after
switching the allocator from bump pointer to ROSAlloc in the
zygote. This caused excessive memory usage.
Added the method verifiers as roots to fix an issue caused by
RegTypes holding a Class*.
Added logic to clear card table in the SemiSpace collector, this
reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace
collector.
Added a missing lock to the timing loggers which caused a rare
one time crash in std::set.
Bug: 11771255
Bug: 8499494
Bug: 10802951
Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index 747dd56..bfdbd74 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -72,7 +72,7 @@ ALWAYS_INLINE static inline mirror::Class* CheckObjectAlloc(uint32_t type_idx, if (UNLIKELY(!klass->IsInitialized())) { SirtRef<mirror::Class> sirt_klass(self, klass); // The class initializer might cause a GC. - if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(klass, true, true)) { + if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(sirt_klass, true, true)) { DCHECK(self->IsExceptionPending()); return nullptr; // Failure } @@ -246,12 +246,15 @@ static inline mirror::ArtField* FindFieldFromCode(uint32_t field_idx, const mirr // If the class is initialized we're done. if (LIKELY(fields_class->IsInitialized())) { return resolved_field; - } else if (LIKELY(class_linker->EnsureInitialized(fields_class, true, true))) { - // Otherwise let's ensure the class is initialized before resolving the field. - return resolved_field; } else { - DCHECK(self->IsExceptionPending()); // Throw exception and unwind - return nullptr; // failure + SirtRef<mirror::Class> sirt_class(self, fields_class); + if (LIKELY(class_linker->EnsureInitialized(sirt_class, true, true))) { + // Otherwise let's ensure the class is initialized before resolving the field. + return resolved_field; + } else { + DCHECK(self->IsExceptionPending()); // Throw exception and unwind + return nullptr; // failure + } } } } @@ -535,12 +538,13 @@ static inline mirror::Class* ResolveVerifyAndClinit(uint32_t type_idx, if (klass == referring_class && referrer->IsConstructor() && referrer->IsStatic()) { return klass; } - if (!class_linker->EnsureInitialized(klass, true, true)) { + SirtRef<mirror::Class> sirt_class(self, klass); + if (!class_linker->EnsureInitialized(sirt_class, true, true)) { CHECK(self->IsExceptionPending()); return NULL; // Failure - Indicate to caller to deliver exception } - referrer->GetDexCacheInitializedStaticStorage()->Set(type_idx, klass); - return klass; + referrer->GetDexCacheInitializedStaticStorage()->Set(type_idx, sirt_class.get()); + return sirt_class.get(); } extern void ThrowStackOverflowError(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |