From ea55b934cff1280318f5514039549799227cfa3d Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 27 Jan 2015 17:12:29 +0000 Subject: ART: Further refactor use lists Change-Id: I9e3219575a508ca5141d851bfcaf848302480c32 --- compiler/optimizing/nodes.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index cac78f602c..2cc021cccf 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -623,7 +623,7 @@ class HUseList : public ValueObject { // Adds a new entry at the beginning of the use list and returns // the newly created node. HUseListNode* AddUse(T user, size_t index, ArenaAllocator* arena) { - HUseListNode* new_node = new(arena) HUseListNode(user, index); + HUseListNode* new_node = new (arena) HUseListNode(user, index); if (IsEmpty()) { first_ = new_node; } else { @@ -863,21 +863,12 @@ class HInstruction : public ArenaObject { void RemoveUser(HInstruction* user, size_t index); void RemoveEnvironmentUser(HUseListNode* use); - HUseList& GetUses() { return uses_; } - HUseList& GetEnvUses() { return env_uses_; } + const HUseList& GetUses() { return uses_; } + const HUseList& GetEnvUses() { return env_uses_; } bool HasUses() const { return !uses_.IsEmpty() || !env_uses_.IsEmpty(); } bool HasEnvironmentUses() const { return !env_uses_.IsEmpty(); } - size_t ExpensiveComputeNumberOfUses() const { - // TODO: Optimize this method if it is used outside of the HGraphVisualizer. - size_t result = 0; - for (HUseIterator it(uses_); !it.Done(); it.Advance()) { - ++result; - } - return result; - } - // Does this instruction strictly dominate `other_instruction`? // Returns false if this instruction and `other_instruction` are the same. // Aborts if this instruction and `other_instruction` are both phis. -- cgit v1.2.3