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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); | 418 isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread); |
419 | 419 |
420 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) | 420 if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) |
421 profiler->SetWrapperClassInfoProvider( | 421 profiler->SetWrapperClassInfoProvider( |
422 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); | 422 WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo); |
423 | 423 |
424 ASSERT(ThreadState::mainThreadState()); | 424 ASSERT(ThreadState::mainThreadState()); |
425 ThreadState::mainThreadState()->addInterruptor( | 425 ThreadState::mainThreadState()->addInterruptor( |
426 WTF::makeUnique<V8IsolateInterruptor>(isolate)); | 426 WTF::makeUnique<V8IsolateInterruptor>(isolate)); |
427 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { | 427 ThreadState::mainThreadState()->registerTraceDOMWrappers( |
428 ThreadState::mainThreadState()->registerTraceDOMWrappers( | 428 isolate, V8GCController::traceDOMWrappers, |
429 isolate, V8GCController::traceDOMWrappers, | 429 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, |
430 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, | 430 ScriptWrappableVisitor::performCleanup); |
431 ScriptWrappableVisitor::performCleanup); | |
432 } else { | |
433 ThreadState::mainThreadState()->registerTraceDOMWrappers( | |
434 isolate, V8GCController::traceDOMWrappers, nullptr, nullptr); | |
435 } | |
436 | 431 |
437 V8PerIsolateData::from(isolate)->setThreadDebugger( | 432 V8PerIsolateData::from(isolate)->setThreadDebugger( |
438 WTF::makeUnique<MainThreadDebugger>(isolate)); | 433 WTF::makeUnique<MainThreadDebugger>(isolate)); |
439 } | 434 } |
440 | 435 |
441 void V8Initializer::shutdownMainThread() { | 436 void V8Initializer::shutdownMainThread() { |
442 ASSERT(isMainThread()); | 437 ASSERT(isMainThread()); |
443 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); | 438 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); |
444 V8PerIsolateData::willBeDestroyed(isolate); | 439 V8PerIsolateData::willBeDestroyed(isolate); |
445 V8PerIsolateData::destroy(isolate); | 440 V8PerIsolateData::destroy(isolate); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 v8::Isolate::kMessageLog); | 516 v8::Isolate::kMessageLog); |
522 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); | 517 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); |
523 | 518 |
524 uint32_t here; | 519 uint32_t here; |
525 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - | 520 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - |
526 kWorkerMaxStackSize); | 521 kWorkerMaxStackSize); |
527 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); | 522 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); |
528 } | 523 } |
529 | 524 |
530 } // namespace blink | 525 } // namespace blink |
OLD | NEW |