diff options
author | David Brazdil <dbrazdil@google.com> | 2015-01-23 10:39:45 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-01-26 16:13:57 +0000 |
commit | ed59619b370ef23ffbb25d1d01f615e60a9262b6 (patch) | |
tree | 6c93bb6ceff95f7aaf232825e050eecc05c7282d /compiler/optimizing/nodes_test.cc | |
parent | f90eec005997f98c1a9f874fbbf68414e5f9c766 (diff) | |
download | android_art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.tar.gz android_art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.tar.bz2 android_art-ed59619b370ef23ffbb25d1d01f615e60a9262b6.zip |
Optimizing: Speed up HEnvironment use removal
Removal of use records from HEnvironment vregs involved iterating over
potentially large linked lists which made compilation of huge methods
very slow. This patch turns use lists into doubly-linked lists, stores
pointers to the relevant nodes inside HEnvironment and subsequently
turns the removals into constant-time operations.
Change-Id: I0e1d4d782fd624e7b8075af75d4adf0a0634a1ee
Diffstat (limited to 'compiler/optimizing/nodes_test.cc')
-rw-r--r-- | compiler/optimizing/nodes_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index 70dd8d7f88..cf90bf7e88 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -81,13 +81,13 @@ TEST(Node, InsertInstruction) { entry->AddInstruction(new (&allocator) HExit()); ASSERT_FALSE(parameter1->HasUses()); - ASSERT_EQ(parameter1->NumberOfUses(), 0u); + ASSERT_EQ(parameter1->ExpensiveComputeNumberOfUses(), 0u); HInstruction* to_insert = new (&allocator) HNullCheck(parameter1, 0); entry->InsertInstructionBefore(to_insert, parameter2); ASSERT_TRUE(parameter1->HasUses()); - ASSERT_EQ(parameter1->NumberOfUses(), 1u); + ASSERT_EQ(parameter1->ExpensiveComputeNumberOfUses(), 1u); } /** @@ -105,13 +105,13 @@ TEST(Node, AddInstruction) { entry->AddInstruction(parameter); ASSERT_FALSE(parameter->HasUses()); - ASSERT_EQ(parameter->NumberOfUses(), 0u); + ASSERT_EQ(parameter->ExpensiveComputeNumberOfUses(), 0u); HInstruction* to_add = new (&allocator) HNullCheck(parameter, 0); entry->AddInstruction(to_add); ASSERT_TRUE(parameter->HasUses()); - ASSERT_EQ(parameter->NumberOfUses(), 1u); + ASSERT_EQ(parameter->ExpensiveComputeNumberOfUses(), 1u); } } // namespace art |