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

Unified Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1507683005: [Interpreter] Removes ToBoolean bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased the patch. Created 5 years 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/cctest/interpreter/test-interpreter.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-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index e9dd452f95ae9a796a0c4457e8074af7e2384153..69770a0537869ce72da4df2592c6367a33ef1855 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -159,7 +159,6 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit cast operator invocations.
builder.CastAccumulatorToNumber()
- .CastAccumulatorToBoolean()
.CastAccumulatorToJSObject()
.CastAccumulatorToName();
@@ -658,68 +657,6 @@ TEST_F(BytecodeArrayBuilderTest, LabelAddressReuse) {
CHECK(iterator.done());
}
-
-TEST_F(BytecodeArrayBuilderTest, ToBoolean) {
- BytecodeArrayBuilder builder(isolate(), zone());
- builder.set_parameter_count(0);
- builder.set_locals_count(0);
- builder.set_context_count(0);
-
- // Check ToBoolean emitted at start of a basic block.
- builder.CastAccumulatorToBoolean();
-
- // Check ToBoolean emitted preceding bytecode is non-boolean.
- builder.LoadNull().CastAccumulatorToBoolean();
-
- // Check ToBoolean omitted if preceding bytecode is boolean.
- builder.LoadFalse().CastAccumulatorToBoolean();
-
- // Check ToBoolean emitted if it is at the start of a basic block caused by a
- // bound label.
- BytecodeLabel label;
- builder.LoadFalse()
- .Bind(&label)
- .CastAccumulatorToBoolean();
-
- // Check ToBoolean emitted if it is at the start of a basic block caused by a
- // jump.
- builder.LoadFalse()
- .JumpIfTrue(&label)
- .CastAccumulatorToBoolean();
-
- builder.Return();
-
- Handle<BytecodeArray> array = builder.ToBytecodeArray();
- BytecodeArrayIterator iterator(array);
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kToBoolean);
- iterator.Advance();
-
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaNull);
- iterator.Advance();
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kToBoolean);
- iterator.Advance();
-
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaFalse);
- iterator.Advance();
-
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaFalse);
- iterator.Advance();
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kToBoolean);
- iterator.Advance();
-
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaFalse);
- iterator.Advance();
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kJumpIfTrue);
- iterator.Advance();
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kToBoolean);
- iterator.Advance();
-
- CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
- iterator.Advance();
- CHECK(iterator.done());
-}
-
-
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698