summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-12-07 11:22:59 +0000
committer Vladimir Marko <vmarko@google.com> 2017-12-08 15:27:27 +0000
commit28e012a4af2d710e5e5f824709ffd6432e4f549f (patch)
tree576ebdbff9d5f9f098cd29d652215b8f67b6b042 /runtime/class_linker_test.cc
parent4388fb213ec746ee18a6bea38ee894f8c19990b9 (diff)
Determine HLoadClass/String load kind early.
This helps save memory by avoiding the allocation of HEnvironment and related objects for AOT references to boot image strings and classes (kBootImage* load kinds) and also for JIT references (kJitTableAddress). Compiling aosp_taimen-userdebug boot image, the most memory hungry method BatteryStats.dumpLocked() needs - before: Used 55105384 bytes of arena memory... ... UseListNode 10009704 Environment 423248 EnvVRegs 20676560 ... - after: Used 50559176 bytes of arena memory... ... UseListNode 8568936 Environment 365680 EnvVRegs 17628704 ... Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Bug: 34053922 Change-Id: I68e73a438e6ac8e8908e6fccf53bbeea8a64a077
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 892a850997..94125507ef 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -1304,10 +1304,18 @@ TEST_F(ClassLinkerTest, ResolveVerifyAndClinit) {
const DexFile::TypeId* type_id = dex_file->FindTypeId("LStaticsFromCode;");
ASSERT_TRUE(type_id != nullptr);
dex::TypeIndex type_idx = dex_file->GetIndexForTypeId(*type_id);
- mirror::Class* uninit = ResolveVerifyAndClinit(type_idx, clinit, soa.Self(), true, false);
+ ObjPtr<mirror::Class> uninit = ResolveVerifyAndClinit(type_idx,
+ clinit,
+ soa.Self(),
+ /* can_run_clinit */ true,
+ /* verify_access */ false);
EXPECT_TRUE(uninit != nullptr);
EXPECT_FALSE(uninit->IsInitialized());
- mirror::Class* init = ResolveVerifyAndClinit(type_idx, getS0, soa.Self(), true, false);
+ ObjPtr<mirror::Class> init = ResolveVerifyAndClinit(type_idx,
+ getS0,
+ soa.Self(),
+ /* can_run_clinit */ true,
+ /* verify_access */ false);
EXPECT_TRUE(init != nullptr);
EXPECT_TRUE(init->IsInitialized());
}