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/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 EXPECT_THAT(m.SmiUntag(value), | 556 EXPECT_THAT(m.SmiUntag(value), |
557 IsWordSar(IsBitcastTaggedToWord(value), | 557 IsWordSar(IsBitcastTaggedToWord(value), |
558 IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); | 558 IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); |
559 } | 559 } |
560 } | 560 } |
561 | 561 |
562 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { | 562 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { |
563 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 563 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
564 InterpreterAssemblerTestState state(this, bytecode); | 564 InterpreterAssemblerTestState state(this, bytecode); |
565 InterpreterAssemblerForTest m(&state, bytecode); | 565 InterpreterAssemblerForTest m(&state, bytecode); |
566 Node* a = m.Int32Constant(0); | 566 Node* a = m.Parameter(0); |
567 Node* b = m.Int32Constant(1); | 567 Node* b = m.Int32Constant(1); |
568 Node* add = m.IntPtrAdd(a, b); | 568 Node* add = m.IntPtrAdd(a, b); |
569 EXPECT_THAT(add, IsIntPtrAdd(a, b)); | 569 EXPECT_THAT(add, IsIntPtrAdd(a, b)); |
570 } | 570 } |
571 } | 571 } |
572 | 572 |
573 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrSub) { | 573 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrSub) { |
574 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 574 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
575 InterpreterAssemblerTestState state(this, bytecode); | 575 InterpreterAssemblerTestState state(this, bytecode); |
576 InterpreterAssemblerForTest m(&state, bytecode); | 576 InterpreterAssemblerForTest m(&state, bytecode); |
577 Node* a = m.Int32Constant(0); | 577 Node* a = m.Parameter(0); |
578 Node* b = m.Int32Constant(1); | 578 Node* b = m.Int32Constant(1); |
579 Node* add = m.IntPtrSub(a, b); | 579 Node* add = m.IntPtrSub(a, b); |
580 EXPECT_THAT(add, IsIntPtrSub(a, b)); | 580 EXPECT_THAT(add, IsIntPtrSub(a, b)); |
581 } | 581 } |
582 } | 582 } |
583 | 583 |
584 TARGET_TEST_F(InterpreterAssemblerTest, WordShl) { | 584 TARGET_TEST_F(InterpreterAssemblerTest, WordShl) { |
585 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 585 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
586 InterpreterAssemblerTestState state(this, bytecode); | 586 InterpreterAssemblerTestState state(this, bytecode); |
587 InterpreterAssemblerForTest m(&state, bytecode); | 587 InterpreterAssemblerForTest m(&state, bytecode); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 EXPECT_THAT(feedback_vector, | 723 EXPECT_THAT(feedback_vector, |
724 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, | 724 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, |
725 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 725 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
726 kHeapObjectTag))); | 726 kHeapObjectTag))); |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 } // namespace interpreter | 730 } // namespace interpreter |
731 } // namespace internal | 731 } // namespace internal |
732 } // namespace v8 | 732 } // namespace v8 |
OLD | NEW |