Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: src/compiler/escape-analysis.h

Issue 2701403003: [turbofan] escape analysis bugfixes that got reverted with https://codereview.chromium.org/26809730… (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/escape-analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 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_ESCAPE_ANALYSIS_H_ 5 #ifndef V8_COMPILER_ESCAPE_ANALYSIS_H_
6 #define V8_COMPILER_ESCAPE_ANALYSIS_H_ 6 #define V8_COMPILER_ESCAPE_ANALYSIS_H_
7 7
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 // Forward declarations. 15 // Forward declarations.
16 class CommonOperatorBuilder; 16 class CommonOperatorBuilder;
17 class EscapeStatusAnalysis; 17 class EscapeStatusAnalysis;
18 class MergeCache; 18 class MergeCache;
19 class VirtualState; 19 class VirtualState;
20 class VirtualObject; 20 class VirtualObject;
21 21
22 // EscapeObjectAnalysis simulates stores to determine values of loads if 22 // EscapeObjectAnalysis simulates stores to determine values of loads if
23 // an object is virtual and eliminated. 23 // an object is virtual and eliminated.
24 class V8_EXPORT_PRIVATE EscapeAnalysis { 24 class V8_EXPORT_PRIVATE EscapeAnalysis {
25 public: 25 public:
26 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); 26 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone);
27 ~EscapeAnalysis(); 27 ~EscapeAnalysis();
28 28
29 void Run(); 29 bool Run();
30 30
31 Node* GetReplacement(Node* node); 31 Node* GetReplacement(Node* node);
32 Node* ResolveReplacement(Node* node);
32 bool IsVirtual(Node* node); 33 bool IsVirtual(Node* node);
33 bool IsEscaped(Node* node); 34 bool IsEscaped(Node* node);
34 bool CompareVirtualObjects(Node* left, Node* right); 35 bool CompareVirtualObjects(Node* left, Node* right);
35 Node* GetOrCreateObjectState(Node* effect, Node* node); 36 Node* GetOrCreateObjectState(Node* effect, Node* node);
36 bool IsCyclicObjectState(Node* effect, Node* node); 37 bool IsCyclicObjectState(Node* effect, Node* node);
37 bool ExistsVirtualAllocate(); 38 bool ExistsVirtualAllocate();
38 bool SetReplacement(Node* node, Node* rep); 39 bool SetReplacement(Node* node, Node* rep);
39 40
40 private: 41 private:
41 void RunObjectAnalysis(); 42 void RunObjectAnalysis();
(...skipping 10 matching lines...) Expand all
52 bool ProcessEffectPhi(Node* node); 53 bool ProcessEffectPhi(Node* node);
53 void ProcessLoadFromPhi(int offset, Node* from, Node* node, 54 void ProcessLoadFromPhi(int offset, Node* from, Node* node,
54 VirtualState* states); 55 VirtualState* states);
55 56
56 void ForwardVirtualState(Node* node); 57 void ForwardVirtualState(Node* node);
57 VirtualState* CopyForModificationAt(VirtualState* state, Node* node); 58 VirtualState* CopyForModificationAt(VirtualState* state, Node* node);
58 VirtualObject* CopyForModificationAt(VirtualObject* obj, VirtualState* state, 59 VirtualObject* CopyForModificationAt(VirtualObject* obj, VirtualState* state,
59 Node* node); 60 Node* node);
60 61
61 Node* replacement(Node* node); 62 Node* replacement(Node* node);
62 Node* ResolveReplacement(Node* node);
63 bool UpdateReplacement(VirtualState* state, Node* node, Node* rep); 63 bool UpdateReplacement(VirtualState* state, Node* node, Node* rep);
64 64
65 VirtualObject* GetVirtualObject(VirtualState* state, Node* node); 65 VirtualObject* GetVirtualObject(VirtualState* state, Node* node);
66 66
67 void DebugPrint(); 67 void DebugPrint();
68 void DebugPrintState(VirtualState* state); 68 void DebugPrintState(VirtualState* state);
69 69
70 Graph* graph() const; 70 Graph* graph() const;
71 Zone* zone() const { return zone_; } 71 Zone* zone() const { return zone_; }
72 CommonOperatorBuilder* common() const { return common_; } 72 CommonOperatorBuilder* common() const { return common_; }
73 73
74 Zone* const zone_; 74 Zone* const zone_;
75 Node* const slot_not_analyzed_; 75 Node* const slot_not_analyzed_;
76 CommonOperatorBuilder* const common_; 76 CommonOperatorBuilder* const common_;
77 EscapeStatusAnalysis* status_analysis_; 77 EscapeStatusAnalysis* status_analysis_;
78 ZoneVector<VirtualState*> virtual_states_; 78 ZoneVector<VirtualState*> virtual_states_;
79 ZoneVector<Node*> replacements_; 79 ZoneVector<Node*> replacements_;
80 ZoneSet<VirtualObject*> cycle_detection_; 80 ZoneSet<VirtualObject*> cycle_detection_;
81 MergeCache* cache_; 81 MergeCache* cache_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); 83 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis);
84 }; 84 };
85 85
86 } // namespace compiler 86 } // namespace compiler
87 } // namespace internal 87 } // namespace internal
88 } // namespace v8 88 } // namespace v8
89 89
90 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ 90 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698