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

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

Issue 1842803003: Introduce ProcessHeap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/HeapPage.cpp ('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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 // From here on ignore all conservatively discovered 291 // From here on ignore all conservatively discovered
292 // pointers into the heap owned by this thread. 292 // pointers into the heap owned by this thread.
293 m_isTerminating = true; 293 m_isTerminating = true;
294 294
295 // Set the terminate flag on all heap pages of this thread. This is used to 295 // Set the terminate flag on all heap pages of this thread. This is used to
296 // ensure we don't trace pages on other threads that are not part of the 296 // ensure we don't trace pages on other threads that are not part of the
297 // thread local GC. 297 // thread local GC.
298 prepareForThreadStateTermination(); 298 prepareForThreadStateTermination();
299 299
300 Heap::crossThreadPersistentRegion().prepareForThreadStateTermination(thi s); 300 ProcessHeap::crossThreadPersistentRegion().prepareForThreadStateTerminat ion(this);
301 301
302 // Do thread local GC's as long as the count of thread local Persistents 302 // Do thread local GC's as long as the count of thread local Persistents
303 // changes and is above zero. 303 // changes and is above zero.
304 int oldCount = -1; 304 int oldCount = -1;
305 int currentCount = getPersistentRegion()->numberOfPersistents(); 305 int currentCount = getPersistentRegion()->numberOfPersistents();
306 ASSERT(currentCount >= 0); 306 ASSERT(currentCount >= 0);
307 while (currentCount != oldCount) { 307 while (currentCount != oldCount) {
308 Heap::collectGarbageForTerminatingThread(this); 308 Heap::collectGarbageForTerminatingThread(this);
309 oldCount = currentCount; 309 oldCount = currentCount;
310 currentCount = getPersistentRegion()->numberOfPersistents(); 310 currentCount = getPersistentRegion()->numberOfPersistents();
(...skipping 18 matching lines...) Expand all
329 { 329 {
330 ThreadState* state = current(); 330 ThreadState* state = current();
331 state->cleanup(); 331 state->cleanup();
332 RELEASE_ASSERT(state->gcState() == ThreadState::NoGCScheduled); 332 RELEASE_ASSERT(state->gcState() == ThreadState::NoGCScheduled);
333 delete state; 333 delete state;
334 } 334 }
335 335
336 void ThreadState::visitPersistentRoots(Visitor* visitor) 336 void ThreadState::visitPersistentRoots(Visitor* visitor)
337 { 337 {
338 TRACE_EVENT0("blink_gc", "ThreadState::visitPersistentRoots"); 338 TRACE_EVENT0("blink_gc", "ThreadState::visitPersistentRoots");
339 Heap::crossThreadPersistentRegion().tracePersistentNodes(visitor); 339 ProcessHeap::crossThreadPersistentRegion().tracePersistentNodes(visitor);
340 340
341 for (ThreadState* state : attachedThreads()) 341 for (ThreadState* state : attachedThreads())
342 state->visitPersistents(visitor); 342 state->visitPersistents(visitor);
343 } 343 }
344 344
345 void ThreadState::visitStackRoots(Visitor* visitor) 345 void ThreadState::visitStackRoots(Visitor* visitor)
346 { 346 {
347 TRACE_EVENT0("blink_gc", "ThreadState::visitStackRoots"); 347 TRACE_EVENT0("blink_gc", "ThreadState::visitStackRoots");
348 for (ThreadState* state : attachedThreads()) 348 for (ThreadState* state : attachedThreads())
349 state->visitStack(visitor); 349 state->visitStack(visitor);
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1557 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1558 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1558 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1559 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1559 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1560 1560
1561 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1561 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1562 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1562 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1563 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1563 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1564 } 1564 }
1565 1565
1566 } // namespace blink 1566 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapPage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698