| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size
of(void*); | 124 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size
of(void*); |
| 125 } | 125 } |
| 126 | 126 |
| 127 for (int heapIndex = 0; heapIndex < BlinkGC::LargeObjectHeapIndex; heapIndex
++) | 127 for (int heapIndex = 0; heapIndex < BlinkGC::LargeObjectHeapIndex; heapIndex
++) |
| 128 m_heaps[heapIndex] = new NormalPageHeap(this, heapIndex); | 128 m_heaps[heapIndex] = new NormalPageHeap(this, heapIndex); |
| 129 m_heaps[BlinkGC::LargeObjectHeapIndex] = new LargeObjectHeap(this, BlinkGC::
LargeObjectHeapIndex); | 129 m_heaps[BlinkGC::LargeObjectHeapIndex] = new LargeObjectHeap(this, BlinkGC::
LargeObjectHeapIndex); |
| 130 | 130 |
| 131 m_likelyToBePromptlyFreed = adoptArrayPtr(new int[likelyToBePromptlyFreedArr
aySize]); | 131 m_likelyToBePromptlyFreed = adoptArrayPtr(new int[likelyToBePromptlyFreedArr
aySize]); |
| 132 clearHeapAges(); | 132 clearHeapAges(); |
| 133 | 133 |
| 134 m_threadLocalWeakCallbackStack = new CallbackStack(); | 134 // There is little use of weak references and collections off the main threa
d; |
| 135 // use a much lower initial block reservation. |
| 136 size_t initialBlockSize = isMainThread() ? CallbackStack::kDefaultBlockSize
: CallbackStack::kMinimalBlockSize; |
| 137 m_threadLocalWeakCallbackStack = new CallbackStack(initialBlockSize); |
| 135 } | 138 } |
| 136 | 139 |
| 137 ThreadState::~ThreadState() | 140 ThreadState::~ThreadState() |
| 138 { | 141 { |
| 139 ASSERT(checkThread()); | 142 ASSERT(checkThread()); |
| 140 delete m_threadLocalWeakCallbackStack; | 143 delete m_threadLocalWeakCallbackStack; |
| 141 m_threadLocalWeakCallbackStack = nullptr; | 144 m_threadLocalWeakCallbackStack = nullptr; |
| 142 for (int i = 0; i < BlinkGC::NumberOfHeaps; ++i) | 145 for (int i = 0; i < BlinkGC::NumberOfHeaps; ++i) |
| 143 delete m_heaps[i]; | 146 delete m_heaps[i]; |
| 144 | 147 |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1538 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1536 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1539 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1537 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1540 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1538 | 1541 |
| 1539 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1542 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1540 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1543 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1541 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1544 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1542 } | 1545 } |
| 1543 | 1546 |
| 1544 } // namespace blink | 1547 } // namespace blink |
| OLD | NEW |