Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: test/unittests/interpreter/interpreter-assembler-unittest.cc

Issue 2367413002: [turbofan] Introduces the BitcastWordToTaggedSigned and BitcastTaggedToWord opcodes. (Closed)
Patch Set: Update. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
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),
542 IsIntPtrConstant(static_cast<intptr_t>(44) 542 IsIntPtrConstant(static_cast<intptr_t>(44)
543 << (kSmiShiftSize + kSmiTagSize))); 543 << (kSmiShiftSize + kSmiTagSize)));
544 EXPECT_THAT( 544 EXPECT_THAT(m.SmiUntag(value),
545 m.SmiUntag(value), 545 IsWordSar(IsBitcastTaggedToWord(value),
546 IsWordSar(value, 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);
554 Node* b = m.Int32Constant(1); 554 Node* b = m.Int32Constant(1);
555 Node* add = m.IntPtrAdd(a, b); 555 Node* add = m.IntPtrAdd(a, b);
556 EXPECT_THAT(add, IsIntPtrAdd(a, b)); 556 EXPECT_THAT(add, IsIntPtrAdd(a, b));
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698