diff options
| author | 2015-04-29 17:37:47 +0000 | |
|---|---|---|
| committer | 2015-04-29 17:37:48 +0000 | |
| commit | 8c9c1ae515f32142ab85103c5d45bd7ce4e6eb3c (patch) | |
| tree | 63d1ed67639f1497e40ac9c1d28ac8a405a20e62 | |
| parent | ed51747ae96a0c7fac452e95a1607200a5494b28 (diff) | |
| parent | c5adebc9327bd5ca223a5faf99d904cc202a1627 (diff) | |
Merge "Only print IRT remove local warning if CheckJNI is enabled"
| -rw-r--r-- | runtime/indirect_reference_table.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/runtime/indirect_reference_table.cc b/runtime/indirect_reference_table.cc index e2b95599a6..0ef58ea067 100644 --- a/runtime/indirect_reference_table.cc +++ b/runtime/indirect_reference_table.cc @@ -175,10 +175,16 @@ bool IndirectReferenceTable::Remove(uint32_t cookie, IndirectRef iref) { DCHECK(table_ != nullptr); DCHECK_GE(segment_state_.parts.numHoles, prevState.parts.numHoles); - if (GetIndirectRefKind(iref) == kHandleScopeOrInvalid && - Thread::Current()->HandleScopeContains(reinterpret_cast<jobject>(iref))) { - LOG(WARNING) << "Attempt to remove local handle scope entry from IRT, ignoring"; - return true; + if (GetIndirectRefKind(iref) == kHandleScopeOrInvalid) { + auto* self = Thread::Current(); + if (self->HandleScopeContains(reinterpret_cast<jobject>(iref))) { + auto* env = self->GetJniEnv(); + DCHECK(env != nullptr); + if (env->check_jni) { + LOG(WARNING) << "Attempt to remove local handle scope entry from IRT, ignoring"; + } + return true; + } } const int idx = ExtractIndex(iref); if (idx < bottomIndex) { |