OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/cctest/cctest.h" | 5 #include "test/cctest/cctest.h" |
6 | 6 |
7 #include "src/base/utils/random-number-generator.h" | 7 #include "src/base/utils/random-number-generator.h" |
8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
9 #include "src/compiler/machine-operator-reducer.h" | 9 #include "src/compiler/machine-operator-reducer.h" |
10 #include "test/cctest/compiler/value-helper.h" | 10 #include "test/cctest/compiler/value-helper.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 Node* index = R.Constant<int32_t>(4); | 632 Node* index = R.Constant<int32_t>(4); |
633 Node* load = R.graph.NewNode(R.machine.Load(kMachineWord32), base, index); | 633 Node* load = R.graph.NewNode(R.machine.Load(kMachineWord32), base, index); |
634 | 634 |
635 { | 635 { |
636 MachineOperatorReducer reducer(&R.graph); | 636 MachineOperatorReducer reducer(&R.graph); |
637 Reduction reduction = reducer.Reduce(load); | 637 Reduction reduction = reducer.Reduce(load); |
638 CHECK(!reduction.Changed()); // loads should not be reduced. | 638 CHECK(!reduction.Changed()); // loads should not be reduced. |
639 } | 639 } |
640 | 640 |
641 { | 641 { |
642 Node* store = | 642 Node* store = R.graph.NewNode( |
643 R.graph.NewNode(R.machine.Store(kMachineWord32), base, index, load); | 643 R.machine.Store(kMachineWord32, kNoWriteBarrier), base, index, load); |
644 MachineOperatorReducer reducer(&R.graph); | 644 MachineOperatorReducer reducer(&R.graph); |
645 Reduction reduction = reducer.Reduce(store); | 645 Reduction reduction = reducer.Reduce(store); |
646 CHECK(!reduction.Changed()); // stores should not be reduced. | 646 CHECK(!reduction.Changed()); // stores should not be reduced. |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 | 650 |
651 static void CheckNans(ReducerTester* R) { | 651 static void CheckNans(ReducerTester* R) { |
652 Node* x = R->Parameter(); | 652 Node* x = R->Parameter(); |
653 std::vector<double> nans = ValueHelper::nan_vector(); | 653 std::vector<double> nans = ValueHelper::nan_vector(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 // TODO(titzer): test MachineOperatorReducer for Int64Mul | 770 // TODO(titzer): test MachineOperatorReducer for Int64Mul |
771 // TODO(titzer): test MachineOperatorReducer for Int64UMul | 771 // TODO(titzer): test MachineOperatorReducer for Int64UMul |
772 // TODO(titzer): test MachineOperatorReducer for Int64Div | 772 // TODO(titzer): test MachineOperatorReducer for Int64Div |
773 // TODO(titzer): test MachineOperatorReducer for Int64UDiv | 773 // TODO(titzer): test MachineOperatorReducer for Int64UDiv |
774 // TODO(titzer): test MachineOperatorReducer for Int64Mod | 774 // TODO(titzer): test MachineOperatorReducer for Int64Mod |
775 // TODO(titzer): test MachineOperatorReducer for Int64UMod | 775 // TODO(titzer): test MachineOperatorReducer for Int64UMod |
776 // TODO(titzer): test MachineOperatorReducer for Int64Neg | 776 // TODO(titzer): test MachineOperatorReducer for Int64Neg |
777 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64 | 777 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64 |
778 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32 | 778 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32 |
779 // TODO(titzer): test MachineOperatorReducer for Float64Compare | 779 // TODO(titzer): test MachineOperatorReducer for Float64Compare |
OLD | NEW |