summaryrefslogtreecommitdiffstats
path: root/runtime/reflection.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-11-26 12:00:11 -0800
committerMathieu Chartier <mathieuc@google.com>2013-12-10 16:00:58 -0800
commitc528dba35b5faece51ca658fc008b688f8b690ad (patch)
treed95c113a639d07f7e3b88e8a6caa9b5f6e044801 /runtime/reflection.cc
parent76f552307ee980221626d1dff0ada56c989d24ca (diff)
downloadart-c528dba35b5faece51ca658fc008b688f8b690ad.tar.gz
art-c528dba35b5faece51ca658fc008b688f8b690ad.tar.bz2
art-c528dba35b5faece51ca658fc008b688f8b690ad.zip
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/reflection.cc')
-rw-r--r--runtime/reflection.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index 80e16aa6c0..ac8f5ef6c4 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -39,8 +39,12 @@ jobject InvokeMethod(const ScopedObjectAccess& soa, jobject javaMethod, jobject
mirror::ArtMethod* m = soa.DecodeMethod(mid);
mirror::Class* declaring_class = m->GetDeclaringClass();
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(declaring_class, true, true)) {
- return NULL;
+ if (UNLIKELY(!declaring_class->IsInitialized())) {
+ SirtRef<mirror::Class> sirt_c(soa.Self(), declaring_class);
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(sirt_c, true, true)) {
+ return nullptr;
+ }
+ declaring_class = sirt_c.get();
}
mirror::Object* receiver = NULL;