Index: src/compiler/escape-analysis.h |
diff --git a/src/compiler/escape-analysis.h b/src/compiler/escape-analysis.h |
index 9a91d1a07a6b3a017462e5586e5a9d97247421da..1ba86da6a48614cc4ad08ca25889da664463e0ba 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 { |
@@ -110,6 +135,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 +150,7 @@ class EscapeAnalysis { |
Zone* const zone_; |
ZoneVector<VirtualState*> virtual_states_; |
EscapeStatusAnalysis escape_status_; |
+ MergeCache cache_; |
DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
}; |