Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: src/hydrogen-osr.h

Issue 18496002: Factor out OSR-related graph-building functionality from hydrogen.cc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extract HOsrBuilder declaration to its own header file. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-osr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-osr.h
diff --git a/src/hydrogen-uint32-analysis.h b/src/hydrogen-osr.h
similarity index 60%
copy from src/hydrogen-uint32-analysis.h
copy to src/hydrogen-osr.h
index 59739d1ccf13ffc428996432417019a8a84c2829..0c6b65d0d4e55774f6408c9eb95f1149dce12a35 100644
--- a/src/hydrogen-uint32-analysis.h
+++ b/src/hydrogen-osr.h
@@ -25,35 +25,46 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_HYDROGEN_UINT32_ANALYSIS_H_
-#define V8_HYDROGEN_UINT32_ANALYSIS_H_
+#ifndef V8_HYDROGEN_OSR_H_
+#define V8_HYDROGEN_OSR_H_
#include "hydrogen.h"
+#include "ast.h"
+#include "zone.h"
namespace v8 {
namespace internal {
-
-// Discover instructions that can be marked with kUint32 flag allowing
-// them to produce full range uint32 values.
-class HUint32AnalysisPhase : public HPhase {
+// Responsible for building graph parts related to OSR and otherwise
+// setting up the graph to do an OSR compile.
+class HOsrBuilder : public ZoneObject {
public:
- explicit HUint32AnalysisPhase(HGraph* graph)
- : HPhase("H_Compute safe UInt32 operations", graph), phis_(4, zone()) { }
+ explicit HOsrBuilder(HOptimizedGraphBuilder* builder)
+ : builder_(builder),
+ osr_entry_(NULL),
+ osr_loop_entry_(NULL),
+ osr_values_(NULL) { }
+ // Creates the loop entry block for the given statement, setting up OSR
+ // entries as necessary, and sets the current block to the new block.
+ HBasicBlock* BuildPossibleOsrLoopEntry(IterationStatement* statement);
+
+ // Process the hydrogen graph after it has been completed, performing
+ // any OSR-specific cleanups or changes.
+ void FinishGraph();
- void Run();
+ // Process the OSR values and phis after initial graph optimization.
+ void FinishOsrValues();
private:
- INLINE(bool IsSafeUint32Use(HValue* val, HValue* use));
- INLINE(bool Uint32UsesAreSafe(HValue* uint32val));
- INLINE(bool CheckPhiOperands(HPhi* phi));
- INLINE(void UnmarkPhi(HPhi* phi, ZoneList<HPhi*>* worklist));
- INLINE(void UnmarkUnsafePhis());
+ HBasicBlock* BuildLoopEntry();
+ bool HasOsrEntryAt(IterationStatement* statement);
- ZoneList<HPhi*> phis_;
+ HOptimizedGraphBuilder* builder_;
+ HBasicBlock* osr_entry_;
+ HBasicBlock* osr_loop_entry_;
+ ZoneList<HUnknownOSRValue*>* osr_values_;
};
-
} } // namespace v8::internal
-#endif // V8_HYDROGEN_UINT32_ANALYSIS_H_
+#endif // V8_HYDROGEN_OSR_H_
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698