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

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

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patchset 13. Created 4 years, 11 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-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 be834e419776fd6f067edc396b1b2b0416927032..14fd54e9bb322a41c2ae18f979b671243918cf34 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -252,6 +252,21 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.CreateArrayLiteral(factory->NewFixedArray(2), 0, 0)
.CreateObjectLiteral(factory->NewFixedArray(2), 0, 0);
+ // Longer jumps requiring ConstantWide operand
+ builder.Jump(&start).JumpIfNull(&start).JumpIfUndefined(&start);
+ // Perform an operation that returns boolean value to
+ // generate JumpIfTrue/False
+ builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
+ .JumpIfTrue(&start)
+ .CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
+ .JumpIfFalse(&start);
+ // Perform an operation that returns a non-boolean operation to
+ // generate JumpIfToBooleanTrue/False.
+ builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
+ .JumpIfTrue(&start)
+ .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
+ .JumpIfFalse(&start);
+
builder.Return();
// Generate BytecodeArray.
@@ -685,6 +700,7 @@ TEST_F(BytecodeArrayBuilderTest, LabelAddressReuse) {
CHECK(iterator.done());
}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | test/unittests/interpreter/constant-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698