diff options
author | Vladimir Marko <vmarko@google.com> | 2021-04-23 10:29:27 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2021-04-23 13:07:48 +0000 |
commit | ffafe8babb6b278c9e4748f64670f99f223411a9 (patch) | |
tree | d1509e5ebab6872798980f291ec6d40b19c0ff3f | |
parent | f2e1bc757e354530e41b8d0e0c3f04c12d1f8ab7 (diff) |
Clean up Handle<> comparison with null.
These operators do not need the mutator lock.
Test: buildbot-build.sh
Change-Id: I48f51853f1b3c2e56463140f23777ad26d8122f2
-rw-r--r-- | compiler/optimizing/nodes.h | 4 | ||||
-rw-r--r-- | runtime/handle.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 48dae87a99..939c49f9a6 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -6833,7 +6833,7 @@ class HLoadClass final : public HInstruction { } // Loaded class RTI is marked as valid by RTP if the klass_ is admissible. - void SetValidLoadedClassRTI() REQUIRES_SHARED(Locks::mutator_lock_) { + void SetValidLoadedClassRTI() { DCHECK(klass_ != nullptr); SetPackedFlag<kFlagValidLoadedClassRTI>(true); } @@ -7696,7 +7696,7 @@ class HTypeCheckInstruction : public HVariableInputSizeInstruction { } // Target class RTI is marked as valid by RTP if the klass_ is admissible. - void SetValidTargetClassRTI() REQUIRES_SHARED(Locks::mutator_lock_) { + void SetValidTargetClassRTI() { DCHECK(klass_ != nullptr); SetPackedFlag<kFlagValidTargetClassRTI>(true); } diff --git a/runtime/handle.h b/runtime/handle.h index 6f6e81f002..b34d983d6a 100644 --- a/runtime/handle.h +++ b/runtime/handle.h @@ -101,11 +101,11 @@ class Handle : public ValueObject { return reference_; } - ALWAYS_INLINE bool operator!=(std::nullptr_t) const REQUIRES_SHARED(Locks::mutator_lock_) { + ALWAYS_INLINE bool operator!=(std::nullptr_t) const { return !IsNull(); } - ALWAYS_INLINE bool operator==(std::nullptr_t) const REQUIRES_SHARED(Locks::mutator_lock_) { + ALWAYS_INLINE bool operator==(std::nullptr_t) const { return IsNull(); } |