| 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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 void ThreadState::unregisterSweepingTask() | 1022 void ThreadState::unregisterSweepingTask() |
| 1023 { | 1023 { |
| 1024 MutexLocker locker(m_sweepMutex); | 1024 MutexLocker locker(m_sweepMutex); |
| 1025 ASSERT(m_numberOfSweeperTasks > 0); | 1025 ASSERT(m_numberOfSweeperTasks > 0); |
| 1026 if (!--m_numberOfSweeperTasks) | 1026 if (!--m_numberOfSweeperTasks) |
| 1027 m_sweepThreadCondition.signal(); | 1027 m_sweepThreadCondition.signal(); |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 void ThreadState::waitUntilSweepersDone() | 1030 void ThreadState::waitUntilSweepersDone() |
| 1031 { | 1031 { |
| 1032 TRACE_EVENT0("blink_gc", "ThreadState::waitUntilSweepersDone"); |
| 1032 MutexLocker locker(m_sweepMutex); | 1033 MutexLocker locker(m_sweepMutex); |
| 1033 while (m_numberOfSweeperTasks > 0) | 1034 while (m_numberOfSweeperTasks > 0) |
| 1034 m_sweepThreadCondition.wait(m_sweepMutex); | 1035 m_sweepThreadCondition.wait(m_sweepMutex); |
| 1035 } | 1036 } |
| 1036 | 1037 |
| 1037 | 1038 |
| 1038 class SweepNonFinalizedHeapTask final : public WebThread::Task { | 1039 class SweepNonFinalizedHeapTask final : public WebThread::Task { |
| 1039 public: | 1040 public: |
| 1040 SweepNonFinalizedHeapTask(ThreadState* state, BaseHeap* heap, HeapStats* sta
ts) | 1041 SweepNonFinalizedHeapTask(ThreadState* state, BaseHeap* heap, HeapStats* sta
ts) |
| 1041 : m_threadState(state) | 1042 : m_threadState(state) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 return gcInfo; | 1274 return gcInfo; |
| 1274 } | 1275 } |
| 1275 } | 1276 } |
| 1276 if (needLockForIteration) | 1277 if (needLockForIteration) |
| 1277 threadAttachMutex().unlock(); | 1278 threadAttachMutex().unlock(); |
| 1278 return 0; | 1279 return 0; |
| 1279 } | 1280 } |
| 1280 #endif | 1281 #endif |
| 1281 | 1282 |
| 1282 } | 1283 } |
| OLD | NEW |