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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 { | 1503 { |
1504 dumpName.append(String::format("/pages/page_%lu", static_cast<unsigned long>
(pageIndex))); | 1504 dumpName.append(String::format("/pages/page_%lu", static_cast<unsigned long>
(pageIndex))); |
1505 WebMemoryAllocatorDump* pageDump = BlinkGCMemoryDumpProvider::instance()->cr
eateMemoryAllocatorDumpForCurrentGC(dumpName); | 1505 WebMemoryAllocatorDump* pageDump = BlinkGCMemoryDumpProvider::instance()->cr
eateMemoryAllocatorDumpForCurrentGC(dumpName); |
1506 | 1506 |
1507 size_t liveSize = 0; | 1507 size_t liveSize = 0; |
1508 size_t deadSize = 0; | 1508 size_t deadSize = 0; |
1509 size_t liveCount = 0; | 1509 size_t liveCount = 0; |
1510 size_t deadCount = 0; | 1510 size_t deadCount = 0; |
1511 HeapObjectHeader* header = heapObjectHeader(); | 1511 HeapObjectHeader* header = heapObjectHeader(); |
1512 size_t gcInfoIndex = header->gcInfoIndex(); | 1512 size_t gcInfoIndex = header->gcInfoIndex(); |
| 1513 size_t payloadSize = header->payloadSize(); |
1513 if (header->isMarked()) { | 1514 if (header->isMarked()) { |
1514 liveCount = 1; | 1515 liveCount = 1; |
1515 liveSize += header->payloadSize(); | 1516 liveSize += payloadSize; |
1516 info.liveCount[gcInfoIndex]++; | 1517 info.liveCount[gcInfoIndex]++; |
1517 info.liveSize[gcInfoIndex] += header->size(); | 1518 info.liveSize[gcInfoIndex] += payloadSize; |
1518 } else { | 1519 } else { |
1519 deadCount = 1; | 1520 deadCount = 1; |
1520 deadSize += header->payloadSize(); | 1521 deadSize += payloadSize; |
1521 info.deadCount[gcInfoIndex]++; | 1522 info.deadCount[gcInfoIndex]++; |
1522 info.deadSize[gcInfoIndex] += header->size(); | 1523 info.deadSize[gcInfoIndex] += payloadSize; |
1523 } | 1524 } |
1524 | 1525 |
1525 pageDump->addScalar("live_count", "objects", liveCount); | 1526 pageDump->addScalar("live_count", "objects", liveCount); |
1526 pageDump->addScalar("dead_count", "objects", deadCount); | 1527 pageDump->addScalar("dead_count", "objects", deadCount); |
1527 pageDump->addScalar("live_size", "bytes", liveSize); | 1528 pageDump->addScalar("live_size", "bytes", liveSize); |
1528 pageDump->addScalar("dead_size", "bytes", deadSize); | 1529 pageDump->addScalar("dead_size", "bytes", deadSize); |
1529 } | 1530 } |
1530 | 1531 |
1531 #if ENABLE(ASSERT) | 1532 #if ENABLE(ASSERT) |
1532 bool LargeObjectPage::contains(Address object) | 1533 bool LargeObjectPage::contains(Address object) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 | 1574 |
1574 m_hasEntries = true; | 1575 m_hasEntries = true; |
1575 size_t index = hash(address); | 1576 size_t index = hash(address); |
1576 ASSERT(!(index & 1)); | 1577 ASSERT(!(index & 1)); |
1577 Address cachePage = roundToBlinkPageStart(address); | 1578 Address cachePage = roundToBlinkPageStart(address); |
1578 m_entries[index + 1] = m_entries[index]; | 1579 m_entries[index + 1] = m_entries[index]; |
1579 m_entries[index] = cachePage; | 1580 m_entries[index] = cachePage; |
1580 } | 1581 } |
1581 | 1582 |
1582 } // namespace blink | 1583 } // namespace blink |
OLD | NEW |