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

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

Issue 2012763002: Add checks for per thread heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 , m_disabledStaticPersistentsRegistration(0) 105 , m_disabledStaticPersistentsRegistration(0)
106 #endif 106 #endif
107 , m_allocatedObjectSize(0) 107 , m_allocatedObjectSize(0)
108 , m_markedObjectSize(0) 108 , m_markedObjectSize(0)
109 , m_reportedMemoryToV8(0) 109 , m_reportedMemoryToV8(0)
110 { 110 {
111 ASSERT(checkThread()); 111 ASSERT(checkThread());
112 ASSERT(!**s_threadSpecific); 112 ASSERT(!**s_threadSpecific);
113 **s_threadSpecific = this; 113 **s_threadSpecific = this;
114 114
115 // TODO(keishi) Remove when per thread heap is ready.
116 CHECK(!m_perThreadHeapEnabled);
117
118 if (m_perThreadHeapEnabled) { 115 if (m_perThreadHeapEnabled) {
119 m_heap = new ThreadHeap(); 116 m_heap = new ThreadHeap();
120 } else if (isMainThread()) { 117 } else if (isMainThread()) {
121 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*); 118 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*);
122 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack Size(); 119 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack Size();
123 if (underestimatedStackSize > sizeof(void*)) 120 if (underestimatedStackSize > sizeof(void*))
124 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size of(void*); 121 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size of(void*);
125 m_heap = new ThreadHeap(); 122 m_heap = new ThreadHeap();
126 } else { 123 } else {
127 m_heap = &ThreadState::mainThreadState()->heap(); 124 m_heap = &ThreadState::mainThreadState()->heap();
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 threadDump->AddScalar("dead_count", "objects", totalDeadCount); 1528 threadDump->AddScalar("dead_count", "objects", totalDeadCount);
1532 threadDump->AddScalar("live_size", "bytes", totalLiveSize); 1529 threadDump->AddScalar("live_size", "bytes", totalLiveSize);
1533 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); 1530 threadDump->AddScalar("dead_size", "bytes", totalDeadSize);
1534 1531
1535 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1532 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1536 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1533 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1537 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1534 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid());
1538 } 1535 }
1539 1536
1540 } // namespace blink 1537 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698