| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 void schedulePreciseGC(); | 336 void schedulePreciseGC(); |
| 337 void scheduleGCIfNeeded(); | 337 void scheduleGCIfNeeded(); |
| 338 void setGCState(GCState); | 338 void setGCState(GCState); |
| 339 GCState gcState() const; | 339 GCState gcState() const; |
| 340 bool isInGC() const { return gcState() == GCRunning; } | 340 bool isInGC() const { return gcState() == GCRunning; } |
| 341 bool isSweepingInProgress() const | 341 bool isSweepingInProgress() const |
| 342 { | 342 { |
| 343 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; | 343 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool isSweepingScheduled() const |
| 347 { |
| 348 return gcState() == SweepingAndPreciseGCScheduled || gcState() == Sweepi
ngAndIdleGCScheduled; |
| 349 } |
| 350 |
| 346 void preGC(); | 351 void preGC(); |
| 347 void postGC(GCType); | 352 void postGC(GCType); |
| 348 | 353 |
| 349 // Support for disallowing allocation. Mainly used for sanity | 354 // Support for disallowing allocation. Mainly used for sanity |
| 350 // checks asserts. | 355 // checks asserts. |
| 351 bool isAllocationAllowed() const { return !isAtSafePoint() && !m_noAllocatio
nCount; } | 356 bool isAllocationAllowed() const { return !isAtSafePoint() && !m_noAllocatio
nCount; } |
| 352 void enterNoAllocationScope() { m_noAllocationCount++; } | 357 void enterNoAllocationScope() { m_noAllocationCount++; } |
| 353 void leaveNoAllocationScope() { m_noAllocationCount--; } | 358 void leaveNoAllocationScope() { m_noAllocationCount--; } |
| 354 | 359 |
| 355 // Before performing GC the thread-specific heap state should be | 360 // Before performing GC the thread-specific heap state should be |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 m_locked = false; | 780 m_locked = false; |
| 776 } | 781 } |
| 777 | 782 |
| 778 MutexBase& m_mutex; | 783 MutexBase& m_mutex; |
| 779 bool m_locked; | 784 bool m_locked; |
| 780 }; | 785 }; |
| 781 | 786 |
| 782 } // namespace blink | 787 } // namespace blink |
| 783 | 788 |
| 784 #endif // ThreadState_h | 789 #endif // ThreadState_h |
| OLD | NEW |