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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 IsLoadParentFramePointer(), | 513 IsLoadParentFramePointer(), |
514 IsWordShl(reg_index_node, IsIntPtrConstant(kPointerSizeLog2)), | 514 IsWordShl(reg_index_node, IsIntPtrConstant(kPointerSizeLog2)), |
515 store_value)); | 515 store_value)); |
516 } | 516 } |
517 } | 517 } |
518 | 518 |
519 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { | 519 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { |
520 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 520 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
521 InterpreterAssemblerForTest m(this, bytecode); | 521 InterpreterAssemblerForTest m(this, bytecode); |
522 Node* value = m.Int32Constant(44); | 522 Node* value = m.Int32Constant(44); |
523 EXPECT_THAT( | 523 EXPECT_THAT(m.SmiTag(value), |
524 m.SmiTag(value), | 524 IsIntPtrConstant(static_cast<intptr_t>(44) |
525 IsWordShl(value, IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); | 525 << (kSmiShiftSize + kSmiTagSize))); |
526 EXPECT_THAT( | 526 EXPECT_THAT( |
527 m.SmiUntag(value), | 527 m.SmiUntag(value), |
528 IsWordSar(value, IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); | 528 IsWordSar(value, IsIntPtrConstant(kSmiShiftSize + kSmiTagSize))); |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { | 532 TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { |
533 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 533 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
534 InterpreterAssemblerForTest m(this, bytecode); | 534 InterpreterAssemblerForTest m(this, bytecode); |
535 Node* a = m.Int32Constant(0); | 535 Node* a = m.Int32Constant(0); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 feedback_vector, | 701 feedback_vector, |
702 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, | 702 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, |
703 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 703 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
704 kHeapObjectTag))); | 704 kHeapObjectTag))); |
705 } | 705 } |
706 } | 706 } |
707 | 707 |
708 } // namespace interpreter | 708 } // namespace interpreter |
709 } // namespace internal | 709 } // namespace internal |
710 } // namespace v8 | 710 } // namespace v8 |
OLD | NEW |