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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 public: | 272 public: |
273 // When garbage collecting we need to know whether or not there | 273 // When garbage collecting we need to know whether or not there |
274 // can be pointers to Blink GC managed objects on the stack for | 274 // can be pointers to Blink GC managed objects on the stack for |
275 // each thread. When threads reach a safe point they record | 275 // each thread. When threads reach a safe point they record |
276 // whether or not they have pointers on the stack. | 276 // whether or not they have pointers on the stack. |
277 enum StackState { | 277 enum StackState { |
278 NoHeapPointersOnStack, | 278 NoHeapPointersOnStack, |
279 HeapPointersOnStack | 279 HeapPointersOnStack |
280 }; | 280 }; |
281 | 281 |
| 282 // When profiling we would like to identify forced GC requests. |
| 283 enum CauseOfGC { |
| 284 NormalGC, |
| 285 ForcedGC |
| 286 }; |
| 287 |
282 class NoSweepScope { | 288 class NoSweepScope { |
283 public: | 289 public: |
284 explicit NoSweepScope(ThreadState* state) : m_state(state) | 290 explicit NoSweepScope(ThreadState* state) : m_state(state) |
285 { | 291 { |
286 ASSERT(!m_state->m_sweepInProgress); | 292 ASSERT(!m_state->m_sweepInProgress); |
287 m_state->m_sweepInProgress = true; | 293 m_state->m_sweepInProgress = true; |
288 } | 294 } |
289 ~NoSweepScope() | 295 ~NoSweepScope() |
290 { | 296 { |
291 ASSERT(m_state->m_sweepInProgress); | 297 ASSERT(m_state->m_sweepInProgress); |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 // whether the page is part of a terminting thread or | 847 // whether the page is part of a terminting thread or |
842 // if the page is traced after being terminated (orphaned). | 848 // if the page is traced after being terminated (orphaned). |
843 uintptr_t m_terminating : 1; | 849 uintptr_t m_terminating : 1; |
844 uintptr_t m_tracedAfterOrphaned : 1; | 850 uintptr_t m_tracedAfterOrphaned : 1; |
845 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 | 851 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 |
846 }; | 852 }; |
847 | 853 |
848 } | 854 } |
849 | 855 |
850 #endif // ThreadState_h | 856 #endif // ThreadState_h |
OLD | NEW |