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/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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 490 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
491 InterpreterAssemblerForTest m(this, bytecode); | 491 InterpreterAssemblerForTest m(this, bytecode); |
492 Node* context = m.Int32Constant(1); | 492 Node* context = m.Int32Constant(1); |
493 Node* slot_index = m.Int32Constant(22); | 493 Node* slot_index = m.Int32Constant(22); |
494 Node* value = m.Int32Constant(100); | 494 Node* value = m.Int32Constant(100); |
495 Node* store_context_slot = m.StoreContextSlot(context, slot_index, value); | 495 Node* store_context_slot = m.StoreContextSlot(context, slot_index, value); |
496 | 496 |
497 Matcher<Node*> offset = | 497 Matcher<Node*> offset = |
498 IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)), | 498 IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)), |
499 IsInt32Constant(Context::kHeaderSize - kHeapObjectTag)); | 499 IsInt32Constant(Context::kHeaderSize - kHeapObjectTag)); |
500 EXPECT_THAT(store_context_slot, | 500 EXPECT_THAT( |
501 m.IsStore(StoreRepresentation(kMachAnyTagged, kNoWriteBarrier), | 501 store_context_slot, |
502 context, offset, value)); | 502 m.IsStore(StoreRepresentation(kMachAnyTagged, kFullWriteBarrier), |
| 503 context, offset, value)); |
503 } | 504 } |
504 } | 505 } |
505 | 506 |
506 | 507 |
507 TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) { | 508 TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) { |
508 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 509 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
509 InterpreterAssemblerForTest m(this, bytecode); | 510 InterpreterAssemblerForTest m(this, bytecode); |
510 Node* object = m.IntPtrConstant(0xdeadbeef); | 511 Node* object = m.IntPtrConstant(0xdeadbeef); |
511 int offset = 16; | 512 int offset = 16; |
512 Node* load_field = m.LoadObjectField(object, offset); | 513 Node* load_field = m.LoadObjectField(object, offset); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 feedback_vector, | 609 feedback_vector, |
609 m.IsLoad(kMachAnyTagged, load_shared_function_info_matcher, | 610 m.IsLoad(kMachAnyTagged, load_shared_function_info_matcher, |
610 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 611 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
611 kHeapObjectTag))); | 612 kHeapObjectTag))); |
612 } | 613 } |
613 } | 614 } |
614 | 615 |
615 } // namespace compiler | 616 } // namespace compiler |
616 } // namespace internal | 617 } // namespace internal |
617 } // namespace v8 | 618 } // namespace v8 |
OLD | NEW |