| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 824 |
| 825 if (isSweepingInProgress()) { | 825 if (isSweepingInProgress()) { |
| 826 setGCState(SweepingAndIdleGCScheduled); | 826 setGCState(SweepingAndIdleGCScheduled); |
| 827 return; | 827 return; |
| 828 } | 828 } |
| 829 | 829 |
| 830 // Some threads (e.g. PPAPI thread) don't have a scheduler. | 830 // Some threads (e.g. PPAPI thread) don't have a scheduler. |
| 831 if (!Platform::current()->currentThread()->scheduler()) | 831 if (!Platform::current()->currentThread()->scheduler()) |
| 832 return; | 832 return; |
| 833 | 833 |
| 834 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(B
LINK_FROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, this)); | 834 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(B
LINK_FROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, unretained(this))
); |
| 835 setGCState(IdleGCScheduled); | 835 setGCState(IdleGCScheduled); |
| 836 } | 836 } |
| 837 | 837 |
| 838 void ThreadState::scheduleIdleLazySweep() | 838 void ThreadState::scheduleIdleLazySweep() |
| 839 { | 839 { |
| 840 // TODO(haraken): Idle complete sweep should be supported in worker threads. | 840 // TODO(haraken): Idle complete sweep should be supported in worker threads. |
| 841 if (!isMainThread()) | 841 if (!isMainThread()) |
| 842 return; | 842 return; |
| 843 | 843 |
| 844 // Some threads (e.g. PPAPI thread) don't have a scheduler. | 844 // Some threads (e.g. PPAPI thread) don't have a scheduler. |
| 845 if (!Platform::current()->currentThread()->scheduler()) | 845 if (!Platform::current()->currentThread()->scheduler()) |
| 846 return; | 846 return; |
| 847 | 847 |
| 848 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_H
ERE, WTF::bind<double>(&ThreadState::performIdleLazySweep, this)); | 848 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_H
ERE, WTF::bind<double>(&ThreadState::performIdleLazySweep, unretained(this))); |
| 849 } | 849 } |
| 850 | 850 |
| 851 void ThreadState::schedulePreciseGC() | 851 void ThreadState::schedulePreciseGC() |
| 852 { | 852 { |
| 853 ASSERT(checkThread()); | 853 ASSERT(checkThread()); |
| 854 if (isSweepingInProgress()) { | 854 if (isSweepingInProgress()) { |
| 855 setGCState(SweepingAndPreciseGCScheduled); | 855 setGCState(SweepingAndPreciseGCScheduled); |
| 856 return; | 856 return; |
| 857 } | 857 } |
| 858 | 858 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1571 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1572 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1572 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1573 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1573 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1574 | 1574 |
| 1575 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1575 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1576 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1576 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1577 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1577 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 } // namespace blink | 1580 } // namespace blink |
| OLD | NEW |