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_VALUE_NUMBERING_REDUCER_H_ | 5 #ifndef V8_COMPILER_VALUE_NUMBERING_REDUCER_H_ |
6 #define V8_COMPILER_VALUE_NUMBERING_REDUCER_H_ | 6 #define V8_COMPILER_VALUE_NUMBERING_REDUCER_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace compiler { | 14 namespace compiler { |
15 | 15 |
16 class V8_EXPORT_PRIVATE ValueNumberingReducer final | 16 class V8_EXPORT_PRIVATE ValueNumberingReducer final |
17 : public NON_EXPORTED_BASE(Reducer) { | 17 : public NON_EXPORTED_BASE(Reducer) { |
18 public: | 18 public: |
19 explicit ValueNumberingReducer(Zone* temp_zone, Zone* graph_zone); | 19 explicit ValueNumberingReducer(Zone* temp_zone, Zone* graph_zone); |
20 ~ValueNumberingReducer(); | 20 ~ValueNumberingReducer(); |
21 | 21 |
22 Reduction Reduce(Node* node) override; | 22 Reduction Reduce(Node* node) override; |
23 | 23 |
24 private: | 24 private: |
25 enum { kInitialCapacity = 256u, kCapacityToSizeRatio = 2u }; | 25 enum { kInitialCapacity = 256u }; |
26 | 26 |
27 void Grow(); | 27 void Grow(); |
28 Zone* temp_zone() const { return temp_zone_; } | 28 Zone* temp_zone() const { return temp_zone_; } |
29 Zone* graph_zone() const { return graph_zone_; } | 29 Zone* graph_zone() const { return graph_zone_; } |
30 | 30 |
31 Node** entries_; | 31 Node** entries_; |
32 size_t capacity_; | 32 size_t capacity_; |
33 size_t size_; | 33 size_t size_; |
34 Zone* temp_zone_; | 34 Zone* temp_zone_; |
35 Zone* graph_zone_; | 35 Zone* graph_zone_; |
36 }; | 36 }; |
37 | 37 |
38 } // namespace compiler | 38 } // namespace compiler |
39 } // namespace internal | 39 } // namespace internal |
40 } // namespace v8 | 40 } // namespace v8 |
41 | 41 |
42 #endif // V8_COMPILER_VALUE_NUMBERING_REDUCER_H_ | 42 #endif // V8_COMPILER_VALUE_NUMBERING_REDUCER_H_ |
OLD | NEW |