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

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

Issue 2048203002: [interpreter] Minor clean-up of BytecodeSourceInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0066-suppress
Patch Set: Rebase Created 4 years, 6 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
Index: test/unittests/interpreter/bytecode-pipeline-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-pipeline-unittest.cc b/test/unittests/interpreter/bytecode-pipeline-unittest.cc
index a2c35ff464416ff0f4180fcca24313c928671590..6e55b44d85f38417cd3c0a33627f967b0b34dbdc 100644
--- a/test/unittests/interpreter/bytecode-pipeline-unittest.cc
+++ b/test/unittests/interpreter/bytecode-pipeline-unittest.cc
@@ -24,7 +24,7 @@ TEST(BytecodeSourceInfo, Operations) {
CHECK_EQ(x.is_statement(), false);
CHECK_EQ(x.is_valid(), false);
- x.Update({1, true});
+ x.MakeStatementPosition(1);
BytecodeSourceInfo y(1, true);
CHECK(x == y);
CHECK(!(x != y));
@@ -33,20 +33,20 @@ TEST(BytecodeSourceInfo, Operations) {
CHECK(!(x == y));
CHECK(x != y);
- y.Update({2, false});
+ y.MakeStatementPosition(1);
CHECK_EQ(y.source_position(), 1);
CHECK_EQ(y.is_statement(), true);
- y.Update({2, true});
+ y.MakeStatementPosition(2);
CHECK_EQ(y.source_position(), 2);
CHECK_EQ(y.is_statement(), true);
y.set_invalid();
- y.Update({3, false});
+ y.MakeExpressionPosition(3);
CHECK_EQ(y.source_position(), 3);
CHECK_EQ(y.is_statement(), false);
- y.Update({3, true});
+ y.MakeStatementPosition(3);
CHECK_EQ(y.source_position(), 3);
CHECK_EQ(y.is_statement(), true);
}
@@ -122,11 +122,11 @@ TEST_F(BytecodeNodeTest, EqualityWithSourceInfo) {
uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
- node.source_info().Update({3, true});
+ node.source_info().MakeStatementPosition(3);
CHECK_EQ(node, node);
BytecodeNode other(Bytecode::kForInNext, operands[0], operands[1],
operands[2], operands[3]);
- other.source_info().Update({3, true});
+ other.source_info().MakeStatementPosition(3);
CHECK_EQ(node, other);
}
@@ -134,7 +134,7 @@ TEST_F(BytecodeNodeTest, NoEqualityWithDifferentSourceInfo) {
uint32_t operands[] = {0x71, 0xa5, 0x5a, 0xfc};
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
- node.source_info().Update({3, true});
+ node.source_info().MakeStatementPosition(3);
BytecodeNode other(Bytecode::kForInNext, operands[0], operands[1],
operands[2], operands[3]);
CHECK_NE(node, other);
@@ -154,7 +154,8 @@ TEST_F(BytecodeNodeTest, SetBytecode0) {
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
BytecodeSourceInfo source_info(77, false);
- node.source_info().Update(source_info);
+ node.source_info().Clone(source_info);
+ CHECK_EQ(node.source_info(), source_info);
BytecodeNode clone;
clone.Clone(&node);
@@ -169,7 +170,7 @@ TEST_F(BytecodeNodeTest, SetBytecode1) {
BytecodeNode node(Bytecode::kForInNext, operands[0], operands[1], operands[2],
operands[3]);
BytecodeSourceInfo source_info(77, false);
- node.source_info().Update(source_info);
+ node.source_info().Clone(source_info);
BytecodeNode clone;
clone.Clone(&node);

Powered by Google App Engine
This is Rietveld 408576698