| OLD | NEW |
| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 private: | 294 private: |
| 295 ThreadState* m_state; | 295 ThreadState* m_state; |
| 296 }; | 296 }; |
| 297 | 297 |
| 298 // The set of ThreadStates for all threads attached to the Blink | 298 // The set of ThreadStates for all threads attached to the Blink |
| 299 // garbage collector. | 299 // garbage collector. |
| 300 typedef HashSet<ThreadState*> AttachedThreadStateSet; | 300 typedef HashSet<ThreadState*> AttachedThreadStateSet; |
| 301 static AttachedThreadStateSet& attachedThreads(); | 301 static AttachedThreadStateSet& attachedThreads(); |
| 302 | 302 |
| 303 // Initialize threading infrastructure. Should be called from the main | |
| 304 // thread. | |
| 305 static void init(); | |
| 306 static void shutdown(); | |
| 307 static void shutdownHeapIfNecessary(); | |
| 308 bool isTerminating() { return m_isTerminating; } | 303 bool isTerminating() { return m_isTerminating; } |
| 309 | 304 |
| 310 static void attachMainThread(); | |
| 311 static void detachMainThread(); | |
| 312 | |
| 313 // Trace all persistent roots, called when marking the managed heap objects. | 305 // Trace all persistent roots, called when marking the managed heap objects. |
| 314 static void visitPersistentRoots(Visitor*); | 306 static void visitPersistentRoots(Visitor*); |
| 315 | 307 |
| 316 // Trace all objects found on the stack, used when doing conservative GCs. | 308 // Trace all objects found on the stack, used when doing conservative GCs. |
| 317 static void visitStackRoots(Visitor*); | 309 static void visitStackRoots(Visitor*); |
| 318 | 310 |
| 319 // Associate ThreadState object with the current thread. After this | 311 // Associate ThreadState object with the current thread. After this |
| 320 // call thread can start using the garbage collected heap infrastructure. | 312 // call thread can start using the garbage collected heap infrastructure. |
| 321 // It also has to periodically check for safepoints. | 313 // It also has to periodically check for safepoints. |
| 322 static void attach(); | 314 static void attach(); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 // whether the page is part of a terminting thread or | 833 // whether the page is part of a terminting thread or |
| 842 // if the page is traced after being terminated (orphaned). | 834 // if the page is traced after being terminated (orphaned). |
| 843 uintptr_t m_terminating : 1; | 835 uintptr_t m_terminating : 1; |
| 844 uintptr_t m_tracedAfterOrphaned : 1; | 836 uintptr_t m_tracedAfterOrphaned : 1; |
| 845 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 | 837 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 |
| 846 }; | 838 }; |
| 847 | 839 |
| 848 } | 840 } |
| 849 | 841 |
| 850 #endif // ThreadState_h | 842 #endif // ThreadState_h |
| OLD | NEW |