Chromium Code Reviews| 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 956 | 956 |
| 957 if (gcType == GCWithSweep) { | 957 if (gcType == GCWithSweep) { |
| 958 setGCState(EagerSweepScheduled); | 958 setGCState(EagerSweepScheduled); |
| 959 } else if (gcType == GCWithoutSweep) { | 959 } else if (gcType == GCWithoutSweep) { |
| 960 setGCState(LazySweepScheduled); | 960 setGCState(LazySweepScheduled); |
| 961 } else { | 961 } else { |
| 962 takeSnapshot(); | 962 takeSnapshot(); |
| 963 | 963 |
| 964 // This unmarks all marked objects and marks all unmarked objects dead. | 964 // This unmarks all marked objects and marks all unmarked objects dead. |
| 965 makeConsistentForMutator(); | 965 makeConsistentForMutator(); |
| 966 | 966 |
|
haraken
2015/06/24 03:46:21
Sorry, you need to call takeSnapshotOfFreeList her
ssid
2015/06/24 05:45:29
Done.
| |
| 967 // Force setting NoGCScheduled to circumvent checkThread() | 967 // Force setting NoGCScheduled to circumvent checkThread() |
| 968 // in setGCState(). | 968 // in setGCState(). |
| 969 m_gcState = NoGCScheduled; | 969 m_gcState = NoGCScheduled; |
| 970 } | 970 } |
| 971 } | 971 } |
| 972 | 972 |
| 973 void ThreadState::preSweep() | 973 void ThreadState::preSweep() |
| 974 { | 974 { |
| 975 checkThread(); | 975 checkThread(); |
| 976 if (gcState() != EagerSweepScheduled && gcState() != LazySweepScheduled) | 976 if (gcState() != EagerSweepScheduled && gcState() != LazySweepScheduled) |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1377 { | 1377 { |
| 1378 ASSERT(isInGC()); | 1378 ASSERT(isInGC()); |
| 1379 | 1379 |
| 1380 int numberOfHeapsReported = 0; | 1380 int numberOfHeapsReported = 0; |
| 1381 #define SNAPSHOT_HEAP(HeapType) \ | 1381 #define SNAPSHOT_HEAP(HeapType) \ |
| 1382 { \ | 1382 { \ |
| 1383 numberOfHeapsReported++; \ | 1383 numberOfHeapsReported++; \ |
| 1384 String allocatorBaseName; \ | 1384 String allocatorBaseName; \ |
| 1385 allocatorBaseName = String::format("blink_gc/thread_%lu/heaps/" #HeapTyp e, (unsigned long)(m_thread)); \ | 1385 allocatorBaseName = String::format("blink_gc/thread_%lu/heaps/" #HeapTyp e, (unsigned long)(m_thread)); \ |
| 1386 m_heaps[HeapType##HeapIndex]->takeSnapshot(allocatorBaseName); \ | 1386 m_heaps[HeapType##HeapIndex]->takeSnapshot(allocatorBaseName); \ |
| 1387 m_heaps[HeapType##HeapIndex]->takeFreelistSnapshot(allocatorBaseName); \ | |
| 1387 } | 1388 } |
| 1388 | 1389 |
| 1389 SNAPSHOT_HEAP(NormalPage1); | 1390 SNAPSHOT_HEAP(NormalPage1); |
| 1390 SNAPSHOT_HEAP(NormalPage2); | 1391 SNAPSHOT_HEAP(NormalPage2); |
| 1391 SNAPSHOT_HEAP(NormalPage3); | 1392 SNAPSHOT_HEAP(NormalPage3); |
| 1392 SNAPSHOT_HEAP(NormalPage4); | 1393 SNAPSHOT_HEAP(NormalPage4); |
| 1393 SNAPSHOT_HEAP(EagerSweep); | 1394 SNAPSHOT_HEAP(EagerSweep); |
| 1394 SNAPSHOT_HEAP(Vector1); | 1395 SNAPSHOT_HEAP(Vector1); |
| 1395 SNAPSHOT_HEAP(Vector2); | 1396 SNAPSHOT_HEAP(Vector2); |
| 1396 SNAPSHOT_HEAP(Vector3); | 1397 SNAPSHOT_HEAP(Vector3); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1495 json->beginArray(it->key.ascii().data()); | 1496 json->beginArray(it->key.ascii().data()); |
| 1496 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1497 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1497 json->pushInteger(it->value.ages[age]); | 1498 json->pushInteger(it->value.ages[age]); |
| 1498 json->endArray(); | 1499 json->endArray(); |
| 1499 } | 1500 } |
| 1500 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); | 1501 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); |
| 1501 } | 1502 } |
| 1502 #endif | 1503 #endif |
| 1503 | 1504 |
| 1504 } // namespace blink | 1505 } // namespace blink |
| OLD | NEW |