| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 6449594be4a5dcb4377906e9e969b78c8b061472..afebb1c403d316da7e0366eb7a8d445a17c83f4f 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -11013,7 +11013,7 @@ void ApiTestFuzzer::Run() {
|
| gate_->Wait();
|
| {
|
| // ... get the V8 lock and start running the test.
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| CallTest();
|
| }
|
| // This test finished.
|
| @@ -11077,7 +11077,7 @@ void ApiTestFuzzer::ContextSwitch() {
|
| // If the new thread is the same as the current thread there is nothing to do.
|
| if (NextThread()) {
|
| // Now it can start.
|
| - v8::Unlocker unlocker;
|
| + v8::Unlocker unlocker(CcTest::default_isolate());
|
| // Wait till someone starts us again.
|
| gate_->Wait();
|
| // And we're off.
|
| @@ -11129,12 +11129,12 @@ void ApiTestFuzzer::CallTest() {
|
|
|
|
|
| static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) {
|
| - CHECK(v8::Locker::IsLocked());
|
| + CHECK(v8::Locker::IsLocked(CcTest::default_isolate()));
|
| ApiTestFuzzer::Fuzz();
|
| - v8::Unlocker unlocker;
|
| + v8::Unlocker unlocker(CcTest::default_isolate());
|
| const char* code = "throw 7;";
|
| {
|
| - v8::Locker nested_locker;
|
| + v8::Locker nested_locker(CcTest::default_isolate());
|
| v8::HandleScope scope;
|
| v8::Handle<Value> exception;
|
| { v8::TryCatch try_catch;
|
| @@ -11152,12 +11152,12 @@ static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) {
|
|
|
|
|
| static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) {
|
| - CHECK(v8::Locker::IsLocked());
|
| + CHECK(v8::Locker::IsLocked(CcTest::default_isolate()));
|
| ApiTestFuzzer::Fuzz();
|
| - v8::Unlocker unlocker;
|
| + v8::Unlocker unlocker(CcTest::default_isolate());
|
| const char* code = "throw 7;";
|
| {
|
| - v8::Locker nested_locker;
|
| + v8::Locker nested_locker(CcTest::default_isolate());
|
| v8::HandleScope scope;
|
| v8::Handle<Value> value = CompileRun(code);
|
| CHECK(value.IsEmpty());
|
| @@ -11169,8 +11169,8 @@ static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) {
|
| // These are locking tests that don't need to be run again
|
| // as part of the locking aggregation tests.
|
| TEST(NestedLockers) {
|
| - v8::Locker locker;
|
| - CHECK(v8::Locker::IsLocked());
|
| + v8::Locker locker(CcTest::default_isolate());
|
| + CHECK(v8::Locker::IsLocked(CcTest::default_isolate()));
|
| v8::HandleScope scope;
|
| LocalContext env;
|
| Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(ThrowInJS);
|
| @@ -11191,7 +11191,7 @@ TEST(NestedLockers) {
|
| // These are locking tests that don't need to be run again
|
| // as part of the locking aggregation tests.
|
| TEST(NestedLockersNoTryCatch) {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| v8::HandleScope scope;
|
| LocalContext env;
|
| Local<v8::FunctionTemplate> fun_templ =
|
| @@ -11211,24 +11211,24 @@ TEST(NestedLockersNoTryCatch) {
|
|
|
|
|
| THREADED_TEST(RecursiveLocking) {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| {
|
| - v8::Locker locker2;
|
| - CHECK(v8::Locker::IsLocked());
|
| + v8::Locker locker2(CcTest::default_isolate());
|
| + CHECK(v8::Locker::IsLocked(CcTest::default_isolate()));
|
| }
|
| }
|
|
|
|
|
| static v8::Handle<Value> UnlockForAMoment(const v8::Arguments& args) {
|
| ApiTestFuzzer::Fuzz();
|
| - v8::Unlocker unlocker;
|
| + v8::Unlocker unlocker(CcTest::default_isolate());
|
| return v8::Undefined();
|
| }
|
|
|
|
|
| THREADED_TEST(LockUnlockLock) {
|
| {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| v8::HandleScope scope;
|
| LocalContext env;
|
| Local<v8::FunctionTemplate> fun_templ =
|
| @@ -11242,7 +11242,7 @@ THREADED_TEST(LockUnlockLock) {
|
| CHECK_EQ(42, script->Run()->Int32Value());
|
| }
|
| {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| v8::HandleScope scope;
|
| LocalContext env;
|
| Local<v8::FunctionTemplate> fun_templ =
|
| @@ -12493,7 +12493,7 @@ class RegExpInterruptTest {
|
|
|
| LongRunningRegExp();
|
| {
|
| - v8::Unlocker unlock;
|
| + v8::Unlocker unlock(CcTest::default_isolate());
|
| gc_thread.Join();
|
| }
|
| v8::Locker::StopPreemption();
|
| @@ -12520,7 +12520,7 @@ class RegExpInterruptTest {
|
| block_->Wait();
|
| while (gc_during_regexp_ < kRequiredGCs) {
|
| {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| // TODO(lrn): Perhaps create some garbage before collecting.
|
| HEAP->CollectAllGarbage(i::Heap::kNoGCFlags);
|
| gc_count_++;
|
| @@ -12580,7 +12580,7 @@ class RegExpInterruptTest {
|
| // Test that a regular expression execution can be interrupted and
|
| // survive a garbage collection.
|
| TEST(RegExpInterruption) {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| v8::V8::Initialize();
|
| v8::HandleScope scope;
|
| Local<Context> local_env;
|
| @@ -12616,7 +12616,7 @@ class ApplyInterruptTest {
|
|
|
| LongRunningApply();
|
| {
|
| - v8::Unlocker unlock;
|
| + v8::Unlocker unlock(CcTest::default_isolate());
|
| gc_thread.Join();
|
| }
|
| v8::Locker::StopPreemption();
|
| @@ -12643,7 +12643,7 @@ class ApplyInterruptTest {
|
| block_->Wait();
|
| while (gc_during_apply_ < kRequiredGCs) {
|
| {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| HEAP->CollectAllGarbage(i::Heap::kNoGCFlags);
|
| gc_count_++;
|
| }
|
| @@ -12689,7 +12689,7 @@ class ApplyInterruptTest {
|
| // Test that nothing bad happens if we get a preemption just when we were
|
| // about to do an apply().
|
| TEST(ApplyInterruption) {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| v8::V8::Initialize();
|
| v8::HandleScope scope;
|
| Local<Context> local_env;
|
| @@ -12927,7 +12927,7 @@ class RegExpStringModificationTest {
|
| v8::Locker::StartPreemption(1);
|
| LongRunningRegExp();
|
| {
|
| - v8::Unlocker unlock;
|
| + v8::Unlocker unlock(CcTest::default_isolate());
|
| morph_thread.Join();
|
| }
|
| v8::Locker::StopPreemption();
|
| @@ -12956,7 +12956,7 @@ class RegExpStringModificationTest {
|
| while (morphs_during_regexp_ < kRequiredModifications &&
|
| morphs_ < kMaxModifications) {
|
| {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| // Swap string between ascii and two-byte representation.
|
| i::String* string = *input_;
|
| MorphAString(string, &ascii_resource_, &uc16_resource_);
|
| @@ -13004,7 +13004,7 @@ class RegExpStringModificationTest {
|
| // Test that a regular expression execution can be interrupted and
|
| // the string changed without failing.
|
| TEST(RegExpStringModification) {
|
| - v8::Locker lock;
|
| + v8::Locker lock(CcTest::default_isolate());
|
| v8::V8::Initialize();
|
| v8::HandleScope scope;
|
| Local<Context> local_env;
|
| @@ -15137,7 +15137,7 @@ TEST(SetResourceConstraints) {
|
| TEST(SetResourceConstraintsInThread) {
|
| uint32_t* set_limit;
|
| {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| static const int K = 1024;
|
| set_limit = ComputeStackLimit(128 * K);
|
|
|
| @@ -15158,7 +15158,7 @@ TEST(SetResourceConstraintsInThread) {
|
| CHECK(stack_limit == set_limit);
|
| }
|
| {
|
| - v8::Locker locker;
|
| + v8::Locker locker(CcTest::default_isolate());
|
| CHECK(stack_limit == set_limit);
|
| }
|
| }
|
|
|