| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { | 371 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) { |
| 372 WebScheduler* scheduler = Platform::current()->currentThread()->schedule
r(); | 372 WebScheduler* scheduler = Platform::current()->currentThread()->schedule
r(); |
| 373 V8PerIsolateData::enableIdleTasks(isolate, adoptPtr(new V8IdleTaskRunner
(scheduler))); | 373 V8PerIsolateData::enableIdleTasks(isolate, adoptPtr(new V8IdleTaskRunner
(scheduler))); |
| 374 } | 374 } |
| 375 | 375 |
| 376 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 376 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
| 377 | 377 |
| 378 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 378 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
| 379 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); | 379 profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &Ret
ainedDOMInfo::createRetainedDOMInfo); |
| 380 | 380 |
| 381 ASSERT(ThreadState::current()); | 381 ASSERT(ThreadState::mainThreadState()); |
| 382 ThreadState::current()->addInterruptor(adoptPtr(new V8IsolateInterruptor(iso
late))); | 382 ThreadState::mainThreadState()->addInterruptor(adoptPtr(new V8IsolateInterru
ptor(isolate))); |
| 383 ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::tr
aceDOMWrappers); | 383 ThreadState::mainThreadState()->registerTraceDOMWrappers(isolate, V8GCContro
ller::traceDOMWrappers); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void V8Initializer::shutdownMainThread() | 386 void V8Initializer::shutdownMainThread() |
| 387 { | 387 { |
| 388 ASSERT(isMainThread()); | 388 ASSERT(isMainThread()); |
| 389 ThreadState::current()->unregisterTraceDOMWrappers(); | |
| 390 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 389 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
| 391 V8PerIsolateData::willBeDestroyed(isolate); | 390 V8PerIsolateData::willBeDestroyed(isolate); |
| 392 V8PerIsolateData::destroy(isolate); | 391 V8PerIsolateData::destroy(isolate); |
| 393 } | 392 } |
| 394 | 393 |
| 395 static void reportFatalErrorInWorker(const char* location, const char* message) | 394 static void reportFatalErrorInWorker(const char* location, const char* message) |
| 396 { | 395 { |
| 397 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. | 396 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. |
| 398 CRASH(); | 397 CRASH(); |
| 399 } | 398 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 446 |
| 448 isolate->AddMessageListener(messageHandlerInWorker); | 447 isolate->AddMessageListener(messageHandlerInWorker); |
| 449 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 448 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
| 450 | 449 |
| 451 uint32_t here; | 450 uint32_t here; |
| 452 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); | 451 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi
ze / sizeof(uint32_t*))); |
| 453 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 452 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
| 454 } | 453 } |
| 455 | 454 |
| 456 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |