summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-threads.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-10 02:02:27 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-11 02:40:36 +0100
commitf230a1cf749e984439b5bb9729d9db9f48472827 (patch)
tree153596de2251b717ad79823f23fabf4c140d6d35 /deps/v8/test/cctest/test-threads.cc
parenta12870c823b9b67110b27a470fcac342cf1dfbd6 (diff)
downloadnode-new-f230a1cf749e984439b5bb9729d9db9f48472827.tar.gz
v8: upgrade to 3.22.24
This commit removes the simple/test-event-emitter-memory-leak test for being unreliable with the new garbage collector: the memory pressure exerted by the test case is too low for the garbage collector to kick in. It can be made to work again by limiting the heap size with the --max_old_space_size=x flag but that won't be very reliable across platforms and architectures.
Diffstat (limited to 'deps/v8/test/cctest/test-threads.cc')
-rw-r--r--deps/v8/test/cctest/test-threads.cc18
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;