diff options
Diffstat (limited to 'deps/v8/test/cctest/test-threads.cc')
-rw-r--r-- | deps/v8/test/cctest/test-threads.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/deps/v8/test/cctest/test-threads.cc b/deps/v8/test/cctest/test-threads.cc index 6cc5f52338..4709961636 100644 --- a/deps/v8/test/cctest/test-threads.cc +++ b/deps/v8/test/cctest/test-threads.cc @@ -34,21 +34,21 @@ TEST(Preemption) { - v8::Isolate* isolate = CcTest::default_isolate(); + v8::Isolate* isolate = CcTest::isolate(); v8::Locker locker(isolate); v8::V8::Initialize(); v8::HandleScope scope(isolate); v8::Handle<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope context_scope(context); - v8::Locker::StartPreemption(100); + v8::Locker::StartPreemption(isolate, 100); v8::Handle<v8::Script> script = v8::Script::Compile( v8::String::New("var count = 0; var obj = new Object(); count++;\n")); script->Run(); - v8::Locker::StopPreemption(); + v8::Locker::StopPreemption(isolate); v8::internal::OS::Sleep(500); // Make sure the timer fires. script->Run(); @@ -69,8 +69,9 @@ class ThreadA : public v8::internal::Thread { public: ThreadA() : Thread("ThreadA") { } void Run() { - v8::Isolate* isolate = CcTest::default_isolate(); + v8::Isolate* isolate = CcTest::isolate(); v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope scope(isolate); v8::Handle<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope context_scope(context); @@ -90,7 +91,7 @@ class ThreadA : public v8::internal::Thread { turn = CLEAN_CACHE; do { { - v8::Unlocker unlocker(CcTest::default_isolate()); + v8::Unlocker unlocker(CcTest::isolate()); Thread::YieldCPU(); } } while (turn != SECOND_TIME_FILL_CACHE); @@ -109,15 +110,16 @@ class ThreadB : public v8::internal::Thread { void Run() { do { { - v8::Isolate* isolate = CcTest::default_isolate(); + v8::Isolate* isolate = CcTest::isolate(); v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); if (turn == CLEAN_CACHE) { v8::HandleScope scope(isolate); v8::Handle<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope context_scope(context); // Clear the caches by forcing major GC. - HEAP->CollectAllGarbage(v8::internal::Heap::kNoGCFlags); + CcTest::heap()->CollectAllGarbage(v8::internal::Heap::kNoGCFlags); turn = SECOND_TIME_FILL_CACHE; break; } @@ -130,8 +132,6 @@ class ThreadB : public v8::internal::Thread { TEST(JSFunctionResultCachesInTwoThreads) { - v8::V8::Initialize(); - ThreadA threadA; ThreadB threadB; |