Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 1909813002: Enable per thread heap for database thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 , m_disabledStaticPersistentsRegistration(0) 104 , m_disabledStaticPersistentsRegistration(0)
105 #endif 105 #endif
106 , m_allocatedObjectSize(0) 106 , m_allocatedObjectSize(0)
107 , m_markedObjectSize(0) 107 , m_markedObjectSize(0)
108 , m_reportedMemoryToV8(0) 108 , m_reportedMemoryToV8(0)
109 { 109 {
110 ASSERT(checkThread()); 110 ASSERT(checkThread());
111 ASSERT(!**s_threadSpecific); 111 ASSERT(!**s_threadSpecific);
112 **s_threadSpecific = this; 112 **s_threadSpecific = this;
113 113
114 // TODO(keishi) Remove when per thread heap is ready.
115 CHECK(!m_perThreadHeapEnabled);
116
117 if (m_perThreadHeapEnabled) { 114 if (m_perThreadHeapEnabled) {
118 m_heap = new ThreadHeap(); 115 m_heap = new ThreadHeap();
119 } else if (isMainThread()) { 116 } else if (isMainThread()) {
120 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*); 117 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*);
121 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack Size(); 118 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack Size();
122 if (underestimatedStackSize > sizeof(void*)) 119 if (underestimatedStackSize > sizeof(void*))
123 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size of(void*); 120 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size of(void*);
124 m_heap = new ThreadHeap(); 121 m_heap = new ThreadHeap();
125 } else { 122 } else {
126 m_heap = &ThreadState::mainThreadState()->heap(); 123 m_heap = &ThreadState::mainThreadState()->heap();
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1520 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1524 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1521 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1525 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1522 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1526 1523
1527 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1524 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1528 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1525 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1529 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1526 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1530 } 1527 }
1531 1528
1532 } // namespace blink 1529 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698