| 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_SIMPLIFIED_OPERATOR_REDUCER_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
| 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ | 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
| 7 | 7 |
| 8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 |
| 13 // Forward declarations. |
| 14 class TypeCache; |
| 15 |
| 12 namespace compiler { | 16 namespace compiler { |
| 13 | 17 |
| 14 // Forward declarations. | 18 // Forward declarations. |
| 15 class JSGraph; | 19 class JSGraph; |
| 16 class MachineOperatorBuilder; | 20 class MachineOperatorBuilder; |
| 17 class SimplifiedOperatorBuilder; | 21 class SimplifiedOperatorBuilder; |
| 18 | 22 |
| 19 | 23 |
| 20 class SimplifiedOperatorReducer final : public Reducer { | 24 class SimplifiedOperatorReducer final : public Reducer { |
| 21 public: | 25 public: |
| 22 explicit SimplifiedOperatorReducer(JSGraph* jsgraph); | 26 explicit SimplifiedOperatorReducer(JSGraph* jsgraph); |
| 23 ~SimplifiedOperatorReducer() final; | 27 ~SimplifiedOperatorReducer() final; |
| 24 | 28 |
| 25 Reduction Reduce(Node* node) final; | 29 Reduction Reduce(Node* node) final; |
| 26 | 30 |
| 27 private: | 31 private: |
| 32 Reduction ReduceNumberFloor(Node* node); |
| 28 Reduction ReduceReferenceEqual(Node* node); | 33 Reduction ReduceReferenceEqual(Node* node); |
| 29 | 34 |
| 30 Reduction Change(Node* node, const Operator* op, Node* a); | 35 Reduction Change(Node* node, const Operator* op, Node* a); |
| 31 Reduction ReplaceFloat64(double value); | 36 Reduction ReplaceFloat64(double value); |
| 32 Reduction ReplaceInt32(int32_t value); | 37 Reduction ReplaceInt32(int32_t value); |
| 33 Reduction ReplaceUint32(uint32_t value) { | 38 Reduction ReplaceUint32(uint32_t value) { |
| 34 return ReplaceInt32(bit_cast<int32_t>(value)); | 39 return ReplaceInt32(bit_cast<int32_t>(value)); |
| 35 } | 40 } |
| 36 Reduction ReplaceNumber(double value); | 41 Reduction ReplaceNumber(double value); |
| 37 Reduction ReplaceNumber(int32_t value); | 42 Reduction ReplaceNumber(int32_t value); |
| 38 | 43 |
| 39 Graph* graph() const; | 44 Graph* graph() const; |
| 40 JSGraph* jsgraph() const { return jsgraph_; } | 45 JSGraph* jsgraph() const { return jsgraph_; } |
| 41 MachineOperatorBuilder* machine() const; | 46 MachineOperatorBuilder* machine() const; |
| 42 SimplifiedOperatorBuilder* simplified() const; | 47 SimplifiedOperatorBuilder* simplified() const; |
| 43 | 48 |
| 44 JSGraph* const jsgraph_; | 49 JSGraph* const jsgraph_; |
| 50 TypeCache const& type_cache_; |
| 45 | 51 |
| 46 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorReducer); | 52 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorReducer); |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 } // namespace compiler | 55 } // namespace compiler |
| 50 } // namespace internal | 56 } // namespace internal |
| 51 } // namespace v8 | 57 } // namespace v8 |
| 52 | 58 |
| 53 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ | 59 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
| OLD | NEW |