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

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

Issue 1753623002: Merge VisitorScope to Visitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added explicit Created 4 years, 9 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 ScriptForbiddenIfMainThreadScope scriptForbiddenScope; 482 ScriptForbiddenIfMainThreadScope scriptForbiddenScope;
483 483
484 // Disallow allocation during weak processing. 484 // Disallow allocation during weak processing.
485 // It would be technically safe to allow allocations, but it is unsafe 485 // It would be technically safe to allow allocations, but it is unsafe
486 // to mutate an object graph in a way in which a dead object gets 486 // to mutate an object graph in a way in which a dead object gets
487 // resurrected or mutate a HashTable (because HashTable's weak processing 487 // resurrected or mutate a HashTable (because HashTable's weak processing
488 // assumes that the HashTable hasn't been mutated since the latest marking). 488 // assumes that the HashTable hasn't been mutated since the latest marking).
489 // Due to the complexity, we just forbid allocations. 489 // Due to the complexity, we just forbid allocations.
490 NoAllocationScope noAllocationScope(this); 490 NoAllocationScope noAllocationScope(this);
491 491
492 VisitorScope visitorScope(this, BlinkGC::ThreadLocalWeakProcessing); 492 OwnPtr<Visitor> visitor = Visitor::create(this, BlinkGC::ThreadLocalWeakProc essing);
493 493
494 // Perform thread-specific weak processing. 494 // Perform thread-specific weak processing.
495 while (popAndInvokeThreadLocalWeakCallback(visitorScope.visitor())) { } 495 while (popAndInvokeThreadLocalWeakCallback(visitor.get())) { }
496 496
497 m_threadLocalWeakCallbackStack->decommit(); 497 m_threadLocalWeakCallbackStack->decommit();
498 498
499 if (isMainThread()) { 499 if (isMainThread()) {
500 double timeForThreadLocalWeakProcessing = WTF::currentTimeMS() - startTi me; 500 double timeForThreadLocalWeakProcessing = WTF::currentTimeMS() - startTi me;
501 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeForWeakHistogram, ("BlinkG C.timeForThreadLocalWeakProcessing", 1, 10 * 1000, 50)); 501 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeForWeakHistogram, ("BlinkG C.timeForThreadLocalWeakProcessing", 1, 10 * 1000, 50));
502 timeForWeakHistogram.count(timeForThreadLocalWeakProcessing); 502 timeForWeakHistogram.count(timeForThreadLocalWeakProcessing);
503 } 503 }
504 } 504 }
505 505
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1538 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1539 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1539 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1540 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1540 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1541 1541
1542 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1542 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1543 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1543 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1544 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1544 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1545 } 1545 }
1546 1546
1547 } // namespace blink 1547 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/MarkingVisitor.h ('k') | third_party/WebKit/Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698