| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 bool isMainThread() const { return this == mainThreadState(); } | 330 bool isMainThread() const { return this == mainThreadState(); } |
| 331 bool checkThread() const | 331 bool checkThread() const |
| 332 { | 332 { |
| 333 ASSERT(m_thread == currentThread()); | 333 ASSERT(m_thread == currentThread()); |
| 334 return true; | 334 return true; |
| 335 } | 335 } |
| 336 | 336 |
| 337 void didV8GC(); | 337 void didV8GC(); |
| 338 | 338 |
| 339 void performIdleGC(double deadlineSeconds); | 339 void performIdleGC(double deadlineSeconds); |
| 340 void performIdleCompleteSweep(double deadlineSeconds); | 340 void performIdleLazySweep(double deadlineSeconds); |
| 341 | 341 |
| 342 void scheduleIdleGC(); | 342 void scheduleIdleGC(); |
| 343 void scheduleIdleCompleteSweep(); | 343 void scheduleIdleLazySweep(); |
| 344 void schedulePreciseGC(); | 344 void schedulePreciseGC(); |
| 345 void scheduleGCIfNeeded(); | 345 void scheduleGCIfNeeded(); |
| 346 void setGCState(GCState); | 346 void setGCState(GCState); |
| 347 GCState gcState() const; | 347 GCState gcState() const; |
| 348 bool isInGC() const { return gcState() == GCRunning; } | 348 bool isInGC() const { return gcState() == GCRunning; } |
| 349 bool isSweepingInProgress() const | 349 bool isSweepingInProgress() const |
| 350 { | 350 { |
| 351 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; | 351 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul
ed || gcState() == SweepingAndIdleGCScheduled; |
| 352 } | 352 } |
| 353 | 353 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void collectAndReportMarkSweepStats() const; | 537 void collectAndReportMarkSweepStats() const; |
| 538 void reportMarkSweepStats(const char* statsName, const ClassAgeCountsMap&) c
onst; | 538 void reportMarkSweepStats(const char* statsName, const ClassAgeCountsMap&) c
onst; |
| 539 #endif | 539 #endif |
| 540 | 540 |
| 541 void pushWeakPointerCallback(void*, WeakPointerCallback); | 541 void pushWeakPointerCallback(void*, WeakPointerCallback); |
| 542 bool popAndInvokeWeakPointerCallback(Visitor*); | 542 bool popAndInvokeWeakPointerCallback(Visitor*); |
| 543 | 543 |
| 544 size_t objectPayloadSizeForTesting(); | 544 size_t objectPayloadSizeForTesting(); |
| 545 | 545 |
| 546 void preSweep(); | 546 void preSweep(); |
| 547 void postSweep(); |
| 547 void prepareHeapForTermination(); | 548 void prepareHeapForTermination(); |
| 548 | 549 |
| 549 // Request to call a pref-finalizer of the target object before the object | 550 // Request to call a pref-finalizer of the target object before the object |
| 550 // is destructed. The class T must have USING_PRE_FINALIZER(). The | 551 // is destructed. The class T must have USING_PRE_FINALIZER(). The |
| 551 // argument should be |*this|. Registering a lot of objects affects GC | 552 // argument should be |*this|. Registering a lot of objects affects GC |
| 552 // performance. We should register an object only if the object really | 553 // performance. We should register an object only if the object really |
| 553 // requires pre-finalizer, and we should unregister the object if | 554 // requires pre-finalizer, and we should unregister the object if |
| 554 // pre-finalizer is unnecessary. | 555 // pre-finalizer is unnecessary. |
| 555 template<typename T> | 556 template<typename T> |
| 556 void registerPreFinalizer(T& target) | 557 void registerPreFinalizer(T& target) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 }; | 779 }; |
| 779 | 780 |
| 780 template<> class ThreadStateFor<AnyThread> { | 781 template<> class ThreadStateFor<AnyThread> { |
| 781 public: | 782 public: |
| 782 static ThreadState* state() { return ThreadState::current(); } | 783 static ThreadState* state() { return ThreadState::current(); } |
| 783 }; | 784 }; |
| 784 | 785 |
| 785 } // namespace blink | 786 } // namespace blink |
| 786 | 787 |
| 787 #endif // ThreadState_h | 788 #endif // ThreadState_h |
| OLD | NEW |