Index: src/hydrogen-osr.h |
diff --git a/src/marking-thread.h b/src/hydrogen-osr.h |
similarity index 59% |
copy from src/marking-thread.h |
copy to src/hydrogen-osr.h |
index 9efa3af13262165972abf179defac6f83fed4ac9..0c6b65d0d4e55774f6408c9eb95f1149dce12a35 100644 |
--- a/src/marking-thread.h |
+++ b/src/hydrogen-osr.h |
@@ -25,47 +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_MARKING_THREAD_H_ |
-#define V8_MARKING_THREAD_H_ |
+#ifndef V8_HYDROGEN_OSR_H_ |
+#define V8_HYDROGEN_OSR_H_ |
-#include "atomicops.h" |
-#include "flags.h" |
-#include "platform.h" |
-#include "v8utils.h" |
- |
-#include "spaces.h" |
- |
-#include "heap.h" |
+#include "hydrogen.h" |
+#include "ast.h" |
+#include "zone.h" |
namespace v8 { |
namespace internal { |
-class MarkingThread : public Thread { |
+// 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 MarkingThread(Isolate* isolate); |
+ 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); |
- void Run(); |
- void Stop(); |
- void StartMarking(); |
- void WaitForMarkingThread(); |
+ // Process the hydrogen graph after it has been completed, performing |
+ // any OSR-specific cleanups or changes. |
+ void FinishGraph(); |
- ~MarkingThread() { |
- delete start_marking_semaphore_; |
- delete end_marking_semaphore_; |
- delete stop_semaphore_; |
- } |
+ // Process the OSR values and phis after initial graph optimization. |
+ void FinishOsrValues(); |
private: |
- Isolate* isolate_; |
- Heap* heap_; |
- Semaphore* start_marking_semaphore_; |
- Semaphore* end_marking_semaphore_; |
- Semaphore* stop_semaphore_; |
- volatile AtomicWord stop_thread_; |
- int id_; |
- static Atomic32 id_counter_; |
+ HBasicBlock* BuildLoopEntry(); |
+ bool HasOsrEntryAt(IterationStatement* statement); |
+ |
+ HOptimizedGraphBuilder* builder_; |
+ HBasicBlock* osr_entry_; |
+ HBasicBlock* osr_loop_entry_; |
+ ZoneList<HUnknownOSRValue*>* osr_values_; |
}; |
} } // namespace v8::internal |
-#endif // V8_MARKING_THREAD_H_ |
+#endif // V8_HYDROGEN_OSR_H_ |