summaryrefslogtreecommitdiff
path: root/runtime/mirror/class-alloc-inl.h
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2020-01-07 22:51:03 +0000
committerAlex Light <allight@google.com>2020-01-07 22:51:55 +0000
commit0b1afb7c63d99c88f90f17770ad94ccb0b0c57d3 (patch)
tree92e88de49a2e79c2a00ce8990e412febc81e5318 /runtime/mirror/class-alloc-inl.h
parent93be70effba70b78596fc4bda6b583615c3b6d0c (diff)
Revert "Remove finalizable restriction on structural redefinition"
This reverts commit 55d6fa4c352a1fadbd21b8d8e0929833e547b9e5. Bug: 134162467 Test: None, pure revert. Reason for revert: Flaky segvs across multiple configurations. Change-Id: Iaa8ec6cbd2eee141e271cd3a56a1b6be8bbb3a7c
Diffstat (limited to 'runtime/mirror/class-alloc-inl.h')
-rw-r--r--runtime/mirror/class-alloc-inl.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/runtime/mirror/class-alloc-inl.h b/runtime/mirror/class-alloc-inl.h
index 5627b4956e..28612443be 100644
--- a/runtime/mirror/class-alloc-inl.h
+++ b/runtime/mirror/class-alloc-inl.h
@@ -46,19 +46,13 @@ inline void Class::CheckObjectAlloc() {
DCHECK_GE(this->object_size_, sizeof(Object));
}
-template<bool kIsInstrumented, Class::AddFinalizer kAddFinalizer, bool kCheckAddFinalizer>
+template<bool kIsInstrumented, bool kCheckAddFinalizer>
inline ObjPtr<Object> Class::Alloc(Thread* self, gc::AllocatorType allocator_type) {
CheckObjectAlloc();
gc::Heap* heap = Runtime::Current()->GetHeap();
- bool add_finalizer;
- switch (kAddFinalizer) {
- case Class::AddFinalizer::kUseClassTag:
- add_finalizer = IsFinalizable();
- break;
- case Class::AddFinalizer::kNoAddFinalizer:
- add_finalizer = false;
- DCHECK(!kCheckAddFinalizer || !IsFinalizable());
- break;
+ const bool add_finalizer = kCheckAddFinalizer && IsFinalizable();
+ if (!kCheckAddFinalizer) {
+ DCHECK(!IsFinalizable());
}
// Note that the `this` pointer may be invalidated after the allocation.
ObjPtr<Object> obj =