Revision f230a1cf deps/v8/test/cctest/test-log.cc

View differences:

deps/v8/test/cctest/test-log.cc
60 60
        temp_file_(NULL),
61 61
        // Need to run this prior to creating the scope.
62 62
        trick_to_run_init_flags_(init_flags_()),
63
        scope_(v8::Isolate::GetCurrent()),
64
        env_(v8::Context::New(v8::Isolate::GetCurrent())),
65
        logger_(i::Isolate::Current()->logger()) {
63
        scope_(CcTest::isolate()),
64
        env_(v8::Context::New(CcTest::isolate())),
65
        logger_(CcTest::i_isolate()->logger()) {
66 66
    env_->Enter();
67 67
  }
68 68

  
......
91 91
    i::FLAG_log = true;
92 92
    i::FLAG_prof = true;
93 93
    i::FLAG_logfile = i::Log::kLogToTemporaryFile;
94
    i::FLAG_logfile_per_isolate = false;
94 95
    return false;
95 96
  }
96 97

  
......
169 170
      : LoopingThread(isolate) { }
170 171
  void RunLoop() {
171 172
    v8::Locker locker;
172
    CHECK(i::Isolate::Current() != NULL);
173
    CHECK_GT(i::Isolate::Current()->thread_manager()->CurrentId(), 0);
173
    CHECK(CcTest::i_isolate() != NULL);
174
    CHECK_GT(CcTest::i_isolate()->thread_manager()->CurrentId(), 0);
174 175
    SetV8ThreadId();
175 176
    while (IsRunning()) {
176 177
      v8::HandleScope scope;
......
197 198
    v8::Locker locker;
198 199
    v8::Unlocker unlocker;
199 200
    // Now thread has V8's id, but will not run VM code.
200
    CHECK(i::Isolate::Current() != NULL);
201
    CHECK_GT(i::Isolate::Current()->thread_manager()->CurrentId(), 0);
201
    CHECK(CcTest::i_isolate() != NULL);
202
    CHECK_GT(CcTest::i_isolate()->thread_manager()->CurrentId(), 0);
202 203
    double i = 10;
203 204
    SignalRunning();
204 205
    while (IsRunning()) {
......
243 244
  TestSampler* sampler = NULL;
244 245
  {
245 246
    v8::Locker locker;
246
    sampler = new TestSampler(v8::internal::Isolate::Current());
247
    sampler = new TestSampler(CcTest::i_isolate());
247 248
    sampler->Start();
248 249
    CHECK(sampler->IsActive());
249 250
  }
250 251

  
251
  LoopingJsThread jsThread(v8::internal::Isolate::Current());
252
  LoopingJsThread jsThread(CcTest::i_isolate());
252 253
  jsThread.Start();
253
  LoopingNonJsThread nonJsThread(v8::internal::Isolate::Current());
254
  LoopingNonJsThread nonJsThread(CcTest::i_isolate());
254 255
  nonJsThread.Start();
255 256

  
256 257
  CHECK(!sampler->WasSampleStackCalled());
......
299 300
}  // namespace
300 301

  
301 302
TEST(Issue23768) {
302
  v8::HandleScope scope(v8::Isolate::GetCurrent());
303
  v8::Handle<v8::Context> env = v8::Context::New(v8::Isolate::GetCurrent());
303
  v8::HandleScope scope(CcTest::isolate());
304
  v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate());
304 305
  env->Enter();
305 306

  
306 307
  SimpleExternalString source_ext_str("(function ext() {})();");
......
317 318
  i_source->set_resource(NULL);
318 319

  
319 320
  // Must not crash.
320
  i::Isolate::Current()->logger()->LogCompiledFunctions();
321
  CcTest::i_isolate()->logger()->LogCompiledFunctions();
321 322
}
322 323

  
323 324

  
......
330 331
  Logger* logger = initialize_logger.logger();
331 332

  
332 333
  v8::Local<v8::FunctionTemplate> obj =
333
      v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(),
334
      v8::Local<v8::FunctionTemplate>::New(CcTest::isolate(),
334 335
                                           v8::FunctionTemplate::New());
335 336
  obj->SetClassName(v8_str("Obj"));
336 337
  v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate();
......
379 380
  Logger* logger = initialize_logger.logger();
380 381

  
381 382
  v8::Local<v8::FunctionTemplate> obj =
382
      v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(),
383
      v8::Local<v8::FunctionTemplate>::New(CcTest::isolate(),
383 384
                                           v8::FunctionTemplate::New());
384 385
  obj->SetClassName(v8_str("Obj"));
385 386
  v8::Handle<v8::ObjectTemplate> inst = obj->InstanceTemplate();
......
439 440
      "    (function a(j) { return function b() { return j; } })(100);\n"
440 441
      "})(this);");
441 442
  logger->StopProfiler();
442
  HEAP->CollectAllGarbage(i::Heap::kMakeHeapIterableMask);
443
  CcTest::heap()->CollectAllGarbage(i::Heap::kMakeHeapIterableMask);
443 444
  logger->StringEvent("test-logging-done", "");
444 445

  
445 446
  // Iterate heap to find compiled functions, will write to log.

Also available in: Unified diff