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 #ifndef V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
7 | 7 |
8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual Reduction Reduce(Node* node) OVERRIDE; | 27 virtual Reduction Reduce(Node* node) OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 Node* Float32Constant(volatile float value); | 30 Node* Float32Constant(volatile float value); |
31 Node* Float64Constant(volatile double value); | 31 Node* Float64Constant(volatile double value); |
32 Node* Int32Constant(int32_t value); | 32 Node* Int32Constant(int32_t value); |
33 Node* Int64Constant(int64_t value); | 33 Node* Int64Constant(int64_t value); |
34 Node* Uint32Constant(uint32_t value) { | 34 Node* Uint32Constant(uint32_t value) { |
35 return Int32Constant(bit_cast<uint32_t>(value)); | 35 return Int32Constant(bit_cast<uint32_t>(value)); |
36 } | 36 } |
| 37 Node* Word32And(Node* lhs, uint32_t rhs); |
| 38 Node* Word32Sar(Node* lhs, uint32_t rhs); |
| 39 Node* Word32Shr(Node* lhs, uint32_t rhs); |
| 40 Node* Int32Add(Node* lhs, Node* rhs); |
| 41 Node* Int32Sub(Node* lhs, Node* rhs); |
| 42 Node* Int32Mul(Node* lhs, Node* rhs); |
| 43 |
| 44 Node* TruncatingDiv(Node* dividend, int32_t divisor); |
37 | 45 |
38 Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); } | 46 Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); } |
39 Reduction ReplaceFloat32(volatile float value) { | 47 Reduction ReplaceFloat32(volatile float value) { |
40 return Replace(Float32Constant(value)); | 48 return Replace(Float32Constant(value)); |
41 } | 49 } |
42 Reduction ReplaceFloat64(volatile double value) { | 50 Reduction ReplaceFloat64(volatile double value) { |
43 return Replace(Float64Constant(value)); | 51 return Replace(Float64Constant(value)); |
44 } | 52 } |
45 Reduction ReplaceInt32(int32_t value) { | 53 Reduction ReplaceInt32(int32_t value) { |
46 return Replace(Int32Constant(value)); | 54 return Replace(Int32Constant(value)); |
47 } | 55 } |
48 Reduction ReplaceInt64(int64_t value) { | 56 Reduction ReplaceInt64(int64_t value) { |
49 return Replace(Int64Constant(value)); | 57 return Replace(Int64Constant(value)); |
50 } | 58 } |
51 | 59 |
| 60 Reduction ReduceInt32Div(Node* node); |
52 Reduction ReduceInt32Mod(Node* node); | 61 Reduction ReduceInt32Mod(Node* node); |
53 Reduction ReduceProjection(size_t index, Node* node); | 62 Reduction ReduceProjection(size_t index, Node* node); |
54 | 63 |
55 Graph* graph() const; | 64 Graph* graph() const; |
56 JSGraph* jsgraph() const { return jsgraph_; } | 65 JSGraph* jsgraph() const { return jsgraph_; } |
57 CommonOperatorBuilder* common() const; | 66 CommonOperatorBuilder* common() const; |
58 MachineOperatorBuilder* machine() const; | 67 MachineOperatorBuilder* machine() const; |
59 | 68 |
60 JSGraph* jsgraph_; | 69 JSGraph* jsgraph_; |
61 }; | 70 }; |
62 | 71 |
63 } // namespace compiler | 72 } // namespace compiler |
64 } // namespace internal | 73 } // namespace internal |
65 } // namespace v8 | 74 } // namespace v8 |
66 | 75 |
67 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ | 76 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
OLD | NEW |