diff options
author | Vladimir Marko <vmarko@google.com> | 2014-11-24 19:45:41 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-11-24 19:49:22 +0000 |
commit | 743b98cd3d7db1cfd6b3d7f7795e8abd9d07a42d (patch) | |
tree | f84a555c7c4597f9569de48ac205e7c31f05ccd6 /compiler/dex/local_value_numbering_test.cc | |
parent | a5de1924ddf0e6e89d98484a3b93b63b126bac76 (diff) | |
download | art-743b98cd3d7db1cfd6b3d7f7795e8abd9d07a42d.tar.gz art-743b98cd3d7db1cfd6b3d7f7795e8abd9d07a42d.tar.bz2 art-743b98cd3d7db1cfd6b3d7f7795e8abd9d07a42d.zip |
Skip null check in MarkGCCard() for known non-null values.
Use GVN's knowledge of non-null values to set a new MIR flag
for IPUT/SPUT/APUT to skip the value null check.
Change-Id: I97a8d1447acb530c9bbbf7b362add366d1486ee1
Diffstat (limited to 'compiler/dex/local_value_numbering_test.cc')
-rw-r--r-- | compiler/dex/local_value_numbering_test.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/dex/local_value_numbering_test.cc b/compiler/dex/local_value_numbering_test.cc index f4f13f2c76..0fcb5843cf 100644 --- a/compiler/dex/local_value_numbering_test.cc +++ b/compiler/dex/local_value_numbering_test.cc @@ -607,7 +607,9 @@ TEST_F(LocalValueNumberingTest, EscapingRefs) { EXPECT_NE(value_names_[13], value_names_[16]); // New value. EXPECT_NE(value_names_[14], value_names_[17]); // New value. for (size_t i = 0u; i != mir_count_; ++i) { - int expected = (i != 0u && i != 3u && i != 6u) ? MIR_IGNORE_NULL_CHECK : 0; + int expected = + ((i != 0u && i != 3u && i != 6u) ? MIR_IGNORE_NULL_CHECK : 0) | + ((i == 3u) ? MIR_STORE_NON_NULL_VALUE: 0); EXPECT_EQ(expected, mirs_[i].optimization_flags) << i; } } @@ -640,7 +642,8 @@ TEST_F(LocalValueNumberingTest, EscapingArrayRefs) { for (size_t i = 0u; i != mir_count_; ++i) { int expected = ((i != 0u && i != 3u && i != 6u && i != 9u) ? MIR_IGNORE_NULL_CHECK : 0u) | - ((i >= 4 && i != 6u && i != 9u) ? MIR_IGNORE_RANGE_CHECK : 0u); + ((i >= 4 && i != 6u && i != 9u) ? MIR_IGNORE_RANGE_CHECK : 0u) | + ((i == 3u) ? MIR_STORE_NON_NULL_VALUE: 0); EXPECT_EQ(expected, mirs_[i].optimization_flags) << i; } } |