Chromium Code Reviews| Index: test/unittests/interpreter/interpreter-assembler-unittest.cc |
| diff --git a/test/unittests/interpreter/interpreter-assembler-unittest.cc b/test/unittests/interpreter/interpreter-assembler-unittest.cc |
| index 1bc80c0e4a7eeb635cd881c1a87eb9fdfdb77bfa..4b7c1e190a629d7a6216f56c266b7071769c2645 100644 |
| --- a/test/unittests/interpreter/interpreter-assembler-unittest.cc |
| +++ b/test/unittests/interpreter/interpreter-assembler-unittest.cc |
| @@ -332,6 +332,32 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) { |
| IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), |
| IsWordShl(target_bytecode_matcher, IsIntPtrConstant(kPointerSizeLog2))); |
| + if (interpreter::Bytecodes::IsStarLookahead(bytecode, operand_scale)) { |
| + Matcher<Node*> after_lookahead_offset = |
| + IsIntPtrAdd(next_bytecode_offset_matcher, |
| + IsIntPtrConstant(interpreter::Bytecodes::Size( |
| + Bytecode::kStar, operand_scale))); |
| + next_bytecode_offset_matcher = |
| + IsPhi(MachineType::PointerRepresentation(), |
| + next_bytecode_offset_matcher, after_lookahead_offset, _); |
| + Matcher<Node*> after_lookahead_bytecode = m.IsLoad( |
| + MachineType::Uint8(), |
| + IsParameter(InterpreterDispatchDescriptor::kBytecodeArrayParameter), |
| + after_lookahead_offset); |
| + if (kPointerSize == 8) { |
| + after_lookahead_bytecode = |
| + IsChangeUint32ToUint64(after_lookahead_bytecode); |
| + } |
| + target_bytecode_matcher = |
| + IsPhi(MachineRepresentation::kWord8, target_bytecode_matcher, |
| + after_lookahead_bytecode, _); |
| + code_target_matcher = m.IsLoad( |
| + MachineType::Pointer(), |
| + IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), |
| + IsWordShl(target_bytecode_matcher, |
| + IsIntPtrConstant(kPointerSizeLog2))); |
| + } |
| + |
| EXPECT_THAT( |
| tail_call_node, |
| IsTailCall( |
| @@ -351,6 +377,11 @@ TARGET_TEST_F(InterpreterAssemblerTest, Jump) { |
| int jump_offsets[] = {-9710, -77, 0, +3, +97109}; |
| TRACED_FOREACH(int, jump_offset, jump_offsets) { |
| TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
| + if (interpreter::Bytecodes::IsStarLookahead(bytecode, |
| + OperandScale::kSingle)) { |
| + return; |
| + } |
| + |
|
klaasb
2016/07/20 11:22:55
Jump was the only caller of DispatchTo, to which I
rmcilroy
2016/07/20 11:36:25
Agreed - could you instead make the check:
if (!in
|
| InterpreterAssemblerForTest m(this, bytecode); |
| Node* tail_call_node = m.Jump(m.IntPtrConstant(jump_offset)); |