Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc

Issue 2795183002: [Interpreter] Move ToBoolean elision in BytecodeGenerator. (Closed)
Patch Set: tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/unittests/interpreter/bytecode-array-builder-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
index 50dc4b200df9d9d00aab7019af4a1ed1c24176f3..a400cd1868217477979cce8e6fbbbae04dbd427c 100644
--- a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
+++ b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
@@ -128,56 +128,6 @@ TEST_F(BytecodePeepholeOptimizerTest, KeepStatementNop) {
CHECK_EQ(add, last_written());
}
-// Tests covering BytecodePeepholeOptimizer::UpdateCurrentBytecode().
-
-TEST_F(BytecodePeepholeOptimizerTest, KeepJumpIfToBooleanTrue) {
- BytecodeNode first(Bytecode::kLdaNull);
- BytecodeNode second(Bytecode::kJumpIfToBooleanTrue, 3);
- BytecodeLabel label;
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->WriteJump(&second, &label);
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written(), second);
-}
-
-TEST_F(BytecodePeepholeOptimizerTest, ElideJumpIfToBooleanTrue) {
- BytecodeNode first(Bytecode::kLdaTrue);
- BytecodeNode second(Bytecode::kJumpIfToBooleanTrue, 3);
- BytecodeLabel label;
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->WriteJump(&second, &label);
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written(), second);
-}
-
-TEST_F(BytecodePeepholeOptimizerTest, KeepToBooleanLogicalNot) {
- BytecodeNode first(Bytecode::kLdaNull);
- BytecodeNode second(Bytecode::kToBooleanLogicalNot);
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->Write(&second);
- CHECK_EQ(write_count(), 1);
- CHECK_EQ(last_written(), first);
- Flush();
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written(), second);
-}
-
-TEST_F(BytecodePeepholeOptimizerTest, ElideToBooleanLogicalNot) {
- BytecodeNode first(Bytecode::kLdaTrue);
- BytecodeNode second(Bytecode::kToBooleanLogicalNot);
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->Write(&second);
- CHECK_EQ(write_count(), 1);
- CHECK_EQ(last_written(), first);
- Flush();
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written().bytecode(), Bytecode::kLogicalNot);
-}
-
// Tests covering BytecodePeepholeOptimizer::CanElideCurrent().
TEST_F(BytecodePeepholeOptimizerTest, StarRxLdarRy) {
« no previous file with comments | « test/unittests/interpreter/bytecode-array-builder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698