summaryrefslogtreecommitdiff
path: root/openjdkjvmti
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2020-12-02 18:13:10 +0000
committerDavid Srbecky <dsrbecky@google.com>2020-12-04 14:31:35 +0000
commit86d6cd53385eae365f16f45e1a5947cc6595eb63 (patch)
treece94ee1f5d574b2891163f9b9695c97142efd00d /openjdkjvmti
parentaf17e5f33380ad39d83c31d97a29f3c836150fa1 (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 'openjdkjvmti')
-rw-r--r--openjdkjvmti/ti_redefine.cc11
-rw-r--r--openjdkjvmti/transform.cc1
2 files changed, 4 insertions, 8 deletions
diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc
index afaea6279d..58c1c4e926 100644
--- a/openjdkjvmti/ti_redefine.cc
+++ b/openjdkjvmti/ti_redefine.cc
@@ -758,13 +758,10 @@ art::mirror::DexCache* Redefiner::ClassRedefinition::CreateNewDexCache(
return nullptr;
}
art::WriterMutexLock mu(driver_->self_, *art::Locks::dex_lock_);
- art::mirror::DexCache::InitializeDexCache(driver_->self_,
- cache.Get(),
- location.Get(),
- dex_file_.get(),
- loader.IsNull() ? driver_->runtime_->GetLinearAlloc()
- : loader->GetAllocator(),
- art::kRuntimePointerSize);
+ cache->SetLocation(location.Get());
+ cache->InitializeNativeFields(dex_file_.get(),
+ loader.IsNull() ? driver_->runtime_->GetLinearAlloc()
+ : loader->GetAllocator());
return cache.Get();
}
diff --git a/openjdkjvmti/transform.cc b/openjdkjvmti/transform.cc
index 715a98c932..011bd717b4 100644
--- a/openjdkjvmti/transform.cc
+++ b/openjdkjvmti/transform.cc
@@ -68,7 +68,6 @@
#include "ti_redefine.h"
#include "ti_logging.h"
#include "transform.h"
-#include "utils/dex_cache_arrays_layout-inl.h"
namespace openjdkjvmti {