summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver.cc
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 /dex2oat/driver/compiler_driver.cc
parentaf17e5f33380ad39d83c31d97a29f3c836150fa1 (diff)
downloadart-86d6cd53385eae365f16f45e1a5947cc6595eb63.tar.gz
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 'dex2oat/driver/compiler_driver.cc')
-rw-r--r--dex2oat/driver/compiler_driver.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index 6ea58b39e5..b487c4c6ab 100644
--- a/dex2oat/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -84,7 +84,6 @@
#include "trampolines/trampoline_compiler.h"
#include "transaction.h"
#include "utils/atomic_dex_ref_map-inl.h"
-#include "utils/dex_cache_arrays_layout-inl.h"
#include "utils/swap_space.h"
#include "vdex_file.h"
#include "verifier/class_verifier.h"
@@ -684,11 +683,6 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_
for (const DexFile* dex_file : dex_files) {
dex_cache.Assign(class_linker->FindDexCache(soa.Self(), *dex_file));
- bool added_preresolved_string_array = false;
- if (only_startup_strings) {
- // When resolving startup strings, create the preresolved strings array.
- added_preresolved_string_array = dex_cache->AddPreResolvedStringsArray();
- }
TimingLogger::ScopedTiming t("Resolve const-string Strings", timings);
// TODO: Implement a profile-based filter for the boot image. See b/76145463.
@@ -714,7 +708,7 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_
if (profile_compilation_info != nullptr && !is_startup_clinit) {
ProfileCompilationInfo::MethodHotness hotness =
profile_compilation_info->GetMethodHotness(method.GetReference());
- if (added_preresolved_string_array ? !hotness.IsStartup() : !hotness.IsInProfile()) {
+ if (only_startup_strings ? !hotness.IsStartup() : !hotness.IsInProfile()) {
continue;
}
}
@@ -732,10 +726,6 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_
: inst->VRegB_31c());
ObjPtr<mirror::String> string = class_linker->ResolveString(string_index, dex_cache);
CHECK(string != nullptr) << "Could not allocate a string when forcing determinism";
- if (added_preresolved_string_array) {
- dex_cache->GetPreResolvedStrings()[string_index.index_] =
- GcRoot<mirror::String>(string);
- }
++num_instructions;
break;
}