summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2016-04-22 16:57:00 +0100
committerDavid Brazdil <dbrazdil@google.com>2016-04-22 16:57:00 +0100
commitc120bbe26fe116d3c9d8322f44bb9e330e07f745 (patch)
tree63e503da272d0be6d6dc243c29d4e7b184705710 /compiler/optimizing/instruction_builder.h
parent121c8a6494f2224830ed0ca33df5af0d8c077647 (diff)
ART: Naive NullCheck elimination in InstructionBuilder
Save a little bit of memory by not generating trivially redundant HNullCheck instructions. This patch builds on the fact that the InstructionBuilder now directly generates SSA form and looks at the input of the NullCheck. For obvious cases, such as NewInstance/Array or `this`, the NullCheck generation is completely avoided. Bug: 28173563 Change-Id: I1fdf3b096c7a939f7b8586c02a2a6b44dfa43443
Diffstat (limited to 'compiler/optimizing/instruction_builder.h')
-rw-r--r--compiler/optimizing/instruction_builder.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h
index 070f7da80e..0e3e5a7c34 100644
--- a/compiler/optimizing/instruction_builder.h
+++ b/compiler/optimizing/instruction_builder.h
@@ -87,6 +87,7 @@ class HInstructionBuilder : public ValueObject {
ArenaVector<HInstruction*>* GetLocalsFor(HBasicBlock* block);
HInstruction* ValueOfLocalAt(HBasicBlock* block, size_t local);
HInstruction* LoadLocal(uint32_t register_index, Primitive::Type type) const;
+ HInstruction* LoadNullCheckedLocal(uint32_t register_index, uint32_t dex_pc);
void UpdateLocal(uint32_t register_index, HInstruction* instruction);
void AppendInstruction(HInstruction* instruction);