Index: src/libplatform/worker-thread.cc |
diff --git a/src/hydrogen-bch.h b/src/libplatform/worker-thread.cc |
similarity index 79% |
copy from src/hydrogen-bch.h |
copy to src/libplatform/worker-thread.cc |
index a22dacdd4229748e2735b3c0d8519c927b2f617d..cca8a9719a88d953a9d05d770e5aa6478a563e6a 100644 |
--- a/src/hydrogen-bch.h |
+++ b/src/libplatform/worker-thread.cc |
@@ -25,31 +25,32 @@ |
// (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_BCH_H_ |
-#define V8_HYDROGEN_BCH_H_ |
+#include "worker-thread.h" |
-#include "hydrogen.h" |
+// TODO(jochen): We should have our own version of checks.h. |
+#include "../checks.h" |
+#include "../../include/v8-platform.h" |
+#include "task-queue.h" |
namespace v8 { |
namespace internal { |
+WorkerThread::WorkerThread(TaskQueue* queue) |
+ : Thread("V8 WorkerThread"), queue_(queue) { |
+ Start(); |
+} |
-class HBoundsCheckHoistingPhase : public HPhase { |
- public: |
- explicit HBoundsCheckHoistingPhase(HGraph* graph) |
- : HPhase("H_Bounds checks hoisting", graph) { } |
- void Run() { |
- HoistRedundantBoundsChecks(); |
- } |
- |
- private: |
- void HoistRedundantBoundsChecks(); |
+WorkerThread::~WorkerThread() { |
+ Join(); |
+} |
- DISALLOW_COPY_AND_ASSIGN(HBoundsCheckHoistingPhase); |
-}; |
+void WorkerThread::Run() { |
+ while (Task* task = queue_->GetNext()) { |
+ task->Run(); |
+ delete task; |
+ } |
+} |
} } // namespace v8::internal |
- |
-#endif // V8_HYDROGEN_BCE_H_ |