| 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 { | 872 { |
| 873 // TODO(haraken): Idle GC should be supported in worker threads as well. | 873 // TODO(haraken): Idle GC should be supported in worker threads as well. |
| 874 if (!isMainThread()) | 874 if (!isMainThread()) |
| 875 return; | 875 return; |
| 876 | 876 |
| 877 if (isSweepingInProgress()) { | 877 if (isSweepingInProgress()) { |
| 878 setGCState(SweepingAndIdleGCScheduled); | 878 setGCState(SweepingAndIdleGCScheduled); |
| 879 return; | 879 return; |
| 880 } | 880 } |
| 881 | 881 |
| 882 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(F
ROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, this)); | 882 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(B
LINK_FROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, this)); |
| 883 setGCState(IdleGCScheduled); | 883 setGCState(IdleGCScheduled); |
| 884 } | 884 } |
| 885 | 885 |
| 886 void ThreadState::scheduleIdleLazySweep() | 886 void ThreadState::scheduleIdleLazySweep() |
| 887 { | 887 { |
| 888 // TODO(haraken): Idle complete sweep should be supported in worker threads. | 888 // TODO(haraken): Idle complete sweep should be supported in worker threads. |
| 889 if (!isMainThread()) | 889 if (!isMainThread()) |
| 890 return; | 890 return; |
| 891 | 891 |
| 892 Platform::current()->currentThread()->scheduler()->postIdleTask(FROM_HERE, W
TF::bind<double>(&ThreadState::performIdleLazySweep, this)); | 892 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_H
ERE, WTF::bind<double>(&ThreadState::performIdleLazySweep, this)); |
| 893 } | 893 } |
| 894 | 894 |
| 895 void ThreadState::schedulePreciseGC() | 895 void ThreadState::schedulePreciseGC() |
| 896 { | 896 { |
| 897 ASSERT(checkThread()); | 897 ASSERT(checkThread()); |
| 898 if (isSweepingInProgress()) { | 898 if (isSweepingInProgress()) { |
| 899 setGCState(SweepingAndPreciseGCScheduled); | 899 setGCState(SweepingAndPreciseGCScheduled); |
| 900 return; | 900 return; |
| 901 } | 901 } |
| 902 | 902 |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 json->beginArray(it->key.ascii().data()); | 1656 json->beginArray(it->key.ascii().data()); |
| 1657 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1657 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1658 json->pushInteger(it->value.ages[age]); | 1658 json->pushInteger(it->value.ages[age]); |
| 1659 json->endArray(); | 1659 json->endArray(); |
| 1660 } | 1660 } |
| 1661 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1661 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
| 1662 } | 1662 } |
| 1663 #endif | 1663 #endif |
| 1664 | 1664 |
| 1665 } // namespace blink | 1665 } // namespace blink |
| OLD | NEW |