/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#if ENABLE(DFG_JIT)
+#include "DFGBasicBlock.h"
#include "DFGCommon.h"
namespace JSC { namespace DFG {
class Graph;
// Computes BasicBlock::ssa->availabiltiyAtHead/Tail. This is a forward flow type inference
-// over MovHints and SetLocals.
+// over MovHints and SetLocals. This analysis is run directly by the Plan for preparing for
+// lowering to LLVM IR, but it can also be used as a utility. Note that if you run it before
+// stack layout, all of the flush availability will omit the virtual register - but it will
+// tell you the format.
bool performOSRAvailabilityAnalysis(Graph&);
+// Local calculator for figuring out the availability at any node in a basic block. Requires
+// having run the availability analysis.
+class LocalOSRAvailabilityCalculator {
+public:
+ LocalOSRAvailabilityCalculator();
+ ~LocalOSRAvailabilityCalculator();
+
+ void beginBlock(BasicBlock*);
+ void endBlock(BasicBlock*); // Useful if you want to get data for the end of the block. You don't need to call this if you did beginBlock() and then executeNode() for every node.
+ void executeNode(Node*);
+
+ AvailabilityMap m_availability;
+};
+
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)