OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_COMPILER_INT64_REDUCER_H_ |
| 6 #define V8_COMPILER_INT64_REDUCER_H_ |
| 7 |
| 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/graph.h" |
| 10 #include "src/compiler/machine-operator.h" |
| 11 #include "src/compiler/node-marker.h" |
| 12 #include "src/zone-containers.h" |
| 13 |
| 14 namespace v8 { |
| 15 namespace internal { |
| 16 namespace compiler { |
| 17 |
| 18 class Int64Lowering { |
| 19 public: |
| 20 Int64Lowering(Graph* graph, MachineOperatorBuilder* machine, |
| 21 CommonOperatorBuilder* common, Zone* zone); |
| 22 |
| 23 void ReduceGraph(); |
| 24 Graph* graph() const { return graph_; } |
| 25 MachineOperatorBuilder* machine() const { return machine_; } |
| 26 CommonOperatorBuilder* common() const { return common_; } |
| 27 |
| 28 private: |
| 29 enum class State : uint8_t { kUnvisited, kOnStack, kInputsPushed, kVisited }; |
| 30 |
| 31 struct Replacement { |
| 32 Node* low; |
| 33 Node* high; |
| 34 }; |
| 35 |
| 36 void ReduceTop(); |
| 37 void ReduceNode(Node* node); |
| 38 |
| 39 Graph* const graph_; |
| 40 MachineOperatorBuilder* machine_; |
| 41 CommonOperatorBuilder* common_; |
| 42 NodeMarker<State> state_; |
| 43 ZoneStack<Node*> stack_; |
| 44 Replacement* replacements_; |
| 45 }; |
| 46 |
| 47 } // namespace compiler |
| 48 } // namespace internal |
| 49 } // namespace v8 |
| 50 |
| 51 #endif // V8_COMPILER_INT64_REDUCER_H_ |
OLD | NEW |