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..b42b21fd3c6b7f9c7c6b61b84c4dc4e159ab6fc5 100644 |
--- a/test/unittests/interpreter/interpreter-assembler-unittest.cc |
+++ b/test/unittests/interpreter/interpreter-assembler-unittest.cc |
@@ -316,6 +316,9 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) { |
Node* tail_call_node = m.Dispatch(); |
OperandScale operand_scale = OperandScale::kSingle; |
+ bool hasStarLookahead = |
rmcilroy
2016/07/19 10:03:56
underscore style for local variables (has_star_loo
klaasb
2016/07/19 14:24:13
Done.
|
+ interpreter::Bytecodes::IsStarLookahead(bytecode, operand_scale); |
+ |
Matcher<Node*> next_bytecode_offset_matcher = IsIntPtrAdd( |
IsParameter(InterpreterDispatchDescriptor::kBytecodeOffsetParameter), |
IsIntPtrConstant( |
@@ -324,7 +327,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) { |
MachineType::Uint8(), |
IsParameter(InterpreterDispatchDescriptor::kBytecodeArrayParameter), |
next_bytecode_offset_matcher); |
- if (kPointerSize == 8) { |
+ if (!hasStarLookahead && kPointerSize == 8) { |
target_bytecode_matcher = IsChangeUint32ToUint64(target_bytecode_matcher); |
} |
Matcher<Node*> code_target_matcher = m.IsLoad( |
@@ -332,6 +335,32 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) { |
IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), |
IsWordShl(target_bytecode_matcher, IsIntPtrConstant(kPointerSizeLog2))); |
+ if (hasStarLookahead) { |
+ 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); |
+ target_bytecode_matcher = |
+ IsPhi(MachineRepresentation::kWord8, target_bytecode_matcher, |
+ after_lookahead_bytecode, _); |
+ if (kPointerSize == 8) { |
+ target_bytecode_matcher = |
+ IsChangeUint32ToUint64(target_bytecode_matcher); |
+ } |
+ code_target_matcher = m.IsLoad( |
+ MachineType::Pointer(), |
+ IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), |
+ IsWordShl(target_bytecode_matcher, |
+ IsIntPtrConstant(kPointerSizeLog2))); |
+ } |
+ |
EXPECT_THAT( |
tail_call_node, |
IsTailCall( |