OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 27 matching lines...) Expand all Loading... |
38 class HEscapeAnalysisPhase : public HPhase { | 38 class HEscapeAnalysisPhase : public HPhase { |
39 public: | 39 public: |
40 explicit HEscapeAnalysisPhase(HGraph* graph) | 40 explicit HEscapeAnalysisPhase(HGraph* graph) |
41 : HPhase("H_Escape analysis", graph), | 41 : HPhase("H_Escape analysis", graph), |
42 captured_(0, zone()), | 42 captured_(0, zone()), |
43 number_of_objects_(0), | 43 number_of_objects_(0), |
44 number_of_values_(0), | 44 number_of_values_(0), |
45 cumulative_values_(0), | 45 cumulative_values_(0), |
46 block_states_(graph->blocks()->length(), zone()) { } | 46 block_states_(graph->blocks()->length(), zone()) { } |
47 | 47 |
48 void Run() { | 48 void Run(); |
49 CollectCapturedValues(); | |
50 PerformScalarReplacement(); | |
51 } | |
52 | 49 |
53 private: | 50 private: |
54 void CollectCapturedValues(); | 51 void CollectCapturedValues(); |
55 bool HasNoEscapingUses(HValue* value); | 52 bool HasNoEscapingUses(HValue* value); |
56 void PerformScalarReplacement(); | 53 void PerformScalarReplacement(); |
57 void AnalyzeDataFlow(HInstruction* instr); | 54 void AnalyzeDataFlow(HInstruction* instr); |
58 | 55 |
59 HCapturedObject* NewState(HInstruction* prev); | 56 HCapturedObject* NewState(HInstruction* prev); |
60 HCapturedObject* NewStateForAllocation(HInstruction* prev); | 57 HCapturedObject* NewStateForAllocation(HInstruction* prev); |
61 HCapturedObject* NewStateForLoopHeader(HInstruction* prev, HCapturedObject*); | 58 HCapturedObject* NewStateForLoopHeader(HInstruction* prev, HCapturedObject*); |
(...skipping 23 matching lines...) Expand all Loading... |
85 | 82 |
86 // Map of block IDs to the data-flow state at block entry during the | 83 // Map of block IDs to the data-flow state at block entry during the |
87 // scalar replacement phase. | 84 // scalar replacement phase. |
88 ZoneList<HCapturedObject*> block_states_; | 85 ZoneList<HCapturedObject*> block_states_; |
89 }; | 86 }; |
90 | 87 |
91 | 88 |
92 } } // namespace v8::internal | 89 } } // namespace v8::internal |
93 | 90 |
94 #endif // V8_HYDROGEN_ESCAPE_ANALYSIS_H_ | 91 #endif // V8_HYDROGEN_ESCAPE_ANALYSIS_H_ |
OLD | NEW |