summaryrefslogtreecommitdiff
path: root/runtime/mirror/class-alloc-inl.h
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2020-01-07 22:53:09 +0000
committer Alex Light <allight@google.com> 2020-01-07 17:31:43 -0800
commit2f4942879da18c9789800878b0e5eb87fbedb7b0 (patch)
treeb14968d70ac2f623f980207b4afad64806470994 /runtime/mirror/class-alloc-inl.h
parent0b1afb7c63d99c88f90f17770ad94ccb0b0c57d3 (diff)
Revert^2 "Remove finalizable restriction on structural redefinition"
This reverts commit 0b1afb7c63d99c88f90f17770ad94ccb0b0c57d3. Daemon shutdown is known to be somewhat flaky. That seems to be the cause of this failure. Reason for revert: Removed Daemon threads from tests 2006 & 2007. Bug: 134162467 Test: % ./art/test/run-test --create-runner --host --prebuild --compact-dex-level fast --jit --no-relocate --runtime-option -Xcheck:jni --debuggable --runtime-option -Xopaque-jni-ids:true --64 2007 ... Runnable test script written to /tmp/allight/test-230585/runit.sh ... % ./art/tools/parallel_run.py -j80 /tmp/allight/test-230585/runit.sh --out failure.txt Test: ./art/test/run-test --create-runner --host --prebuild --compact-dex-level fast --jit --no-relocate --runtime-option -Xcheck:jni --debuggable --runtime-option -Xopaque-jni-ids:true --64 2006 Change-Id: I392a2936995dd05b08feea36f11b616c1548ae46
Diffstat (limited to 'runtime/mirror/class-alloc-inl.h')
-rw-r--r--runtime/mirror/class-alloc-inl.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/runtime/mirror/class-alloc-inl.h b/runtime/mirror/class-alloc-inl.h
index 28612443be..5627b4956e 100644
--- a/runtime/mirror/class-alloc-inl.h
+++ b/runtime/mirror/class-alloc-inl.h
@@ -46,13 +46,19 @@ inline void Class::CheckObjectAlloc() {
DCHECK_GE(this->object_size_, sizeof(Object));
}
-template<bool kIsInstrumented, bool kCheckAddFinalizer>
+template<bool kIsInstrumented, Class::AddFinalizer kAddFinalizer, bool kCheckAddFinalizer>
inline ObjPtr<Object> Class::Alloc(Thread* self, gc::AllocatorType allocator_type) {
CheckObjectAlloc();
gc::Heap* heap = Runtime::Current()->GetHeap();
- const bool add_finalizer = kCheckAddFinalizer && IsFinalizable();
- if (!kCheckAddFinalizer) {
- DCHECK(!IsFinalizable());
+ bool add_finalizer;
+ switch (kAddFinalizer) {
+ case Class::AddFinalizer::kUseClassTag:
+ add_finalizer = IsFinalizable();
+ break;
+ case Class::AddFinalizer::kNoAddFinalizer:
+ add_finalizer = false;
+ DCHECK(!kCheckAddFinalizer || !IsFinalizable());
+ break;
}
// Note that the `this` pointer may be invalidated after the allocation.
ObjPtr<Object> obj =