Index: src/compiler/escape-analysis.h |
diff --git a/src/compiler/escape-analysis.h b/src/compiler/escape-analysis.h |
index c3f236d556b73942f6c4a0c7227d5af599766263..075083f9802ea77f2e49810fdca5c8cb117cb5e5 100644 |
--- a/src/compiler/escape-analysis.h |
+++ b/src/compiler/escape-analysis.h |
@@ -12,6 +12,42 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
+class EscapeAnalysisStats { |
+ public: |
+ EscapeAnalysisStats() |
+ : initialNodeCount_(0), |
+ discoverStackMaxSize_(0), |
+ discoverStackCapacity_(0), |
+ aliasCount_(0), |
+ virtualObjectCount_(0), |
+ virtualStateCount_(0), |
+ fieldCount_(0), |
+ mergePhiCount_(0), |
+ loadPhiCount_(0), |
+ objectDequeueCapacity_(0), |
+ effectNodeCount_(0), |
+ objectStatesCreated_(0), |
+ allocateNonVirtual_(0), |
+ effectPhiCount_(0) {} |
+ |
+ void Print(); |
+ |
+ size_t initialNodeCount_; |
+ size_t discoverStackMaxSize_; |
+ size_t discoverStackCapacity_; |
+ size_t aliasCount_; |
+ size_t virtualObjectCount_; |
+ size_t virtualStateCount_; |
+ size_t fieldCount_; |
+ size_t mergePhiCount_; |
+ size_t loadPhiCount_; |
+ size_t objectDequeueCapacity_; |
+ size_t effectNodeCount_; |
+ size_t objectStatesCreated_; |
+ size_t allocateNonVirtual_; |
+ size_t effectPhiCount_; |
+}; |
+ |
// Forward declarations. |
class CommonOperatorBuilder; |
class EscapeAnalysis; |
@@ -114,6 +150,7 @@ class MergeCache; |
// an object is virtual and eliminated. |
class EscapeAnalysis { |
public: |
+ static EscapeAnalysisStats stats; |
using Alias = EscapeStatusAnalysis::Alias; |
EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); |
~EscapeAnalysis(); |
@@ -126,6 +163,7 @@ class EscapeAnalysis { |
bool CompareVirtualObjects(Node* left, Node* right); |
Node* GetOrCreateObjectState(Node* effect, Node* node); |
bool ExistsVirtualAllocate(); |
+ static void PrintStats() { stats.Print(); } |
private: |
void RunObjectAnalysis(); |
@@ -140,7 +178,7 @@ class EscapeAnalysis { |
void ProcessCall(Node* node); |
void ProcessStart(Node* node); |
bool ProcessEffectPhi(Node* node); |
- void ProcessLoadFromPhi(int offset, Node* from, Node* node, |
+ void ProcessLoadFromPhi(int offset, Node* from, Node* load, |
VirtualState* states); |
void ForwardVirtualState(Node* node); |
@@ -184,6 +222,10 @@ class EscapeAnalysis { |
ZoneVector<VirtualState*> virtual_states_; |
ZoneVector<Node*> replacements_; |
MergeCache* cache_; |
+ typedef std::map<NodeId, VirtualObject*, std::less<NodeId>, |
+ zone_allocator<std::pair<const NodeId, VirtualObject*> > > |
+ PhiObjectMap; |
+ PhiObjectMap phi_map_; |
DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
}; |