| OLD | NEW |
| 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 bool Run(); | 29 void Run(); |
| 30 | 30 |
| 31 Node* GetReplacement(Node* node); | 31 Node* GetReplacement(Node* node); |
| 32 bool IsVirtual(Node* node); | 32 bool IsVirtual(Node* node); |
| 33 bool IsEscaped(Node* node); | 33 bool IsEscaped(Node* node); |
| 34 bool CompareVirtualObjects(Node* left, Node* right); | 34 bool CompareVirtualObjects(Node* left, Node* right); |
| 35 Node* GetOrCreateObjectState(Node* effect, Node* node); | 35 Node* GetOrCreateObjectState(Node* effect, Node* node); |
| 36 bool IsCyclicObjectState(Node* effect, Node* node); | 36 bool IsCyclicObjectState(Node* effect, Node* node); |
| 37 bool ExistsVirtualAllocate(); | 37 bool ExistsVirtualAllocate(); |
| 38 bool SetReplacement(Node* node, Node* rep); | 38 bool SetReplacement(Node* node, Node* rep); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 void RunObjectAnalysis(); | 41 void RunObjectAnalysis(); |
| 42 bool Process(Node* node); | 42 bool Process(Node* node); |
| 43 void ProcessLoadField(Node* node); | 43 void ProcessLoadField(Node* node); |
| 44 void ProcessStoreField(Node* node); | 44 void ProcessStoreField(Node* node); |
| 45 void ProcessLoadElement(Node* node); | 45 void ProcessLoadElement(Node* node); |
| 46 void ProcessStoreElement(Node* node); | 46 void ProcessStoreElement(Node* node); |
| 47 void ProcessCheckMaps(Node* node); | |
| 48 void ProcessAllocationUsers(Node* node); | 47 void ProcessAllocationUsers(Node* node); |
| 49 void ProcessAllocation(Node* node); | 48 void ProcessAllocation(Node* node); |
| 50 void ProcessFinishRegion(Node* node); | 49 void ProcessFinishRegion(Node* node); |
| 51 void ProcessCall(Node* node); | 50 void ProcessCall(Node* node); |
| 52 void ProcessStart(Node* node); | 51 void ProcessStart(Node* node); |
| 53 bool ProcessEffectPhi(Node* node); | 52 bool ProcessEffectPhi(Node* node); |
| 54 void ProcessLoadFromPhi(int offset, Node* from, Node* node, | 53 void ProcessLoadFromPhi(int offset, Node* from, Node* node, |
| 55 VirtualState* states); | 54 VirtualState* states); |
| 56 | 55 |
| 57 void ForwardVirtualState(Node* node); | 56 void ForwardVirtualState(Node* node); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 82 MergeCache* cache_; | 81 MergeCache* cache_; |
| 83 | 82 |
| 84 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); | 83 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 } // namespace compiler | 86 } // namespace compiler |
| 88 } // namespace internal | 87 } // namespace internal |
| 89 } // namespace v8 | 88 } // namespace v8 |
| 90 | 89 |
| 91 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ | 90 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ |
| OLD | NEW |