Commit 3c625453 authored by jochen@chromium.org's avatar jochen@chromium.org

Move libplatform files into v8::platform namespace

BUG=none
R=jkummerow@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/336313017

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22107 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9acb3bcb
......@@ -12,7 +12,7 @@
#include "src/libplatform/worker-thread.h"
namespace v8 {
namespace internal {
namespace platform {
const int DefaultPlatform::kMaxThreadPoolSize = 4;
......@@ -66,4 +66,4 @@ void DefaultPlatform::CallOnForegroundThread(v8::Isolate* isolate, Task* task) {
delete task;
}
} } // namespace v8::internal
} } // namespace v8::platform
......@@ -13,7 +13,7 @@
#include "src/libplatform/task-queue.h"
namespace v8 {
namespace internal {
namespace platform {
class TaskQueue;
class Thread;
......@@ -47,7 +47,7 @@ class DefaultPlatform : public Platform {
};
} } // namespace v8::internal
} } // namespace v8::platform
#endif // V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
......@@ -7,7 +7,7 @@
#include "src/base/logging.h"
namespace v8 {
namespace internal {
namespace platform {
TaskQueue::TaskQueue() : process_queue_semaphore_(0), terminated_(false) {}
......@@ -53,4 +53,4 @@ void TaskQueue::Terminate() {
process_queue_semaphore_.Signal();
}
} } // namespace v8::internal
} } // namespace v8::platform
......@@ -15,7 +15,7 @@ namespace v8 {
class Task;
namespace internal {
namespace platform {
class TaskQueue {
public:
......@@ -41,7 +41,7 @@ class TaskQueue {
DISALLOW_COPY_AND_ASSIGN(TaskQueue);
};
} } // namespace v8::internal
} } // namespace v8::platform
#endif // V8_LIBPLATFORM_TASK_QUEUE_H_
......@@ -8,7 +8,7 @@
#include "src/libplatform/task-queue.h"
namespace v8 {
namespace internal {
namespace platform {
WorkerThread::WorkerThread(TaskQueue* queue)
: Thread("V8 WorkerThread"), queue_(queue) {
......@@ -28,4 +28,4 @@ void WorkerThread::Run() {
}
}
} } // namespace v8::internal
} } // namespace v8::platform
......@@ -12,7 +12,7 @@
namespace v8 {
namespace internal {
namespace platform {
class TaskQueue;
......@@ -32,7 +32,7 @@ class WorkerThread : public base::Thread {
DISALLOW_COPY_AND_ASSIGN(WorkerThread);
};
} } // namespace v8::internal
} } // namespace v8::platform
#endif // V8_LIBPLATFORM_WORKER_THREAD_H_
......@@ -42,7 +42,8 @@ bool V8::Initialize(Deserializer* des) {
if (isolate->IsInitialized()) return true;
#ifdef V8_USE_DEFAULT_PLATFORM
DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_);
platform::DefaultPlatform* platform =
static_cast<platform::DefaultPlatform*>(platform_);
platform->SetThreadPoolSize(isolate->max_available_threads());
// We currently only start the threads early, if we know that we'll use them.
if (FLAG_job_based_sweeping) platform->EnsureInitialized();
......@@ -63,7 +64,8 @@ void V8::TearDown() {
Sampler::TearDown();
#ifdef V8_USE_DEFAULT_PLATFORM
DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_);
platform::DefaultPlatform* platform =
static_cast<platform::DefaultPlatform*>(platform_);
platform_ = NULL;
delete platform;
#endif
......@@ -93,7 +95,7 @@ void V8::InitializeOncePerProcessImpl() {
base::OS::Initialize(FLAG_random_seed, FLAG_hard_abort, FLAG_gc_fake_mmap);
#ifdef V8_USE_DEFAULT_PLATFORM
platform_ = new DefaultPlatform;
platform_ = new platform::DefaultPlatform;
#endif
Sampler::SetUp();
CpuFeatures::Probe(false);
......
......@@ -32,6 +32,7 @@
#include "test/cctest/test-libplatform.h"
using namespace v8::internal;
using namespace v8::platform;
TEST(TaskQueueBasic) {
......
......@@ -33,6 +33,7 @@
#include "test/cctest/test-libplatform.h"
using namespace v8::internal;
using namespace v8::platform;
TEST(WorkerThread) {
......
......@@ -33,6 +33,7 @@
#include "test/cctest/cctest.h"
using namespace v8::internal;
using namespace v8::platform;
class TaskCounter {
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment