OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test/unittests/interpreter/interpreter-assembler-unittest.h" | 5 #include "test/unittests/interpreter/interpreter-assembler-unittest.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 IsLoadParentFramePointer(), | 531 IsLoadParentFramePointer(), |
532 IsWordShl(reg_index_node, IsIntPtrConstant(kPointerSizeLog2)), | 532 IsWordShl(reg_index_node, IsIntPtrConstant(kPointerSizeLog2)), |
533 store_value)); | 533 store_value)); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { | 537 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { |
538 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 538 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
539 InterpreterAssemblerForTest m(this, bytecode); | 539 InterpreterAssemblerForTest m(this, bytecode); |
540 Node* value = m.Int32Constant(44); | 540 Node* value = m.Int32Constant(44); |
541 EXPECT_THAT(m.SmiTag(value), | 541 EXPECT_THAT(m.SmiTag(value), IsBitcastWordToTaggedSigned(IsIntPtrConstant( |
542 IsIntPtrConstant(static_cast<intptr_t>(44) | 542 static_cast<intptr_t>(44) |
543 << (kSmiShiftSize + kSmiTagSize))); | 543 << (kSmiShiftSize + kSmiTagSize)))); |
544 EXPECT_THAT(m.SmiUntag(value), | 544 EXPECT_THAT(m.SmiUntag(value), |
545 IsWordSar(IsBitcastTaggedToWord(value), | 545 IsWordSar(IsBitcastTaggedToWord(value), |
546 IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); | 546 IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); |
547 } | 547 } |
548 } | 548 } |
549 | 549 |
550 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { | 550 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { |
551 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 551 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
552 InterpreterAssemblerForTest m(this, bytecode); | 552 InterpreterAssemblerForTest m(this, bytecode); |
553 Node* a = m.Int32Constant(0); | 553 Node* a = m.Int32Constant(0); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 EXPECT_THAT(feedback_vector, | 717 EXPECT_THAT(feedback_vector, |
718 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, | 718 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, |
719 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 719 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
720 kHeapObjectTag))); | 720 kHeapObjectTag))); |
721 } | 721 } |
722 } | 722 } |
723 | 723 |
724 } // namespace interpreter | 724 } // namespace interpreter |
725 } // namespace internal | 725 } // namespace internal |
726 } // namespace v8 | 726 } // namespace v8 |
OLD | NEW |