summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-12-07 11:22:59 +0000
committerVladimir Marko <vmarko@google.com>2017-12-08 15:27:27 +0000
commit28e012a4af2d710e5e5f824709ffd6432e4f549f (patch)
tree576ebdbff9d5f9f098cd29d652215b8f67b6b042 /compiler/optimizing/instruction_builder.h
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 'compiler/optimizing/instruction_builder.h')
-rw-r--r--compiler/optimizing/instruction_builder.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h
index 2446ddb86a..0500d40cd3 100644
--- a/compiler/optimizing/instruction_builder.h
+++ b/compiler/optimizing/instruction_builder.h
@@ -240,9 +240,10 @@ class HInstructionBuilder : public ValueObject {
// Builds an instruction sequence for a switch statement.
void BuildSwitch(const Instruction& instruction, uint32_t dex_pc);
- // Builds a `HLoadClass` loading the given `type_index`. If `outer` is true,
- // this method will use the outer class's dex file to lookup the type at
- // `type_index`.
+ // Builds a `HLoadString` loading the given `string_index`.
+ void BuildLoadString(dex::StringIndex string_index, uint32_t dex_pc);
+
+ // Builds a `HLoadClass` loading the given `type_index`.
HLoadClass* BuildLoadClass(dex::TypeIndex type_index, uint32_t dex_pc);
HLoadClass* BuildLoadClass(dex::TypeIndex type_index,
@@ -253,10 +254,10 @@ class HInstructionBuilder : public ValueObject {
REQUIRES_SHARED(Locks::mutator_lock_);
// Returns the outer-most compiling method's class.
- mirror::Class* GetOutermostCompilingClass() const;
+ ObjPtr<mirror::Class> GetOutermostCompilingClass() const;
// Returns the class whose method is being compiled.
- mirror::Class* GetCompilingClass() const;
+ ObjPtr<mirror::Class> GetCompilingClass() const;
// Returns whether `type_index` points to the outer-most compiling method's class.
bool IsOutermostCompilingClass(dex::TypeIndex type_index) const;