const uint8_t* mapping_table, const uint8_t* vmap_table, const uint8_t* gc_map);
bool MakeExecutable(CompiledMethod* compiled_method, mirror::ArtMethod* method)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
+ DISALLOW_COPY_AND_ASSIGN(JitCompiler);
};
} // namespace jit
-
} // namespace art
#endif // ART_COMPILER_JIT_JIT_COMPILER_H_
const size_t bitmap_size_;
private:
- DISALLOW_COPY_AND_ASSIGN(Bitmap);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Bitmap);
};
// One bit per kAlignment in range (start, end]
uintptr_t const cover_begin_;
uintptr_t const cover_end_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MemoryRangeBitmap);
};
} // namespace accounting
// Card table doesn't begin at the beginning of the mem_map_, instead it is displaced by offset
// to allow the byte value of biased_begin_ to equal GC_CARD_DIRTY
const size_t offset_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(CardTable);
};
} // namespace accounting
friend class FlipCallback;
friend class ConcurrentCopyingComputeUnevacFromSpaceLiveRatioVisitor;
- DISALLOW_COPY_AND_ASSIGN(ConcurrentCopying);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ConcurrentCopying);
};
} // namespace collector
int64_t total_freed_bytes_;
CumulativeLogger cumulative_timings_;
mutable Mutex pause_histogram_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(GarbageCollector);
};
} // namespace collector
friend class UpdateReferenceVisitor;
friend class UpdateRootVisitor;
- DISALLOW_COPY_AND_ASSIGN(MarkCompact);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MarkCompact);
};
} // namespace collector
friend class VerifyRootMarkedVisitor;
friend class VerifyRootVisitor;
- DISALLOW_COPY_AND_ASSIGN(MarkSweep);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MarkSweep);
};
} // namespace collector
virtual void BindBitmaps() OVERRIDE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
private:
- DISALLOW_COPY_AND_ASSIGN(PartialMarkSweep);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PartialMarkSweep);
};
} // namespace collector
private:
friend class BitmapSetSlowPathVisitor;
- DISALLOW_COPY_AND_ASSIGN(SemiSpace);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SemiSpace);
};
} // namespace collector
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_);
private:
- DISALLOW_COPY_AND_ASSIGN(StickyMarkSweep);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StickyMarkSweep);
};
} // namespace collector
}
inline Heap::AllocationTimer::AllocationTimer(Heap* heap, mirror::Object** allocated_obj_ptr)
- : heap_(heap), allocated_obj_ptr_(allocated_obj_ptr) {
- if (kMeasureAllocationTime) {
- allocation_start_time_ = NanoTime() / kTimeAdjust;
- }
-}
+ : heap_(heap), allocated_obj_ptr_(allocated_obj_ptr),
+ allocation_start_time_(kMeasureAllocationTime ? NanoTime() / kTimeAdjust : 0u) { }
inline Heap::AllocationTimer::~AllocationTimer() {
if (kMeasureAllocationTime) {
friend class VerifyReferenceVisitor;
friend class VerifyObjectVisitor;
friend class ScopedHeapFill;
- friend class ScopedHeapLock;
friend class space::SpaceTest;
class AllocationTimer {
+ public:
+ ALWAYS_INLINE AllocationTimer(Heap* heap, mirror::Object** allocated_obj_ptr);
+ ALWAYS_INLINE ~AllocationTimer();
private:
- Heap* heap_;
+ Heap* const heap_;
mirror::Object** allocated_obj_ptr_;
- uint64_t allocation_start_time_;
- public:
- AllocationTimer(Heap* heap, mirror::Object** allocated_obj_ptr);
- ~AllocationTimer();
+ const uint64_t allocation_start_time_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationTimer);
};
DISALLOW_IMPLICIT_CONSTRUCTORS(Heap);
};
-// ScopedHeapFill changes the bytes allocated counter to be equal to the growth limit. This
-// causes the next allocation to perform a GC and possibly an OOM. It can be used to ensure that a
-// GC happens in specific methods such as ThrowIllegalMonitorStateExceptionF in Monitor::Wait.
-class ScopedHeapFill {
- public:
- explicit ScopedHeapFill(Heap* heap)
- : heap_(heap),
- delta_(heap_->GetMaxMemory() - heap_->GetBytesAllocated()) {
- heap_->num_bytes_allocated_.FetchAndAddSequentiallyConsistent(delta_);
- }
- ~ScopedHeapFill() {
- heap_->num_bytes_allocated_.FetchAndSubSequentiallyConsistent(delta_);
- }
-
- private:
- Heap* const heap_;
- const int64_t delta_;
-};
-
} // namespace gc
} // namespace art
IsHeapReferenceMarkedCallback* is_marked_callback_;
MarkObjectCallback* mark_callback_;
void* arg_;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ProcessReferencesArgs);
};
bool SlowPathEnabled() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Called by ProcessReferences.
ReferenceQueue finalizer_reference_queue_;
ReferenceQueue phantom_reference_queue_;
ReferenceQueue cleared_references_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReferenceProcessor);
};
} // namespace gc
// GC types.
mirror::Reference* list_;
- DISALLOW_COPY_AND_ASSIGN(ReferenceQueue);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ReferenceQueue);
};
} // namespace gc
private:
friend class art::gc::Heap;
- DISALLOW_COPY_AND_ASSIGN(Space);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Space);
};
std::ostream& operator<<(std::ostream& os, const Space& space);
uint8_t* limit_;
private:
- DISALLOW_COPY_AND_ASSIGN(ContinuousSpace);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ContinuousSpace);
};
// A space where objects may be allocated higgledy-piggledy throughout virtual memory. Currently
std::unique_ptr<accounting::LargeObjectBitmap> mark_bitmap_;
private:
- DISALLOW_COPY_AND_ASSIGN(DiscontinuousSpace);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DiscontinuousSpace);
};
class MemMapSpace : public ContinuousSpace {
std::unique_ptr<MemMap> mem_map_;
private:
- DISALLOW_COPY_AND_ASSIGN(MemMapSpace);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MemMapSpace);
};
// Used by the heap compaction interface to enable copying from one type of alloc space to another.
private:
friend class gc::Heap;
- DISALLOW_COPY_AND_ASSIGN(ContinuousMemMapAllocSpace);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ContinuousMemMapAllocSpace);
};
} // namespace space
uint64_t target_run_time_;
friend class TaskProcessor;
+ DISALLOW_IMPLICIT_CONSTRUCTORS(HeapTask);
};
// Used to process GC tasks (heap trim, heap transitions, concurrent GC).
std::unique_ptr<ConditionVariable> cond_ GUARDED_BY(lock_);
std::multiset<HeapTask*, CompareByTargetRunTime> tasks_ GUARDED_BY(lock_);
Thread* running_thread_ GUARDED_BY(lock_);
+
+ DISALLOW_COPY_AND_ASSIGN(TaskProcessor);
};
} // namespace gc
std::unique_ptr<jit::JitInstrumentationCache> instrumentation_cache_;
std::unique_ptr<jit::JitCodeCache> code_cache_;
CompilerCallbacks* compiler_callbacks_; // Owned by the jit compiler.
+
+ DISALLOW_COPY_AND_ASSIGN(Jit);
};
class JitOptions {
bool dump_info_on_shutdown_;
JitOptions() : use_jit_(false), code_cache_capacity_(0), compile_threshold_(0),
- dump_info_on_shutdown_(false) {
- }
+ dump_info_on_shutdown_(false) { }
+
+ DISALLOW_COPY_AND_ASSIGN(JitOptions);
};
} // namespace jit
// required since we have to implement ClassLinker::GetQuickOatCodeFor for walking stacks.
SafeMap<mirror::ArtMethod*, const void*> method_code_map_ GUARDED_BY(lock_);
- DISALLOW_COPY_AND_ASSIGN(JitCodeCache);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JitCodeCache);
};
private:
mirror::ArtMethod* const method_;
JitInstrumentationCache* const cache_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JitCompileTask);
};
JitInstrumentationCache::JitInstrumentationCache(size_t hot_method_threshold)
std::unordered_map<jmethodID, size_t> samples_;
size_t hot_method_threshold_;
std::unique_ptr<ThreadPool> thread_pool_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JitInstrumentationCache);
};
class JitInstrumentationListener : public instrumentation::InstrumentationListener {
private:
JitInstrumentationCache* const instrumentation_cache_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JitInstrumentationListener);
};
} // namespace jit
private:
mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
ArenaAllocator allocator_ GUARDED_BY(lock_);
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(LinearAlloc);
};
} // namespace art