Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.h

Issue 1771353010: Finish completeSweep before shutting down V8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 static void unlockThreadAttachMutex(); 183 static void unlockThreadAttachMutex();
184 184
185 // Initialize threading infrastructure. Should be called from the main 185 // Initialize threading infrastructure. Should be called from the main
186 // thread. 186 // thread.
187 static void init(); 187 static void init();
188 static void shutdown(); 188 static void shutdown();
189 bool isTerminating() { return m_isTerminating; } 189 bool isTerminating() { return m_isTerminating; }
190 190
191 static void attachMainThread(); 191 static void attachMainThread();
192 static void detachMainThread(); 192 static void detachMainThread();
193 void stopMainThread();
193 194
194 // Trace all persistent roots, called when marking the managed heap objects. 195 // Trace all persistent roots, called when marking the managed heap objects.
195 static void visitPersistentRoots(Visitor*); 196 static void visitPersistentRoots(Visitor*);
196 197
197 // Trace all objects found on the stack, used when doing conservative GCs. 198 // Trace all objects found on the stack, used when doing conservative GCs.
198 static void visitStackRoots(Visitor*); 199 static void visitStackRoots(Visitor*);
199 200
200 // Associate ThreadState object with the current thread. After this 201 // Associate ThreadState object with the current thread. After this
201 // call thread can start using the garbage collected heap infrastructure. 202 // call thread can start using the garbage collected heap infrastructure.
202 // It also has to periodically check for safepoints. 203 // It also has to periodically check for safepoints.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 m_orderedPreFinalizers.remove(PreFinalizer(self, &T::invokePreFinalizer) ); 424 m_orderedPreFinalizers.remove(PreFinalizer(self, &T::invokePreFinalizer) );
424 } 425 }
425 426
426 void shouldFlushHeapDoesNotContainCache() { m_shouldFlushHeapDoesNotContainC ache = true; } 427 void shouldFlushHeapDoesNotContainCache() { m_shouldFlushHeapDoesNotContainC ache = true; }
427 428
428 void registerTraceDOMWrappers(v8::Isolate* isolate, void (*traceDOMWrappers) (v8::Isolate*, Visitor*)) 429 void registerTraceDOMWrappers(v8::Isolate* isolate, void (*traceDOMWrappers) (v8::Isolate*, Visitor*))
429 { 430 {
430 m_isolate = isolate; 431 m_isolate = isolate;
431 m_traceDOMWrappers = traceDOMWrappers; 432 m_traceDOMWrappers = traceDOMWrappers;
432 } 433 }
433 void unregisterTraceDOMWrappers()
haraken 2016/03/10 05:42:23 Previously I mentioned that we need to clear m_tra
434 {
435 m_isolate = nullptr;
436 m_traceDOMWrappers = nullptr;
437 }
438 434
439 // By entering a gc-forbidden scope, conservative GCs will not 435 // By entering a gc-forbidden scope, conservative GCs will not
440 // be allowed while handling an out-of-line allocation request. 436 // be allowed while handling an out-of-line allocation request.
441 // Intended used when constructing subclasses of GC mixins, where 437 // Intended used when constructing subclasses of GC mixins, where
442 // the object being constructed cannot be safely traced & marked 438 // the object being constructed cannot be safely traced & marked
443 // fully should a GC be allowed while its subclasses are being 439 // fully should a GC be allowed while its subclasses are being
444 // constructed. 440 // constructed.
445 void enterGCForbiddenScopeIfNeeded(GarbageCollectedMixinConstructorMarker* g cMixinMarker) 441 void enterGCForbiddenScopeIfNeeded(GarbageCollectedMixinConstructorMarker* g cMixinMarker)
446 { 442 {
447 ASSERT(checkThread()); 443 ASSERT(checkThread());
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 706
711 template<> class ThreadStateFor<AnyThread> { 707 template<> class ThreadStateFor<AnyThread> {
712 STATIC_ONLY(ThreadStateFor); 708 STATIC_ONLY(ThreadStateFor);
713 public: 709 public:
714 static ThreadState* state() { return ThreadState::current(); } 710 static ThreadState* state() { return ThreadState::current(); }
715 }; 711 };
716 712
717 } // namespace blink 713 } // namespace blink
718 714
719 #endif // ThreadState_h 715 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698