summaryrefslogtreecommitdiff
path: root/runtime/mirror/object.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2023-09-09 23:19:28 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-09-09 23:19:28 +0000
commita43e67ea1a314e5c6faf77457ffc5ea39c24d4ca (patch)
tree9ffb0fce0deed66670477257567bd9a617449105 /runtime/mirror/object.cc
parentf9fdd3ce0180972dc8d4f0c8410ea7702828a703 (diff)
Revert "Revert^14 "Thread suspension cleanup and deadlock fix""
This reverts commit f9fdd3ce0180972dc8d4f0c8410ea7702828a703. Reason for revert: Very suspicious host-x86_64-debug failure on LUCI. Change-Id: Ia01dd3df8d64d6bc0d12319b06a8380f64a46785
Diffstat (limited to 'runtime/mirror/object.cc')
-rw-r--r--runtime/mirror/object.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc
index 995f06e14e..940b82dc0a 100644
--- a/runtime/mirror/object.cc
+++ b/runtime/mirror/object.cc
@@ -185,8 +185,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);
@@ -204,9 +203,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();
@@ -234,12 +230,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();