• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 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_ESCAPE_ANALYSIS_REDUCER_H_
6 #define V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_
7 
8 #include "src/bit-vector.h"
9 #include "src/compiler/escape-analysis.h"
10 #include "src/compiler/graph-reducer.h"
11 
12 
13 namespace v8 {
14 namespace internal {
15 
16 // Forward declarations.
17 class Counters;
18 
19 
20 namespace compiler {
21 
22 // Forward declarations.
23 class JSGraph;
24 
25 
26 class EscapeAnalysisReducer final : public AdvancedReducer {
27  public:
28   EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph,
29                         EscapeAnalysis* escape_analysis, Zone* zone);
30 
31   Reduction Reduce(Node* node) final;
32 
33  private:
34   Reduction ReduceLoad(Node* node);
35   Reduction ReduceStore(Node* node);
36   Reduction ReduceAllocate(Node* node);
37   Reduction ReduceFinishRegion(Node* node);
38   Reduction ReduceReferenceEqual(Node* node);
39   Reduction ReduceObjectIsSmi(Node* node);
40   Reduction ReduceFrameStateUses(Node* node);
41   Node* ReduceFrameState(Node* node, Node* effect, bool multiple_users);
42   Node* ReduceStateValueInputs(Node* node, Node* effect, bool multiple_users);
43   Node* ReduceStateValueInput(Node* node, int node_index, Node* effect,
44                               bool multiple_users);
45 
jsgraph()46   JSGraph* jsgraph() const { return jsgraph_; }
escape_analysis()47   EscapeAnalysis* escape_analysis() const { return escape_analysis_; }
zone()48   Zone* zone() const { return zone_; }
49   Counters* counters() const;
50 
51   JSGraph* const jsgraph_;
52   EscapeAnalysis* escape_analysis_;
53   Zone* const zone_;
54   BitVector visited_;
55 
56   DISALLOW_COPY_AND_ASSIGN(EscapeAnalysisReducer);
57 };
58 
59 }  // namespace compiler
60 }  // namespace internal
61 }  // namespace v8
62 
63 #endif  // V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_
64