summaryrefslogtreecommitdiff
path: root/runtime/mirror/object.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2022-10-13 02:47:24 +0000
committer Hans Boehm <hboehm@google.com> 2022-10-13 02:47:24 +0000
commitebd76406bf5fa74185998bc29f0f27c20fa2e683 (patch)
treebeec1accc089bbbc432a140dfebe28bb7278a909 /runtime/mirror/object.cc
parentfd20a745227aa7cae7a08728bb29e5bfce64ea87 (diff)
Revert "Revert^2 "Thread suspension cleanup and deadlock fix""
This reverts commit fd20a745227aa7cae7a08728bb29e5bfce64ea87. Reason for revert: Lots of libartd failures due to new checkpoint lock level check. Change-Id: I0cf88ff893f8743a9a830a49489807d0921199a3
Diffstat (limited to 'runtime/mirror/object.cc')
-rw-r--r--runtime/mirror/object.cc14
1 files changed, 1 insertions, 13 deletions
diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc
index 2aa0f10023..bb9e85dd0e 100644
--- a/runtime/mirror/object.cc
+++ b/runtime/mirror/object.cc
@@ -181,8 +181,7 @@ void Object::SetHashCodeSeed(uint32_t new_seed) {
hash_code_seed.store(new_seed, std::memory_order_relaxed);
}
-template<bool kAllowInflation>
-int32_t Object::IdentityHashCodeHelper() {
+int32_t Object::IdentityHashCode() {
ObjPtr<Object> current_this = this; // The this pointer may get invalidated by thread suspension.
while (true) {
LockWord lw = current_this->GetLockWord(false);
@@ -200,9 +199,6 @@ int32_t Object::IdentityHashCodeHelper() {
break;
}
case LockWord::kThinLocked: {
- if (!kAllowInflation) {
- return 0;
- }
// Inflate the thin lock to a monitor and stick the hash code inside of the monitor. May
// fail spuriously.
Thread* self = Thread::Current();
@@ -230,14 +226,6 @@ int32_t Object::IdentityHashCodeHelper() {
}
}
-int32_t Object::IdentityHashCode() {
- return IdentityHashCodeHelper</* kAllowInflation= */ true>();
-}
-
-int32_t Object::IdentityHashCodeNoInflation() {
- return IdentityHashCodeHelper</* kAllowInflation= */ false>();
-}
-
void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, ObjPtr<Object> new_value) {
ObjPtr<Class> c = GetClass();
Runtime* runtime = Runtime::Current();