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

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

Issue 1362383002: [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move function address calculation into bytecode handler and have an option on CEntry stub for argv_… Created 5 years, 3 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-iterator-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-iterator-unittest.cc b/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
index 26722234f39b8337b80b39c31515d9b7ca431216..5c72cc1626f0c187c89294733867f14f42616885 100644
--- a/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
@@ -37,9 +37,6 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
Register reg_2 = Register::FromParameterIndex(2, builder.parameter_count());
int feedback_slot = 97;
- // TODO(rmcilroy): Add a test for a bytecode with a wide operand when
- // the CallRuntime bytecode is landed.
-
builder.LoadLiteral(heap_num_0)
.LoadLiteral(heap_num_1)
.LoadLiteral(zero)
@@ -48,6 +45,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
.LoadAccumulatorWithRegister(reg_0)
.LoadNamedProperty(reg_1, feedback_slot, LanguageMode::SLOPPY)
.StoreAccumulatorInRegister(reg_2)
+ .CallRuntime(Runtime::kLoadIC_Miss, reg_0, 1)
.Return();
// Test iterator sees the expected output from the builder.
@@ -92,6 +90,14 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
CHECK(!iterator.done());
iterator.Advance();
+ CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
+ CHECK_EQ(static_cast<Runtime::FunctionId>(iterator.GetWideIndexOperand(0)),
+ Runtime::kLoadIC_Miss);
+ CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
+ CHECK_EQ(iterator.GetCountOperand(2), 1);
+ CHECK(!iterator.done());
+ iterator.Advance();
+
CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
CHECK(!iterator.done());
iterator.Advance();

Powered by Google App Engine
This is Rietveld 408576698