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

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

Issue 1513383003: [turbofan] Store nodes use only MachineRepresentation, not MachineType. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: please mips64 Created 5 years 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
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/compiler/interpreter-assembler-unittest.h" 5 #include "test/unittests/compiler/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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 389
390 TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) { 390 TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) {
391 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { 391 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
392 InterpreterAssemblerForTest m(this, bytecode); 392 InterpreterAssemblerForTest m(this, bytecode);
393 Node* store_value = m.Int32Constant(0xdeadbeef); 393 Node* store_value = m.Int32Constant(0xdeadbeef);
394 Node* reg_index_node = m.Int32Constant(44); 394 Node* reg_index_node = m.Int32Constant(44);
395 Node* store_reg_node = m.StoreRegister(store_value, reg_index_node); 395 Node* store_reg_node = m.StoreRegister(store_value, reg_index_node);
396 EXPECT_THAT( 396 EXPECT_THAT(
397 store_reg_node, 397 store_reg_node,
398 m.IsStore( 398 m.IsStore(StoreRepresentation(MachineRepresentation::kTagged,
399 StoreRepresentation(MachineType::AnyTagged(), kNoWriteBarrier), 399 kNoWriteBarrier),
400 IsParameter(Linkage::kInterpreterRegisterFileParameter), 400 IsParameter(Linkage::kInterpreterRegisterFileParameter),
401 IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)), 401 IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)),
402 store_value)); 402 store_value));
403 } 403 }
404 } 404 }
405 405
406 406
407 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { 407 TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) {
408 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { 408 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
409 InterpreterAssemblerForTest m(this, bytecode); 409 InterpreterAssemblerForTest m(this, bytecode);
410 Node* value = m.Int32Constant(44); 410 Node* value = m.Int32Constant(44);
411 EXPECT_THAT(m.SmiTag(value), 411 EXPECT_THAT(m.SmiTag(value),
412 IsWordShl(value, IsInt32Constant(kSmiShiftSize + kSmiTagSize))); 412 IsWordShl(value, IsInt32Constant(kSmiShiftSize + kSmiTagSize)));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 InterpreterAssemblerForTest m(this, bytecode); 518 InterpreterAssemblerForTest m(this, bytecode);
519 Node* context = m.Int32Constant(1); 519 Node* context = m.Int32Constant(1);
520 Node* slot_index = m.Int32Constant(22); 520 Node* slot_index = m.Int32Constant(22);
521 Node* value = m.Int32Constant(100); 521 Node* value = m.Int32Constant(100);
522 Node* store_context_slot = m.StoreContextSlot(context, slot_index, value); 522 Node* store_context_slot = m.StoreContextSlot(context, slot_index, value);
523 523
524 Matcher<Node*> offset = 524 Matcher<Node*> offset =
525 IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)), 525 IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)),
526 IsInt32Constant(Context::kHeaderSize - kHeapObjectTag)); 526 IsInt32Constant(Context::kHeaderSize - kHeapObjectTag));
527 EXPECT_THAT(store_context_slot, 527 EXPECT_THAT(store_context_slot,
528 m.IsStore(StoreRepresentation(MachineType::AnyTagged(), 528 m.IsStore(StoreRepresentation(MachineRepresentation::kTagged,
529 kFullWriteBarrier), 529 kFullWriteBarrier),
530 context, offset, value)); 530 context, offset, value));
531 } 531 }
532 } 532 }
533 533
534 534
535 TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) { 535 TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) {
536 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { 536 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
537 InterpreterAssemblerForTest m(this, bytecode); 537 InterpreterAssemblerForTest m(this, bytecode);
538 Node* arg1 = m.Int32Constant(2); 538 Node* arg1 = m.Int32Constant(2);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 feedback_vector, 628 feedback_vector,
629 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, 629 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher,
630 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - 630 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
631 kHeapObjectTag))); 631 kHeapObjectTag)));
632 } 632 }
633 } 633 }
634 634
635 } // namespace compiler 635 } // namespace compiler
636 } // namespace internal 636 } // namespace internal
637 } // namespace v8 637 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698