diff options
author | 2020-12-02 18:13:10 +0000 | |
---|---|---|
committer | 2020-12-04 14:31:35 +0000 | |
commit | 86d6cd53385eae365f16f45e1a5947cc6595eb63 (patch) | |
tree | ce94ee1f5d574b2891163f9b9695c97142efd00d /runtime/mirror/dex_cache-inl.h | |
parent | af17e5f33380ad39d83c31d97a29f3c836150fa1 (diff) |
Remove DexCache arrays from image.
Remove the hashtable storage from the image and allocate it at
runtime instead (but keep the DexCache object in the image).
For compiled code, we have largely moved to using .bss, so the
DexCache just costs us unnecessary extra space and dirty pages.
For interpreted code, the hashtables are too small and will be
overridden many times over at run-time regardless.
The next step will be to make DexCache variable-size so it can
adapt to both of the extremes (taking minimal amount of memory
for compiled code and avoiding cache evictions in interpreter).
Test: test.py --host
Change-Id: I9f89e8f19829b812cf85dea1a964259ed8b87f4d
Diffstat (limited to 'runtime/mirror/dex_cache-inl.h')
-rw-r--r-- | runtime/mirror/dex_cache-inl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h index 010c5a52e4..7736f47066 100644 --- a/runtime/mirror/dex_cache-inl.h +++ b/runtime/mirror/dex_cache-inl.h @@ -282,8 +282,8 @@ inline void DexCache::SetResolvedMethod(uint32_t method_idx, template <typename T> NativeDexCachePair<T> DexCache::GetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array, size_t idx, - PointerSize ptr_size) { - if (ptr_size == PointerSize::k64) { + PointerSize ptr_size ATTRIBUTE_UNUSED) { + if (kRuntimePointerSize == PointerSize::k64) { auto* array = reinterpret_cast<std::atomic<ConversionPair64>*>(pair_array); ConversionPair64 value = AtomicLoadRelaxed16B(&array[idx]); return NativeDexCachePair<T>(reinterpret_cast64<T*>(value.first), @@ -299,8 +299,8 @@ template <typename T> void DexCache::SetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array, size_t idx, NativeDexCachePair<T> pair, - PointerSize ptr_size) { - if (ptr_size == PointerSize::k64) { + PointerSize ptr_size ATTRIBUTE_UNUSED) { + if (kRuntimePointerSize == PointerSize::k64) { auto* array = reinterpret_cast<std::atomic<ConversionPair64>*>(pair_array); ConversionPair64 v(reinterpret_cast64<uint64_t>(pair.object), pair.index); AtomicStoreRelease16B(&array[idx], v); |