diff options
| author | 2015-04-29 17:48:03 +0000 | |
|---|---|---|
| committer | 2015-04-29 17:48:03 +0000 | |
| commit | 8df0e08ff050bbcb84d711d155d8e3503ae23658 (patch) | |
| tree | 63d1ed67639f1497e40ac9c1d28ac8a405a20e62 | |
| parent | 401b8ea4c56678cfa0b2d3bdae5cb9e208711f88 (diff) | |
| parent | 8c9c1ae515f32142ab85103c5d45bd7ce4e6eb3c (diff) | |
am 8c9c1ae5: Merge "Only print IRT remove local warning if CheckJNI is enabled"
* commit '8c9c1ae515f32142ab85103c5d45bd7ce4e6eb3c':
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) { |