summaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/interpreter
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-05-05 09:19:02 +0200
committerMichaël Zasso <targos@protonmail.com>2020-05-12 16:12:13 +0200
commit1d6adf7432defeb39b751a19c68335e8afb0d8ee (patch)
tree7ab67931110b8d9db770d774c7a6d0d14c976c15 /deps/v8/test/unittests/interpreter
parentaee36a04475a20c13663d1037aa6f175ff368bc7 (diff)
downloadnode-new-1d6adf7432defeb39b751a19c68335e8afb0d8ee.tar.gz
deps: update V8 to 8.3.110.9
PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/test/unittests/interpreter')
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc24
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc20
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc146
-rw-r--r--deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc118
-rw-r--r--deps/v8/test/unittests/interpreter/constant-array-builder-unittest.cc14
5 files changed, 117 insertions, 205 deletions
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index 7591a30f6b..cc7ca63061 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -79,8 +79,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.StoreAccumulatorInRegister(wide);
// Emit Ldar and Star taking care to foil the register optimizer.
- builder.StackCheck(0)
- .LoadAccumulatorWithRegister(other)
+ builder.LoadAccumulatorWithRegister(other)
.BinaryOperation(Token::ADD, reg, 1)
.StoreAccumulatorInRegister(reg)
.LoadNull();
@@ -312,7 +311,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.Bind(&after_jump10)
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &after_jump11)
.Bind(&after_jump11)
- .JumpLoop(&loop_header, 0)
+ .JumpLoop(&loop_header, 0, 0)
.Bind(&after_loop);
}
@@ -343,9 +342,6 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit set pending message bytecode.
builder.SetPendingMessage();
- // Emit stack check bytecode.
- builder.StackCheck(0);
-
// Emit throw and re-throw in it's own basic block so that the rest of the
// code isn't omitted due to being dead.
BytecodeLabel after_throw, after_rethrow;
@@ -447,7 +443,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Generate BytecodeArray.
scope.SetScriptScopeInfo(factory->NewScopeInfo(1));
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> the_array = builder.ToBytecodeArray(isolate());
CHECK_EQ(the_array->frame_size(),
builder.total_register_count() * kSystemPointerSize);
@@ -535,7 +531,11 @@ TEST_F(BytecodeArrayBuilderTest, Parameters) {
Register receiver(builder.Receiver());
Register param8(builder.Parameter(8));
+#ifdef V8_REVERSE_JSARGS
+ CHECK_EQ(receiver.index() - param8.index(), 9);
+#else
CHECK_EQ(param8.index() - receiver.index(), 9);
+#endif
}
TEST_F(BytecodeArrayBuilderTest, Constants) {
@@ -560,7 +560,7 @@ TEST_F(BytecodeArrayBuilderTest, Constants) {
.LoadLiteral(nan)
.Return();
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> array = builder.ToBytecodeArray(isolate());
// Should only have one entry for each identical constant.
EXPECT_EQ(4, array->constant_pool().length());
@@ -706,12 +706,14 @@ TEST_F(BytecodeArrayBuilderTest, BackwardJumps) {
BytecodeLoopHeader loop_header;
builder.JumpIfNull(&after_loop)
.Bind(&loop_header)
- .JumpLoop(&loop_header, 0)
+ .JumpLoop(&loop_header, 0, 0)
.Bind(&after_loop);
for (int i = 0; i < 42; i++) {
BytecodeLabel after_loop;
// Conditional jump to force the code after the JumpLoop to be live.
- builder.JumpIfNull(&after_loop).JumpLoop(&loop_header, 0).Bind(&after_loop);
+ builder.JumpIfNull(&after_loop)
+ .JumpLoop(&loop_header, 0, 0)
+ .Bind(&after_loop);
}
// Add padding to force wide backwards jumps.
@@ -719,7 +721,7 @@ TEST_F(BytecodeArrayBuilderTest, BackwardJumps) {
builder.Debugger();
}
- builder.JumpLoop(&loop_header, 0);
+ builder.JumpLoop(&loop_header, 0, 0);
builder.Bind(&end);
builder.Return();
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
index 23f0d08c1c..5772b802c0 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-iterator-unittest.cc
@@ -53,10 +53,8 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -73,7 +71,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
.Return();
// Test iterator sees the expected output from the builder.
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
BytecodeArrayIterator iterator(builder.ToBytecodeArray(isolate()));
const int kPrefixByteSize = 1;
int offset = 0;
@@ -138,14 +136,6 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
iterator.Advance();
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- CHECK(!iterator.done());
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- iterator.Advance();
-
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
@@ -164,14 +154,6 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
kPrefixByteSize;
iterator.Advance();
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- CHECK(!iterator.done());
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- iterator.Advance();
-
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
index 9553058d8d..ecdf6757fb 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc
@@ -49,10 +49,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -66,7 +64,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
.Debugger()
.Return();
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
@@ -103,10 +101,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -120,7 +116,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
.Debugger()
.Return();
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
@@ -157,10 +153,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -174,7 +168,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
.Debugger()
.Return();
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
@@ -216,10 +210,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -233,7 +225,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
.Debugger()
.Return();
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
@@ -242,7 +234,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
int offset = bytecodeArray->length() -
Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
- EXPECT_EQ(iterator.current_index(), 22);
+ EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@@ -276,10 +268,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -294,13 +284,13 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
.Return();
// Test iterator sees the expected output from the builder.
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
BytecodeArrayRandomIterator iterator(builder.ToBytecodeArray(isolate()),
zone());
const int kPrefixByteSize = 1;
int offset = 0;
- iterator.GoToIndex(13);
+ iterator.GoToIndex(11);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
@@ -308,16 +298,14 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
- EXPECT_EQ(iterator.current_index(), 13);
+ EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -336,7 +324,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
heap_num_1);
ASSERT_TRUE(iterator.IsValid());
- iterator.GoToIndex(18);
+ iterator.GoToIndex(16);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
@@ -344,11 +332,9 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
@@ -358,7 +344,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
- EXPECT_EQ(iterator.current_index(), 18);
+ EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
@@ -375,7 +361,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset -= Bytecodes::Size(Bytecode::kLdaNamedProperty, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaNamedProperty);
- EXPECT_EQ(iterator.current_index(), 15);
+ EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -388,14 +374,14 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 17);
+ EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
- iterator.GoToIndex(22);
+ iterator.GoToIndex(20);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
@@ -403,11 +389,9 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
@@ -422,12 +406,12 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
- EXPECT_EQ(iterator.current_index(), 22);
+ EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
- iterator.GoToIndex(24);
+ iterator.GoToIndex(22);
EXPECT_FALSE(iterator.IsValid());
iterator.GoToIndex(-5);
@@ -462,10 +446,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -480,7 +462,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
.Return();
// Test iterator sees the expected output from the builder.
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
BytecodeArrayRandomIterator iterator(builder.ToBytecodeArray(isolate()),
zone());
const int kPrefixByteSize = 1;
@@ -553,17 +535,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
++iterator;
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_index(), 7);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- ASSERT_TRUE(iterator.IsValid());
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- ++iterator;
-
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 8);
+ EXPECT_EQ(iterator.current_index(), 7);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -573,7 +546,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
- EXPECT_EQ(iterator.current_index(), 9);
+ EXPECT_EQ(iterator.current_index(), 8);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
@@ -582,17 +555,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
kPrefixByteSize;
++iterator;
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_index(), 10);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- ASSERT_TRUE(iterator.IsValid());
- offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- ++iterator;
-
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 11);
+ EXPECT_EQ(iterator.current_index(), 9);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -602,7 +566,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdar);
- EXPECT_EQ(iterator.current_index(), 12);
+ EXPECT_EQ(iterator.current_index(), 10);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -611,7 +575,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
- EXPECT_EQ(iterator.current_index(), 13);
+ EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -621,7 +585,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 14);
+ EXPECT_EQ(iterator.current_index(), 12);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -631,7 +595,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaNamedProperty);
- EXPECT_EQ(iterator.current_index(), 15);
+ EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -642,7 +606,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
- EXPECT_EQ(iterator.current_index(), 16);
+ EXPECT_EQ(iterator.current_index(), 14);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -652,7 +616,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 17);
+ EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
@@ -662,7 +626,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
- EXPECT_EQ(iterator.current_index(), 18);
+ EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
@@ -677,7 +641,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
- EXPECT_EQ(iterator.current_index(), 19);
+ EXPECT_EQ(iterator.current_index(), 17);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -688,7 +652,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
- EXPECT_EQ(iterator.current_index(), 20);
+ EXPECT_EQ(iterator.current_index(), 18);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
@@ -699,7 +663,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
- EXPECT_EQ(iterator.current_index(), 21);
+ EXPECT_EQ(iterator.current_index(), 19);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@@ -707,7 +671,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
- EXPECT_EQ(iterator.current_index(), 22);
+ EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@@ -743,10 +707,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
.LoadLiteral(zero)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_0)
- .StackCheck(0)
.StoreAccumulatorInRegister(reg_0)
.LoadLiteral(smi_1)
- .StackCheck(1)
.StoreAccumulatorInRegister(reg_1)
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
@@ -761,7 +723,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
.Return();
// Test iterator sees the expected output from the builder.
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<BytecodeArray> bytecodeArray = builder.ToBytecodeArray(isolate());
BytecodeArrayRandomIterator iterator(bytecodeArray, zone());
const int kPrefixByteSize = 1;
@@ -771,7 +733,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
- EXPECT_EQ(iterator.current_index(), 22);
+ EXPECT_EQ(iterator.current_index(), 20);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@@ -779,7 +741,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
- EXPECT_EQ(iterator.current_index(), 21);
+ EXPECT_EQ(iterator.current_index(), 19);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@@ -787,7 +749,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
- EXPECT_EQ(iterator.current_index(), 20);
+ EXPECT_EQ(iterator.current_index(), 18);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
@@ -798,7 +760,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
- EXPECT_EQ(iterator.current_index(), 19);
+ EXPECT_EQ(iterator.current_index(), 17);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -810,7 +772,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -=
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
- EXPECT_EQ(iterator.current_index(), 18);
+ EXPECT_EQ(iterator.current_index(), 16);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
@@ -824,7 +786,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 17);
+ EXPECT_EQ(iterator.current_index(), 15);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), param.index());
@@ -834,7 +796,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
- EXPECT_EQ(iterator.current_index(), 16);
+ EXPECT_EQ(iterator.current_index(), 14);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -844,7 +806,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kLdaNamedProperty, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaNamedProperty);
- EXPECT_EQ(iterator.current_index(), 15);
+ EXPECT_EQ(iterator.current_index(), 13);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -855,7 +817,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 14);
+ EXPECT_EQ(iterator.current_index(), 12);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -865,7 +827,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kAdd, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kAdd);
- EXPECT_EQ(iterator.current_index(), 13);
+ EXPECT_EQ(iterator.current_index(), 11);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -875,7 +837,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdar);
- EXPECT_EQ(iterator.current_index(), 12);
+ EXPECT_EQ(iterator.current_index(), 10);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -884,7 +846,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 11);
+ EXPECT_EQ(iterator.current_index(), 9);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
@@ -892,19 +854,10 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
ASSERT_TRUE(iterator.IsValid());
--iterator;
- offset -= Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_index(), 10);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- ASSERT_TRUE(iterator.IsValid());
- --iterator;
-
offset -= Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
kPrefixByteSize;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
- EXPECT_EQ(iterator.current_index(), 9);
+ EXPECT_EQ(iterator.current_index(), 8);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
@@ -913,7 +866,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStar);
- EXPECT_EQ(iterator.current_index(), 8);
+ EXPECT_EQ(iterator.current_index(), 7);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
@@ -921,15 +874,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
ASSERT_TRUE(iterator.IsValid());
--iterator;
- offset -= Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
- EXPECT_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
- EXPECT_EQ(iterator.current_index(), 7);
- EXPECT_EQ(iterator.current_offset(), offset);
- EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
- EXPECT_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
- ASSERT_TRUE(iterator.IsValid());
- --iterator;
-
offset -= Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
EXPECT_EQ(iterator.current_index(), 6);
diff --git a/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc b/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc
index 339fc33178..0bf431eaae 100644
--- a/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc
@@ -115,28 +115,24 @@ void BytecodeArrayWriterUnittest::WriteJumpLoop(Bytecode bytecode,
TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
CHECK_EQ(bytecodes()->size(), 0u);
- Write(Bytecode::kStackCheck, {10, false});
- CHECK_EQ(bytecodes()->size(), 1u);
-
Write(Bytecode::kLdaSmi, 127, {55, true});
- CHECK_EQ(bytecodes()->size(), 3u);
+ CHECK_EQ(bytecodes()->size(), 2u);
Write(Bytecode::kStar, Register(20).ToOperand());
- CHECK_EQ(bytecodes()->size(), 5u);
+ CHECK_EQ(bytecodes()->size(), 4u);
Write(Bytecode::kLdar, Register(200).ToOperand());
- CHECK_EQ(bytecodes()->size(), 9u);
+ CHECK_EQ(bytecodes()->size(), 8u);
Write(Bytecode::kReturn, {70, true});
- CHECK_EQ(bytecodes()->size(), 10u);
+ CHECK_EQ(bytecodes()->size(), 9u);
static const uint8_t expected_bytes[] = {
// clang-format off
- /* 0 10 E> */ B(StackCheck),
- /* 1 55 S> */ B(LdaSmi), U8(127),
- /* 3 */ B(Star), R8(20),
- /* 5 */ B(Wide), B(Ldar), R16(200),
- /* 9 70 S> */ B(Return),
+ /* 0 55 S> */ B(LdaSmi), U8(127),
+ /* 2 */ B(Star), R8(20),
+ /* 4 */ B(Wide), B(Ldar), R16(200),
+ /* 8 70 S> */ B(Return),
// clang-format on
};
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
@@ -150,8 +146,7 @@ TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
*writer()->ToSourcePositionTable(isolate()));
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
- PositionTableEntry expected_positions[] = {
- {0, 10, false}, {1, 55, true}, {9, 70, true}};
+ PositionTableEntry expected_positions[] = {{0, 55, true}, {8, 70, true}};
SourcePositionTableIterator source_iterator(
bytecode_array->SourcePositionTable());
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
@@ -168,40 +163,37 @@ TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
TEST_F(BytecodeArrayWriterUnittest, ComplexExample) {
static const uint8_t expected_bytes[] = {
// clang-format off
- /* 0 30 E> */ B(StackCheck),
- /* 1 42 S> */ B(LdaConstant), U8(0),
- /* 3 42 E> */ B(Add), R8(1), U8(1),
- /* 5 68 S> */ B(JumpIfUndefined), U8(39),
- /* 7 */ B(JumpIfNull), U8(37),
- /* 9 */ B(ToObject), R8(3),
- /* 11 */ B(ForInPrepare), R8(3), U8(4),
- /* 14 */ B(LdaZero),
- /* 15 */ B(Star), R8(7),
- /* 17 63 S> */ B(ForInContinue), R8(7), R8(6),
- /* 20 */ B(JumpIfFalse), U8(24),
- /* 22 */ B(ForInNext), R8(3), R8(7), R8(4), U8(1),
- /* 27 */ B(JumpIfUndefined), U8(10),
- /* 29 */ B(Star), R8(0),
- /* 31 54 E> */ B(StackCheck),
- /* 32 */ B(Ldar), R8(0),
- /* 34 */ B(Star), R8(2),
- /* 36 85 S> */ B(Return),
- /* 37 */ B(ForInStep), R8(7),
- /* 39 */ B(Star), R8(7),
- /* 41 */ B(JumpLoop), U8(24), U8(0),
- /* 44 */ B(LdaUndefined),
- /* 45 85 S> */ B(Return),
+ /* 0 42 S> */ B(LdaConstant), U8(0),
+ /* 2 42 E> */ B(Add), R8(1), U8(1),
+ /* 4 68 S> */ B(JumpIfUndefined), U8(38),
+ /* 6 */ B(JumpIfNull), U8(36),
+ /* 8 */ B(ToObject), R8(3),
+ /* 10 */ B(ForInPrepare), R8(3), U8(4),
+ /* 13 */ B(LdaZero),
+ /* 14 */ B(Star), R8(7),
+ /* 16 63 S> */ B(ForInContinue), R8(7), R8(6),
+ /* 19 */ B(JumpIfFalse), U8(23),
+ /* 21 */ B(ForInNext), R8(3), R8(7), R8(4), U8(1),
+ /* 26 */ B(JumpIfUndefined), U8(9),
+ /* 28 */ B(Star), R8(0),
+ /* 30 */ B(Ldar), R8(0),
+ /* 32 */ B(Star), R8(2),
+ /* 34 85 S> */ B(Return),
+ /* 35 */ B(ForInStep), R8(7),
+ /* 37 */ B(Star), R8(7),
+ /* 39 */ B(JumpLoop), U8(23), U8(0),
+ /* 42 */ B(LdaUndefined),
+ /* 43 85 S> */ B(Return),
// clang-format on
};
static const PositionTableEntry expected_positions[] = {
- {0, 30, false}, {1, 42, true}, {3, 42, false}, {6, 68, true},
- {18, 63, true}, {32, 54, false}, {37, 85, true}, {46, 85, true}};
+ {0, 42, true}, {2, 42, false}, {5, 68, true},
+ {17, 63, true}, {35, 85, true}, {44, 85, true}};
BytecodeLoopHeader loop_header;
BytecodeLabel jump_for_in, jump_end_1, jump_end_2, jump_end_3;
- Write(Bytecode::kStackCheck, {30, false});
Write(Bytecode::kLdaConstant, U8(0), {42, true});
Write(Bytecode::kAdd, R(1), U8(1), {42, false});
WriteJump(Bytecode::kJumpIfUndefined, &jump_end_1, {68, true});
@@ -216,7 +208,6 @@ TEST_F(BytecodeArrayWriterUnittest, ComplexExample) {
Write(Bytecode::kForInNext, R(3), R(7), R(4), U8(1));
WriteJump(Bytecode::kJumpIfUndefined, &jump_for_in);
Write(Bytecode::kStar, R(0));
- Write(Bytecode::kStackCheck, {54, false});
Write(Bytecode::kLdar, R(0));
Write(Bytecode::kStar, R(2));
Write(Bytecode::kReturn, {85, true});
@@ -258,23 +249,18 @@ TEST_F(BytecodeArrayWriterUnittest, ElideNoneffectfulBytecodes) {
static const uint8_t expected_bytes[] = {
// clang-format off
- /* 0 10 E> */ B(StackCheck),
- /* 1 55 S> */ B(Ldar), R8(20),
- /* 3 */ B(Star), R8(20),
- /* 5 */ B(CreateMappedArguments),
- /* 6 60 S> */ B(LdaSmi), U8(127),
- /* 8 70 S> */ B(Ldar), R8(20),
- /* 10 75 S> */ B(Return),
+ /* 0 55 S> */ B(Ldar), R8(20),
+ /* 2 */ B(Star), R8(20),
+ /* 4 */ B(CreateMappedArguments),
+ /* 5 60 S> */ B(LdaSmi), U8(127),
+ /* 7 70 S> */ B(Ldar), R8(20),
+ /* 9 75 S> */ B(Return),
// clang-format on
};
- static const PositionTableEntry expected_positions[] = {{0, 10, false},
- {1, 55, true},
- {6, 60, false},
- {8, 70, true},
- {10, 75, true}};
+ static const PositionTableEntry expected_positions[] = {
+ {0, 55, true}, {5, 60, false}, {7, 70, true}, {9, 75, true}};
- Write(Bytecode::kStackCheck, {10, false});
Write(Bytecode::kLdaSmi, 127, {55, true}); // Should be elided.
Write(Bytecode::kLdar, Register(20).ToOperand());
Write(Bytecode::kStar, Register(20).ToOperand());
@@ -310,27 +296,25 @@ TEST_F(BytecodeArrayWriterUnittest, ElideNoneffectfulBytecodes) {
TEST_F(BytecodeArrayWriterUnittest, DeadcodeElimination) {
static const uint8_t expected_bytes[] = {
// clang-format off
- /* 0 10 E> */ B(StackCheck),
- /* 1 55 S> */ B(LdaSmi), U8(127),
- /* 3 */ B(Jump), U8(2),
- /* 5 65 S> */ B(LdaSmi), U8(127),
- /* 7 */ B(JumpIfFalse), U8(3),
- /* 9 75 S> */ B(Return),
- /* 10 */ B(JumpIfFalse), U8(3),
- /* 12 */ B(Throw),
- /* 13 */ B(JumpIfFalse), U8(3),
- /* 15 */ B(ReThrow),
- /* 16 */ B(Return),
+ /* 0 55 S> */ B(LdaSmi), U8(127),
+ /* 2 */ B(Jump), U8(2),
+ /* 4 65 S> */ B(LdaSmi), U8(127),
+ /* 6 */ B(JumpIfFalse), U8(3),
+ /* 8 75 S> */ B(Return),
+ /* 9 */ B(JumpIfFalse), U8(3),
+ /* 11 */ B(Throw),
+ /* 12 */ B(JumpIfFalse), U8(3),
+ /* 14 */ B(ReThrow),
+ /* 15 */ B(Return),
// clang-format on
};
static const PositionTableEntry expected_positions[] = {
- {0, 10, false}, {1, 55, true}, {5, 65, true}, {9, 75, true}};
+ {0, 55, true}, {4, 65, true}, {8, 75, true}};
BytecodeLabel after_jump, after_conditional_jump, after_return, after_throw,
after_rethrow;
- Write(Bytecode::kStackCheck, {10, false});
Write(Bytecode::kLdaSmi, 127, {55, true});
WriteJump(Bytecode::kJump, &after_jump);
Write(Bytecode::kLdaSmi, 127); // Dead code.
diff --git a/deps/v8/test/unittests/interpreter/constant-array-builder-unittest.cc b/deps/v8/test/unittests/interpreter/constant-array-builder-unittest.cc
index 680479754a..bfe83b03ca 100644
--- a/deps/v8/test/unittests/interpreter/constant-array-builder-unittest.cc
+++ b/deps/v8/test/unittests/interpreter/constant-array-builder-unittest.cc
@@ -40,7 +40,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateAllEntries) {
builder.Insert(i + 0.5);
}
CHECK_EQ(builder.size(), k16BitCapacity);
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
for (size_t i = 0; i < k16BitCapacity; i++) {
CHECK_EQ(
Handle<HeapNumber>::cast(builder.At(i, isolate()).ToHandleChecked())
@@ -90,7 +90,7 @@ TEST_F(ConstantArrayBuilderTest, ToLargeFixedArrayWithReservations) {
for (int i = 0; i < kNumberOfElements; i++) {
builder.CommitReservedEntry(builder.CreateReservedEntry(), Smi::FromInt(i));
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
ASSERT_EQ(kNumberOfElements, constant_array->length());
for (int i = 0; i < kNumberOfElements; i++) {
@@ -149,7 +149,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithIdx8Reservations) {
builder.DiscardReservedEntry(OperandSize::kByte);
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(),
static_cast<int>(2 * k8BitCapacity + reserved));
@@ -203,7 +203,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithWideReservations) {
CHECK_EQ(builder.size(), i + 1);
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(),
static_cast<int>(k8BitCapacity + reserved));
@@ -234,7 +234,7 @@ TEST_F(ConstantArrayBuilderTest, GapFilledWhenLowReservationCommitted) {
Smi::FromInt(static_cast<int>(i)));
CHECK_EQ(builder.size(), 2 * k8BitCapacity);
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), static_cast<int>(2 * k8BitCapacity));
for (size_t i = 0; i < k8BitCapacity; i++) {
@@ -300,7 +300,7 @@ TEST_F(ConstantArrayBuilderTest, HolesWithUnusedReservations) {
builder.DiscardReservedEntry(OperandSize::kByte);
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), k8BitCapacity + 1);
for (int i = kNumberOfHoles; i < k8BitCapacity; i++) {
@@ -343,7 +343,7 @@ TEST_F(ConstantArrayBuilderTest, ReservationsAtAllScales) {
builder.DiscardReservedEntry(OperandSize::kQuad);
}
- ast_factory.Internalize(isolate()->factory());
+ ast_factory.Internalize(isolate());
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), 65537);
int count = 1;