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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 SetPoison, | 219 SetPoison, |
220 ClearPoison, | 220 ClearPoison, |
221 }; | 221 }; |
222 | 222 |
223 enum ObjectsToPoison { | 223 enum ObjectsToPoison { |
224 UnmarkedOnly, | 224 UnmarkedOnly, |
225 MarkedAndUnmarked, | 225 MarkedAndUnmarked, |
226 }; | 226 }; |
227 #endif | 227 #endif |
228 | 228 |
| 229 enum V8GCType { |
| 230 V8MinorGC, |
| 231 V8MajorGC, |
| 232 }; |
| 233 |
229 // The NoAllocationScope class is used in debug mode to catch unwanted | 234 // The NoAllocationScope class is used in debug mode to catch unwanted |
230 // allocations. E.g. allocations during GC. | 235 // allocations. E.g. allocations during GC. |
231 class NoAllocationScope final { | 236 class NoAllocationScope final { |
232 public: | 237 public: |
233 explicit NoAllocationScope(ThreadState* state) : m_state(state) | 238 explicit NoAllocationScope(ThreadState* state) : m_state(state) |
234 { | 239 { |
235 m_state->enterNoAllocationScope(); | 240 m_state->enterNoAllocationScope(); |
236 } | 241 } |
237 ~NoAllocationScope() | 242 ~NoAllocationScope() |
238 { | 243 { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 #if ENABLE(ASSERT) | 326 #if ENABLE(ASSERT) |
322 bool checkThread() const { return m_thread == currentThread(); } | 327 bool checkThread() const { return m_thread == currentThread(); } |
323 #endif | 328 #endif |
324 | 329 |
325 void performIdleGC(double deadlineSeconds); | 330 void performIdleGC(double deadlineSeconds); |
326 void performIdleLazySweep(double deadlineSeconds); | 331 void performIdleLazySweep(double deadlineSeconds); |
327 | 332 |
328 void scheduleIdleGC(); | 333 void scheduleIdleGC(); |
329 void scheduleIdleLazySweep(); | 334 void scheduleIdleLazySweep(); |
330 void schedulePreciseGC(); | 335 void schedulePreciseGC(); |
331 void scheduleV8FollowupGCIfNeeded(); | 336 void scheduleV8FollowupGCIfNeeded(V8GCType); |
332 void schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio); | 337 void schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio); |
333 void schedulePageNavigationGC(); | 338 void schedulePageNavigationGC(); |
334 void scheduleGCIfNeeded(); | 339 void scheduleGCIfNeeded(); |
335 void setGCState(GCState); | 340 void setGCState(GCState); |
336 GCState gcState() const; | 341 GCState gcState() const; |
337 bool isInGC() const { return gcState() == GCRunning; } | 342 bool isInGC() const { return gcState() == GCRunning; } |
338 bool isSweepingInProgress() const | 343 bool isSweepingInProgress() const |
339 { | 344 { |
340 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; | 345 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; |
341 } | 346 } |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 }; | 831 }; |
827 | 832 |
828 template<> class ThreadStateFor<AnyThread> { | 833 template<> class ThreadStateFor<AnyThread> { |
829 public: | 834 public: |
830 static ThreadState* state() { return ThreadState::current(); } | 835 static ThreadState* state() { return ThreadState::current(); } |
831 }; | 836 }; |
832 | 837 |
833 } // namespace blink | 838 } // namespace blink |
834 | 839 |
835 #endif // ThreadState_h | 840 #endif // ThreadState_h |
OLD | NEW |