diff options
author | Myles Borins <mylesborins@google.com> | 2019-09-24 11:56:38 -0400 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2019-10-07 03:19:23 -0400 |
commit | f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2 (patch) | |
tree | f5edbccb3ffda2573d70a6e291e7157f290e0ae0 /deps/v8/test/unittests/interpreter | |
parent | ffd22e81983056d09c064c59343a0e488236272d (diff) | |
download | node-new-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.tar.gz |
deps: update V8 to 7.8.279.9
PR-URL: https://github.com/nodejs/node/pull/29694
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'deps/v8/test/unittests/interpreter')
3 files changed, 62 insertions, 40 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 3d02db7413..a9c631f8d2 100644 --- a/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc +++ b/deps/v8/test/unittests/interpreter/bytecode-array-builder-unittest.cc @@ -151,6 +151,9 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { .StoreNamedOwnProperty(reg, name, store_own_slot.ToInt()) .StoreInArrayLiteral(reg, reg, store_array_element_slot.ToInt()); + // Emit Iterator-protocol operations + builder.GetIterator(reg, load_slot.ToInt()); + // Emit load / store lookup slots. builder.LoadLookupSlot(name, TypeofMode::NOT_INSIDE_TYPEOF) .LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF) @@ -283,7 +286,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { BytecodeLoopHeader loop_header; BytecodeLabel after_jump1, after_jump2, after_jump3, after_jump4, after_jump5, after_jump6, after_jump7, after_jump8, after_jump9, - after_jump10, after_loop; + after_jump10, after_jump11, after_loop; builder.JumpIfNull(&after_loop) .Bind(&loop_header) .Jump(&after_jump1) @@ -296,21 +299,23 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { .Bind(&after_jump4) .JumpIfNotUndefined(&after_jump5) .Bind(&after_jump5) - .JumpIfJSReceiver(&after_jump6) + .JumpIfUndefinedOrNull(&after_jump6) .Bind(&after_jump6) - .JumpIfTrue(ToBooleanMode::kConvertToBoolean, &after_jump7) + .JumpIfJSReceiver(&after_jump7) .Bind(&after_jump7) - .JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_jump8) + .JumpIfTrue(ToBooleanMode::kConvertToBoolean, &after_jump8) .Bind(&after_jump8) - .JumpIfFalse(ToBooleanMode::kConvertToBoolean, &after_jump9) + .JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_jump9) .Bind(&after_jump9) - .JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &after_jump10) + .JumpIfFalse(ToBooleanMode::kConvertToBoolean, &after_jump10) .Bind(&after_jump10) + .JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &after_jump11) + .Bind(&after_jump11) .JumpLoop(&loop_header, 0) .Bind(&after_loop); } - BytecodeLabel end[10]; + BytecodeLabel end[11]; { // Longer jumps with constant operands BytecodeLabel after_jump; @@ -325,8 +330,9 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { .JumpIfNotNull(&end[6]) .JumpIfUndefined(&end[7]) .JumpIfNotUndefined(&end[8]) + .JumpIfUndefinedOrNull(&end[9]) .LoadLiteral(ast_factory.prototype_string()) - .JumpIfJSReceiver(&end[9]); + .JumpIfJSReceiver(&end[10]); } // Emit Smi table switch bytecode. 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 6e7b945231..339fc33178 100644 --- a/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc +++ b/deps/v8/test/unittests/interpreter/bytecode-array-writer-unittest.cc @@ -146,6 +146,8 @@ TEST_F(BytecodeArrayWriterUnittest, SimpleExample) { Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(isolate(), 0, 0, factory()->empty_byte_array()); + bytecode_array->set_source_position_table( + *writer()->ToSourcePositionTable(isolate())); CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); PositionTableEntry expected_positions[] = { @@ -236,6 +238,8 @@ TEST_F(BytecodeArrayWriterUnittest, ComplexExample) { Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(isolate(), 0, 0, factory()->empty_byte_array()); + bytecode_array->set_source_position_table( + *writer()->ToSourcePositionTable(isolate())); SourcePositionTableIterator source_iterator( bytecode_array->SourcePositionTable()); for (size_t i = 0; i < arraysize(expected_positions); ++i) { @@ -288,6 +292,8 @@ TEST_F(BytecodeArrayWriterUnittest, ElideNoneffectfulBytecodes) { Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(isolate(), 0, 0, factory()->empty_byte_array()); + bytecode_array->set_source_position_table( + *writer()->ToSourcePositionTable(isolate())); SourcePositionTableIterator source_iterator( bytecode_array->SourcePositionTable()); for (size_t i = 0; i < arraysize(expected_positions); ++i) { @@ -356,6 +362,8 @@ TEST_F(BytecodeArrayWriterUnittest, DeadcodeElimination) { Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(isolate(), 0, 0, factory()->empty_byte_array()); + bytecode_array->set_source_position_table( + *writer()->ToSourcePositionTable(isolate())); SourcePositionTableIterator source_iterator( bytecode_array->SourcePositionTable()); for (size_t i = 0; i < arraysize(expected_positions); ++i) { diff --git a/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc b/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc index cb9a83997e..a8ff998107 100644 --- a/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc +++ b/deps/v8/test/unittests/interpreter/interpreter-assembler-unittest.cc @@ -14,7 +14,9 @@ #include "test/unittests/compiler/node-test-utils.h" using ::testing::_; +using ::testing::Eq; using v8::internal::compiler::Node; +using v8::internal::compiler::TNode; namespace c = v8::internal::compiler; @@ -441,7 +443,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) { InterpreterAssemblerTestState state(this, bytecode); InterpreterAssemblerForTest m(&state, bytecode); { - Node* index = m.IntPtrConstant(2); + TNode<IntPtrT> index = m.IntPtrConstant(2); Node* load_constant = m.LoadConstantPoolEntry(index); #ifdef V8_COMPRESS_POINTERS Matcher<Node*> constant_pool_matcher = @@ -511,16 +513,17 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) { TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { InterpreterAssemblerTestState state(this, bytecode); InterpreterAssemblerForTest m(&state, bytecode); - Node* object = m.IntPtrConstant(0xDEADBEEF); + TNode<HeapObject> object = + m.ReinterpretCast<HeapObject>(m.IntPtrConstant(0xDEADBEEF)); int offset = 16; - Node* load_field = m.LoadObjectField(object, offset); + TNode<Object> load_field = m.LoadObjectField(object, offset); #ifdef V8_COMPRESS_POINTERS EXPECT_THAT(load_field, IsChangeCompressedToTagged(m.IsLoadFromObject( - MachineType::AnyCompressed(), object, + MachineType::AnyCompressed(), Eq(object), c::IsIntPtrConstant(offset - kHeapObjectTag)))); #else EXPECT_THAT(load_field, m.IsLoadFromObject( - MachineType::AnyTagged(), object, + MachineType::AnyTagged(), Eq(object), c::IsIntPtrConstant(offset - kHeapObjectTag))); #endif } @@ -530,12 +533,14 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) { TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { InterpreterAssemblerTestState state(this, bytecode); InterpreterAssemblerForTest m(&state, bytecode); - Node* arg1 = m.Int32Constant(2); - Node* arg2 = m.Int32Constant(3); - Node* context = m.Int32Constant(4); - Node* call_runtime = m.CallRuntime(Runtime::kAdd, context, arg1, arg2); - EXPECT_THAT(call_runtime, c::IsCall(_, _, arg1, arg2, _, - c::IsInt32Constant(2), context, _, _)); + TNode<Object> arg1 = m.ReinterpretCast<Object>(m.Int32Constant(2)); + TNode<Object> arg2 = m.ReinterpretCast<Object>(m.Int32Constant(3)); + TNode<Object> context = m.ReinterpretCast<Object>(m.Int32Constant(4)); + TNode<Object> call_runtime = + m.CallRuntime(Runtime::kAdd, context, arg1, arg2); + EXPECT_THAT(call_runtime, + c::IsCall(_, _, Eq(arg1), Eq(arg2), _, c::IsInt32Constant(2), + Eq(context), _, _)); } } @@ -549,29 +554,30 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) { Callable builtin = CodeFactory::InterpreterCEntry(isolate(), result_size); - Node* function_id = m.Int32Constant(0); + TNode<Int32T> function_id = m.Int32Constant(0); InterpreterAssembler::RegListNodePair registers(m.IntPtrConstant(1), m.Int32Constant(2)); - Node* context = m.IntPtrConstant(4); + TNode<Object> context = m.ReinterpretCast<Object>(m.Int32Constant(4)); Matcher<Node*> function_table = c::IsExternalConstant( ExternalReference::runtime_function_table_address_for_unittests( isolate())); - Matcher<Node*> function = c::IsIntPtrAdd( - function_table, - c::IsChangeUint32ToWord(c::IsInt32Mul( - function_id, c::IsInt32Constant(sizeof(Runtime::Function))))); + Matcher<Node*> function = + c::IsIntPtrAdd(function_table, + c::IsChangeUint32ToWord(c::IsInt32Mul( + Eq(function_id), + c::IsInt32Constant(sizeof(Runtime::Function))))); Matcher<Node*> function_entry = m.IsLoad(MachineType::Pointer(), function, c::IsIntPtrConstant(offsetof(Runtime::Function, entry))); Node* call_runtime = m.CallRuntimeN(function_id, context, registers, result_size); - EXPECT_THAT( - call_runtime, - c::IsCall(_, c::IsHeapConstant(builtin.code()), - registers.reg_count(), registers.base_reg_location(), - function_entry, context, _, _)); + EXPECT_THAT(call_runtime, + c::IsCall(_, c::IsHeapConstant(builtin.code()), + Eq(registers.reg_count()), + Eq(registers.base_reg_location()), function_entry, + Eq(context), _, _)); } } } @@ -581,12 +587,13 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadFeedbackVector) { TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { InterpreterAssemblerTestState state(this, bytecode); InterpreterAssemblerForTest m(&state, bytecode); - Node* feedback_vector = m.LoadFeedbackVector(); + TNode<HeapObject> feedback_vector = m.LoadFeedbackVector(); // Feedback vector is a phi node with two inputs. One of them is loading the // feedback vector and the other is undefined constant (when feedback // vectors aren't allocated). Find the input that loads feedback vector. - CHECK(feedback_vector->opcode() == i::compiler::IrOpcode::kPhi); + CHECK_EQ(static_cast<Node*>(feedback_vector)->opcode(), + i::compiler::IrOpcode::kPhi); Node* value0 = i::compiler::NodeProperties::GetValueInput(feedback_vector, 0); Node* value1 = @@ -601,21 +608,22 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadFeedbackVector) { c::IsIntPtrConstant(Register::function_closure().ToOperand() * kSystemPointerSize))); #ifdef V8_COMPRESS_POINTERS - Matcher<Node*> load_vector_cell_matcher = IsChangeCompressedToTagged( - m.IsLoadFromObject(MachineType::AnyCompressed(), load_function_matcher, - c::IsIntPtrConstant(JSFunction::kFeedbackCellOffset - - kHeapObjectTag))); + Matcher<Node*> load_vector_cell_matcher = + IsChangeCompressedPointerToTaggedPointer(m.IsLoadFromObject( + MachineType::CompressedPointer(), load_function_matcher, + c::IsIntPtrConstant(JSFunction::kFeedbackCellOffset - + kHeapObjectTag))); EXPECT_THAT(load_feedback_vector, - IsChangeCompressedToTagged(m.IsLoadFromObject( - MachineType::AnyCompressed(), load_vector_cell_matcher, + IsChangeCompressedPointerToTaggedPointer(m.IsLoadFromObject( + MachineType::CompressedPointer(), load_vector_cell_matcher, c::IsIntPtrConstant(Cell::kValueOffset - kHeapObjectTag)))); #else Matcher<Node*> load_vector_cell_matcher = m.IsLoadFromObject( - MachineType::AnyTagged(), load_function_matcher, + MachineType::TaggedPointer(), load_function_matcher, c::IsIntPtrConstant(JSFunction::kFeedbackCellOffset - kHeapObjectTag)); EXPECT_THAT(load_feedback_vector, m.IsLoadFromObject( - MachineType::AnyTagged(), load_vector_cell_matcher, + MachineType::TaggedPointer(), load_vector_cell_matcher, c::IsIntPtrConstant(Cell::kValueOffset - kHeapObjectTag))); #endif } |