| 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 "src/base/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
| 6 #include "src/codegen.h" | 6 #include "src/codegen.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/machine-operator-reducer.h" | 8 #include "src/compiler/machine-operator-reducer.h" |
| 9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
| 10 #include "src/compiler/typer.h" | 10 #include "src/compiler/typer.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 Node* load = R.graph.NewNode(R.machine.Load(MachineType::Int32()), base, | 706 Node* load = R.graph.NewNode(R.machine.Load(MachineType::Int32()), base, |
| 707 index, R.graph.start(), R.graph.start()); | 707 index, R.graph.start(), R.graph.start()); |
| 708 | 708 |
| 709 { | 709 { |
| 710 MachineOperatorReducer reducer(&R.jsgraph); | 710 MachineOperatorReducer reducer(&R.jsgraph); |
| 711 Reduction reduction = reducer.Reduce(load); | 711 Reduction reduction = reducer.Reduce(load); |
| 712 CHECK(!reduction.Changed()); // loads should not be reduced. | 712 CHECK(!reduction.Changed()); // loads should not be reduced. |
| 713 } | 713 } |
| 714 | 714 |
| 715 { | 715 { |
| 716 Node* store = R.graph.NewNode(R.machine.Store(StoreRepresentation( | 716 Node* store = |
| 717 MachineType::Int32(), kNoWriteBarrier)), | 717 R.graph.NewNode(R.machine.Store(StoreRepresentation( |
| 718 base, index, load, load, R.graph.start()); | 718 MachineRepresentation::kWord32, kNoWriteBarrier)), |
| 719 base, index, load, load, R.graph.start()); |
| 719 MachineOperatorReducer reducer(&R.jsgraph); | 720 MachineOperatorReducer reducer(&R.jsgraph); |
| 720 Reduction reduction = reducer.Reduce(store); | 721 Reduction reduction = reducer.Reduce(store); |
| 721 CHECK(!reduction.Changed()); // stores should not be reduced. | 722 CHECK(!reduction.Changed()); // stores should not be reduced. |
| 722 } | 723 } |
| 723 } | 724 } |
| 724 | 725 |
| 725 | 726 |
| 726 // TODO(titzer): test MachineOperatorReducer for Word64And | 727 // TODO(titzer): test MachineOperatorReducer for Word64And |
| 727 // TODO(titzer): test MachineOperatorReducer for Word64Or | 728 // TODO(titzer): test MachineOperatorReducer for Word64Or |
| 728 // TODO(titzer): test MachineOperatorReducer for Word64Xor | 729 // TODO(titzer): test MachineOperatorReducer for Word64Xor |
| (...skipping 16 matching lines...) Expand all Loading... |
| 745 // TODO(titzer): test MachineOperatorReducer for Float64Compare | 746 // TODO(titzer): test MachineOperatorReducer for Float64Compare |
| 746 // TODO(titzer): test MachineOperatorReducer for Float64Add | 747 // TODO(titzer): test MachineOperatorReducer for Float64Add |
| 747 // TODO(titzer): test MachineOperatorReducer for Float64Sub | 748 // TODO(titzer): test MachineOperatorReducer for Float64Sub |
| 748 // TODO(titzer): test MachineOperatorReducer for Float64Mul | 749 // TODO(titzer): test MachineOperatorReducer for Float64Mul |
| 749 // TODO(titzer): test MachineOperatorReducer for Float64Div | 750 // TODO(titzer): test MachineOperatorReducer for Float64Div |
| 750 // TODO(titzer): test MachineOperatorReducer for Float64Mod | 751 // TODO(titzer): test MachineOperatorReducer for Float64Mod |
| 751 | 752 |
| 752 } // namespace compiler | 753 } // namespace compiler |
| 753 } // namespace internal | 754 } // namespace internal |
| 754 } // namespace v8 | 755 } // namespace v8 |
| OLD | NEW |