| 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 for (int i = 0; i < NumberOfHeaps; i++) { | 904 for (int i = 0; i < NumberOfHeaps; i++) { |
| 905 if (BaseHeapPage* page = m_heaps[i]->heapPageFromAddress(address)) | 905 if (BaseHeapPage* page = m_heaps[i]->heapPageFromAddress(address)) |
| 906 return page; | 906 return page; |
| 907 } | 907 } |
| 908 return 0; | 908 return 0; |
| 909 } | 909 } |
| 910 | 910 |
| 911 void ThreadState::getStats(HeapStats& stats) | 911 void ThreadState::getStats(HeapStats& stats) |
| 912 { | 912 { |
| 913 stats = m_stats; | 913 stats = m_stats; |
| 914 #if ENABLE(ASSERT) | 914 } |
| 915 if (isConsistentForSweeping()) { | 915 |
| 916 HeapStats scannedStats; | 916 void ThreadState::getStatsForTesting(HeapStats& stats) |
| 917 for (int i = 0; i < NumberOfHeaps; i++) | 917 { |
| 918 m_heaps[i]->getScannedStats(scannedStats); | 918 ASSERT(isConsistentForSweeping()); |
| 919 ASSERT(scannedStats == stats); | 919 for (int i = 0; i < NumberOfHeaps; i++) |
| 920 } | 920 m_heaps[i]->getStatsForTesting(stats); |
| 921 #endif | |
| 922 } | 921 } |
| 923 | 922 |
| 924 bool ThreadState::stopThreads() | 923 bool ThreadState::stopThreads() |
| 925 { | 924 { |
| 926 return s_safePointBarrier->parkOthers(); | 925 return s_safePointBarrier->parkOthers(); |
| 927 } | 926 } |
| 928 | 927 |
| 929 void ThreadState::resumeThreads() | 928 void ThreadState::resumeThreads() |
| 930 { | 929 { |
| 931 s_safePointBarrier->resumeOthers(); | 930 s_safePointBarrier->resumeOthers(); |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 return gcInfo; | 1281 return gcInfo; |
| 1283 } | 1282 } |
| 1284 } | 1283 } |
| 1285 if (needLockForIteration) | 1284 if (needLockForIteration) |
| 1286 threadAttachMutex().unlock(); | 1285 threadAttachMutex().unlock(); |
| 1287 return 0; | 1286 return 0; |
| 1288 } | 1287 } |
| 1289 #endif | 1288 #endif |
| 1290 | 1289 |
| 1291 } | 1290 } |
| OLD | NEW |