Chromium Code Reviews| 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.h" | |
| 12 #include "src/compiler/node-marker.h" | |
| 13 #include "src/zone-containers.h" | |
| 14 | |
| 15 namespace v8 { | |
| 16 namespace internal { | |
| 17 namespace compiler { | |
| 18 | |
| 19 class Int64Reducer { | |
|
titzer
2016/02/02 10:14:35
Let's call this Int64Lowering.
| |
| 20 public: | |
| 21 Int64Reducer(Graph* graph, MachineOperatorBuilder* machine, | |
| 22 CommonOperatorBuilder* common, Zone* zone); | |
| 23 | |
| 24 void ReduceGraph(); | |
| 25 Graph* graph() const { return graph_; } | |
| 26 MachineOperatorBuilder* machine() const { return machine_; } | |
| 27 CommonOperatorBuilder* common() const { return common_; } | |
| 28 | |
| 29 private: | |
| 30 enum class State : uint8_t { | |
| 31 kUnvisited, | |
| 32 kOnStack, | |
| 33 kInputsPushed, | |
| 34 kVisited | |
| 35 }; | |
| 36 | |
| 37 struct Replacement { | |
| 38 Node* low; | |
| 39 Node* high; | |
| 40 }; | |
| 41 | |
| 42 void ReduceTop(); | |
| 43 void ReduceNode(Node* node); | |
| 44 | |
| 45 Graph* const graph_; | |
| 46 MachineOperatorBuilder* machine_; | |
| 47 CommonOperatorBuilder* common_; | |
| 48 NodeMarker<State> state_; | |
| 49 ZoneStack<Node*> stack_; | |
| 50 Replacement* replacements_; | |
| 51 }; | |
| 52 | |
| 53 } // namespace compiler | |
| 54 } // namespace internal | |
| 55 } // namespace v8 | |
| 56 | |
| 57 #endif // V8_COMPILER_INT64_REDUCER_H_ | |
| OLD | NEW |