summaryrefslogtreecommitdiff
path: root/runtime/java_vm_ext.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-09-02 18:51:54 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-09-04 15:44:45 -0700
commit9b1c71ec77d92d63f1c2183b0cd3588727b2c265 (patch)
tree1f8cfa8487497a24cd8fdb0269242ea9e6873544 /runtime/java_vm_ext.cc
parent5fbb15fe05fb8814907e00fdc0ca34d9b6113c9f (diff)
Make class loaders weak roots
Making the class loaders weak roots in the class linker prevents them from keeping the classes as live. However we currently do mark them as strong roots to make sure no accidental class unloading occurs until the logic to free from linear alloc is complete. Bug: 22720414 Change-Id: I57466236d9ce6fd064dda9a30ce8ab68094fb8b0
Diffstat (limited to 'runtime/java_vm_ext.cc')
-rw-r--r--runtime/java_vm_ext.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index d6c798a863..92eef3983b 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -592,6 +592,7 @@ mirror::Object* JavaVMExt::DecodeWeakGlobal(Thread* self, IndirectRef ref) {
// This only applies in the case where MayAccessWeakGlobals goes from false to true. In the other
// case, it may be racy, this is benign since DecodeWeakGlobalLocked does the correct behavior
// if MayAccessWeakGlobals is false.
+ DCHECK_EQ(GetIndirectRefKind(ref), kWeakGlobal);
if (LIKELY(MayAccessWeakGlobalsUnlocked(self))) {
return weak_globals_.SynchronizedGet(ref);
}