diff options
Diffstat (limited to 'deps/v8/test/cctest/test-log.cc')
-rw-r--r-- | deps/v8/test/cctest/test-log.cc | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/deps/v8/test/cctest/test-log.cc b/deps/v8/test/cctest/test-log.cc index f752c36ccb..2cf2a77445 100644 --- a/deps/v8/test/cctest/test-log.cc +++ b/deps/v8/test/cctest/test-log.cc @@ -60,9 +60,9 @@ class ScopedLoggerInitializer { temp_file_(NULL), // Need to run this prior to creating the scope. trick_to_run_init_flags_(init_flags_()), - scope_(v8::Isolate::GetCurrent()), - env_(v8::Context::New(v8::Isolate::GetCurrent())), - logger_(i::Isolate::Current()->logger()) { + scope_(CcTest::isolate()), + env_(v8::Context::New(CcTest::isolate())), + logger_(CcTest::i_isolate()->logger()) { env_->Enter(); } @@ -91,6 +91,7 @@ class ScopedLoggerInitializer { i::FLAG_log = true; i::FLAG_prof = true; i::FLAG_logfile = i::Log::kLogToTemporaryFile; + i::FLAG_logfile_per_isolate = false; return false; } @@ -169,8 +170,8 @@ class LoopingJsThread : public LoopingThread { : LoopingThread(isolate) { } void RunLoop() { v8::Locker locker; - CHECK(i::Isolate::Current() != NULL); - CHECK_GT(i::Isolate::Current()->thread_manager()->CurrentId(), 0); + CHECK(CcTest::i_isolate() != NULL); + CHECK_GT(CcTest::i_isolate()->thread_manager()->CurrentId(), 0); SetV8ThreadId(); while (IsRunning()) { v8::HandleScope scope; @@ -197,8 +198,8 @@ class LoopingNonJsThread : public LoopingThread { v8::Locker locker; v8::Unlocker unlocker; // Now thread has V8's id, but will not run VM code. - CHECK(i::Isolate::Current() != NULL); - CHECK_GT(i::Isolate::Current()->thread_manager()->CurrentId(), 0); + CHECK(CcTest::i_isolate() != NULL); + CHECK_GT(CcTest::i_isolate()->thread_manager()->CurrentId(), 0); double i = 10; SignalRunning(); while (IsRunning()) { @@ -243,14 +244,14 @@ TEST(ProfMultipleThreads) { TestSampler* sampler = NULL; { v8::Locker locker; - sampler = new TestSampler(v8::internal::Isolate::Current()); + sampler = new TestSampler(CcTest::i_isolate()); sampler->Start(); CHECK(sampler->IsActive()); } - LoopingJsThread jsThread(v8::internal::Isolate::Current()); + LoopingJsThread jsThread(CcTest::i_isolate()); jsThread.Start(); - LoopingNonJsThread nonJsThread(v8::internal::Isolate::Current()); + LoopingNonJsThread nonJsThread(CcTest::i_isolate()); nonJsThread.Start(); CHECK(!sampler->WasSampleStackCalled()); @@ -299,8 +300,8 @@ class SimpleExternalString : public v8::String::ExternalStringResource { } // namespace TEST(Issue23768) { - v8::HandleScope scope(v8::Isolate::GetCurrent()); - v8::Handle<v8::Context> env = v8::Context::New(v8::Isolate::GetCurrent()); + v8::HandleScope scope(CcTest::isolate()); + v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate()); env->Enter(); SimpleExternalString source_ext_str("(function ext() {})();"); @@ -317,7 +318,7 @@ TEST(Issue23768) { i_source->set_resource(NULL); // Must not crash. - i::Isolate::Current()->logger()->LogCompiledFunctions(); + CcTest::i_isolate()->logger()->LogCompiledFunctions(); } @@ -330,7 +331,7 @@ TEST(LogCallbacks) { Logger* logger = initialize_logger.logger(); v8::Local<v8::FunctionTemplate> obj = - v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), + v8::Local<v8::FunctionTemplate>::New(CcTest::isolate(), v8::FunctionTemplate::New()); obj->SetClassName(v8_str("Obj")); v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate(); @@ -379,7 +380,7 @@ TEST(LogAccessorCallbacks) { Logger* logger = initialize_logger.logger(); v8::Local<v8::FunctionTemplate> obj = - v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), + v8::Local<v8::FunctionTemplate>::New(CcTest::isolate(), v8::FunctionTemplate::New()); obj->SetClassName(v8_str("Obj")); v8::Handle<v8::ObjectTemplate> inst = obj->InstanceTemplate(); @@ -439,7 +440,7 @@ TEST(EquivalenceOfLoggingAndTraversal) { " (function a(j) { return function b() { return j; } })(100);\n" "})(this);"); logger->StopProfiler(); - HEAP->CollectAllGarbage(i::Heap::kMakeHeapIterableMask); + CcTest::heap()->CollectAllGarbage(i::Heap::kMakeHeapIterableMask); logger->StringEvent("test-logging-done", ""); // Iterate heap to find compiled functions, will write to log. |