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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 | 372 |
| 373 void ThreadState::visitPersistents(Visitor* visitor) | 373 void ThreadState::visitPersistents(Visitor* visitor) |
| 374 { | 374 { |
| 375 m_persistents->trace(visitor); | 375 m_persistents->trace(visitor); |
| 376 if (m_traceDOMWrappers) { | 376 if (m_traceDOMWrappers) { |
| 377 TRACE_EVENT0("blink_gc", "V8GCController::traceDOMWrappers"); | 377 TRACE_EVENT0("blink_gc", "V8GCController::traceDOMWrappers"); |
| 378 m_traceDOMWrappers(m_isolate, visitor); | 378 m_traceDOMWrappers(m_isolate, visitor); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 void ThreadState::dumpMemory() | |
| 383 { | |
| 384 #define SNAPSHOT_HEAP(HeapType) \ | |
| 385 { \ | |
| 386 String allocatorBaseName; \ | |
| 387 if (isMainThread()) { \ | |
| 388 allocatorBaseName = String("blink_gc/thread_main/heaps/" #HeapType); \ | |
| 389 } \ | |
| 390 else { \ | |
| 391 allocatorBaseName = String::format("blink_gc/thread_%ld/heaps/" #Hea pType, m_thread); \ | |
| 392 } \ | |
| 393 m_heaps[HeapType##HeapIndex]->dumpMemory(allocatorBaseName); \ | |
| 394 } | |
| 395 | |
| 396 SNAPSHOT_HEAP(NormalPage1); | |
| 397 SNAPSHOT_HEAP(NormalPage2); | |
| 398 SNAPSHOT_HEAP(NormalPage3); | |
| 399 SNAPSHOT_HEAP(NormalPage4); | |
|
haraken
2015/05/26 12:21:59
We recently added "EagerSweep" :) Please just add
ssid
2015/05/27 13:15:06
Done.
| |
| 400 SNAPSHOT_HEAP(Vector1); | |
| 401 SNAPSHOT_HEAP(Vector2); | |
| 402 SNAPSHOT_HEAP(Vector3); | |
| 403 SNAPSHOT_HEAP(Vector4); | |
| 404 SNAPSHOT_HEAP(InlineVector); | |
| 405 SNAPSHOT_HEAP(HashTable); | |
| 406 SNAPSHOT_HEAP(LargeObject); | |
| 407 FOR_EACH_TYPED_HEAP(SNAPSHOT_HEAP); | |
| 408 | |
| 409 #undef SNAPSHOT_HEAP | |
| 410 } | |
| 411 | |
| 382 #if ENABLE(GC_PROFILING) | 412 #if ENABLE(GC_PROFILING) |
| 383 const GCInfo* ThreadState::findGCInfo(Address address) | 413 const GCInfo* ThreadState::findGCInfo(Address address) |
| 384 { | 414 { |
| 385 if (BasePage* page = findPageFromAddress(address)) | 415 if (BasePage* page = findPageFromAddress(address)) |
| 386 return page->findGCInfo(address); | 416 return page->findGCInfo(address); |
| 387 return nullptr; | 417 return nullptr; |
| 388 } | 418 } |
| 389 | 419 |
| 390 size_t ThreadState::SnapshotInfo::getClassTag(const GCInfo* gcInfo) | 420 size_t ThreadState::SnapshotInfo::getClassTag(const GCInfo* gcInfo) |
| 391 { | 421 { |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1329 json->beginArray(it->key.ascii().data()); | 1359 json->beginArray(it->key.ascii().data()); |
| 1330 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1360 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1331 json->pushInteger(it->value.ages[age]); | 1361 json->pushInteger(it->value.ages[age]); |
| 1332 json->endArray(); | 1362 json->endArray(); |
| 1333 } | 1363 } |
| 1334 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); | 1364 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); |
| 1335 } | 1365 } |
| 1336 #endif | 1366 #endif |
| 1337 | 1367 |
| 1338 } // namespace blink | 1368 } // namespace blink |
| OLD | NEW |