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

Unified Diff: src/compiler/escape-analysis.h

Issue 1491903002: [turbofan] Refactor escape analysis to only expose one class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ensure only EscapeAnalysis can create EscapeStatusAnalysis Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/escape-analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/escape-analysis.h
diff --git a/src/compiler/escape-analysis.h b/src/compiler/escape-analysis.h
index 78bba502343bf740374f672fa3b8dd2a5232f67b..ce372b598ade5262a80e328f6d184b94ba6dc029 100644
--- a/src/compiler/escape-analysis.h
+++ b/src/compiler/escape-analysis.h
@@ -14,15 +14,13 @@ namespace compiler {
// Forward declarations.
class CommonOperatorBuilder;
-class EscapeObjectAnalysis;
+class EscapeAnalysis;
class VirtualState;
// EscapeStatusAnalysis determines for each allocation whether it escapes.
class EscapeStatusAnalysis {
public:
- EscapeStatusAnalysis(EscapeObjectAnalysis* object_analysis, Graph* graph,
- Zone* zone);
~EscapeStatusAnalysis();
enum EscapeStatusFlag {
@@ -34,13 +32,16 @@ class EscapeStatusAnalysis {
void Run();
- bool HasEntry(Node* node);
bool IsVirtual(Node* node);
bool IsEscaped(Node* node);
void DebugPrint();
+ friend class EscapeAnalysis;
+
private:
+ EscapeStatusAnalysis(EscapeAnalysis* object_analysis, Graph* graph,
+ Zone* zone);
void Process(Node* node);
void ProcessAllocate(Node* node);
void ProcessFinishRegion(Node* node);
@@ -50,11 +51,12 @@ class EscapeStatusAnalysis {
void RevisitUses(Node* node);
void RevisitInputs(Node* node);
bool SetEscaped(Node* node);
+ bool HasEntry(Node* node);
Graph* graph() const { return graph_; }
Zone* zone() const { return zone_; }
- EscapeObjectAnalysis* object_analysis_;
+ EscapeAnalysis* object_analysis_;
Graph* const graph_;
Zone* const zone_;
ZoneVector<EscapeStatusFlags> info_;
@@ -69,16 +71,19 @@ DEFINE_OPERATORS_FOR_FLAGS(EscapeStatusAnalysis::EscapeStatusFlags)
// EscapeObjectAnalysis simulates stores to determine values of loads if
// an object is virtual and eliminated.
-class EscapeObjectAnalysis {
+class EscapeAnalysis {
public:
- EscapeObjectAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone);
- ~EscapeObjectAnalysis();
+ EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone);
+ ~EscapeAnalysis();
void Run();
Node* GetReplacement(Node* at, NodeId id);
+ bool IsVirtual(Node* node);
+ bool IsEscaped(Node* node);
private:
+ void RunObjectAnalysis();
bool Process(Node* node);
void ProcessLoadField(Node* node);
void ProcessStoreField(Node* node);
@@ -102,8 +107,9 @@ class EscapeObjectAnalysis {
CommonOperatorBuilder* const common_;
Zone* const zone_;
ZoneVector<VirtualState*> virtual_states_;
+ EscapeStatusAnalysis escape_status_;
- DISALLOW_COPY_AND_ASSIGN(EscapeObjectAnalysis);
+ DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis);
};
} // namespace compiler
« 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