Index: src/compiler/escape-analysis.h |
diff --git a/src/compiler/escape-analysis.h b/src/compiler/escape-analysis.h |
index 9a91d1a07a6b3a017462e5586e5a9d97247421da..c798bd9f9ea2015ea9ef92f3e11b7bd90894f744 100644 |
--- a/src/compiler/escape-analysis.h |
+++ b/src/compiler/escape-analysis.h |
@@ -35,6 +35,7 @@ class EscapeStatusAnalysis { |
bool IsVirtual(Node* node); |
bool IsEscaped(Node* node); |
+ bool IsAllocation(Node* node); |
void DebugPrint(); |
@@ -73,6 +74,30 @@ class EscapeStatusAnalysis { |
DEFINE_OPERATORS_FOR_FLAGS(EscapeStatusAnalysis::EscapeStatusFlags) |
+class MergeCache { |
+ public: |
+ explicit MergeCache(Zone* zone) |
+ : states_(zone), objects_(zone), fields_(zone) { |
+ states_.reserve(4); |
+ objects_.reserve(4); |
+ fields_.reserve(4); |
+ } |
+ ZoneVector<VirtualState*>& states() { return states_; } |
+ ZoneVector<VirtualObject*>& objects() { return objects_; } |
+ ZoneVector<Node*>& fields() { return fields_; } |
+ void Clear() { |
+ states_.clear(); |
+ objects_.clear(); |
+ fields_.clear(); |
+ } |
+ |
+ private: |
+ ZoneVector<VirtualState*> states_; |
+ ZoneVector<VirtualObject*> objects_; |
+ ZoneVector<Node*> fields_; |
+}; |
+ |
+ |
// EscapeObjectAnalysis simulates stores to determine values of loads if |
// an object is virtual and eliminated. |
class EscapeAnalysis { |
@@ -85,6 +110,7 @@ class EscapeAnalysis { |
Node* GetReplacement(Node* at, NodeId id); |
bool IsVirtual(Node* node); |
bool IsEscaped(Node* node); |
+ bool IsAllocation(Node* node); |
private: |
void RunObjectAnalysis(); |
@@ -110,6 +136,8 @@ class EscapeAnalysis { |
VirtualObject* GetVirtualObject(Node* at, NodeId id); |
+ bool SetEscaped(Node* node); |
+ |
void DebugPrint(); |
void DebugPrintState(VirtualState* state); |
void DebugPrintObject(VirtualObject* state, NodeId id); |
@@ -123,6 +151,7 @@ class EscapeAnalysis { |
Zone* const zone_; |
ZoneVector<VirtualState*> virtual_states_; |
EscapeStatusAnalysis escape_status_; |
+ MergeCache cache_; |
DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
}; |