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

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

Issue 2169813002: [interpreter] Add output register to ToName (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@addregouts
Patch Set: comments Created 4 years, 5 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 c3548252a7ff25c7832612787254161d4f162f05..fb854a98af0e158bfb8eaec4f2aae81a6fb6424b 100644
--- a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
+++ b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
@@ -241,7 +241,7 @@ TEST_F(BytecodePeepholeOptimizerTest, StarRxLdarRxStatementStarRy) {
TEST_F(BytecodePeepholeOptimizerTest, LdarToName) {
BytecodeNode first(Bytecode::kLdar, Register(0).ToOperand());
- BytecodeNode second(Bytecode::kToName);
+ BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
optimizer()->Write(&first);
CHECK_EQ(write_count(), 0);
optimizer()->Write(&second);
@@ -252,26 +252,18 @@ TEST_F(BytecodePeepholeOptimizerTest, LdarToName) {
CHECK_EQ(last_written(), second);
}
-TEST_F(BytecodePeepholeOptimizerTest, ToNameToName) {
- BytecodeNode first(Bytecode::kToName);
- BytecodeNode second(Bytecode::kToName);
- optimizer()->Write(&first);
- optimizer()->Write(&second);
- CHECK_EQ(write_count(), 0);
- Flush();
- CHECK_EQ(last_written(), first);
- CHECK_EQ(write_count(), 1);
-}
-
TEST_F(BytecodePeepholeOptimizerTest, TypeOfToName) {
BytecodeNode first(Bytecode::kTypeOf);
- BytecodeNode second(Bytecode::kToName);
+ BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
optimizer()->Write(&first);
- optimizer()->Write(&second);
CHECK_EQ(write_count(), 0);
- Flush();
+ optimizer()->Write(&second);
CHECK_EQ(write_count(), 1);
CHECK_EQ(last_written(), first);
+ Flush();
+ CHECK_EQ(write_count(), 2);
+ CHECK_EQ(last_written(), second);
+ CHECK_EQ(last_written().bytecode(), Bytecode::kStar);
}
TEST_F(BytecodePeepholeOptimizerTest, LdaConstantStringToName) {
@@ -279,20 +271,23 @@ TEST_F(BytecodePeepholeOptimizerTest, LdaConstantStringToName) {
isolate()->factory()->NewStringFromStaticChars("optimizing");
size_t index = constant_array()->Insert(word);
BytecodeNode first(Bytecode::kLdaConstant, static_cast<uint32_t>(index));
- BytecodeNode second(Bytecode::kToName);
+ BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
optimizer()->Write(&first);
- optimizer()->Write(&second);
CHECK_EQ(write_count(), 0);
- Flush();
+ optimizer()->Write(&second);
CHECK_EQ(write_count(), 1);
CHECK_EQ(last_written(), first);
+ Flush();
+ CHECK_EQ(write_count(), 2);
+ CHECK_EQ(last_written(), second);
+ CHECK_EQ(last_written().bytecode(), Bytecode::kStar);
}
TEST_F(BytecodePeepholeOptimizerTest, LdaConstantNumberToName) {
Handle<Object> word = isolate()->factory()->NewNumber(0.380);
size_t index = constant_array()->Insert(word);
BytecodeNode first(Bytecode::kLdaConstant, static_cast<uint32_t>(index));
- BytecodeNode second(Bytecode::kToName);
+ BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
optimizer()->Write(&first);
CHECK_EQ(write_count(), 0);
optimizer()->Write(&second);
« 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