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

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

Issue 2036803004: Reset ThreadState weak callback stack before GCing. (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/CallbackStack.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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 m_arenas[i]->makeConsistentForMutator(); 957 m_arenas[i]->makeConsistentForMutator();
958 } 958 }
959 959
960 void ThreadState::preGC() 960 void ThreadState::preGC()
961 { 961 {
962 ASSERT(!isInGC()); 962 ASSERT(!isInGC());
963 setGCState(GCRunning); 963 setGCState(GCRunning);
964 makeConsistentForGC(); 964 makeConsistentForGC();
965 flushHeapDoesNotContainCacheIfNeeded(); 965 flushHeapDoesNotContainCacheIfNeeded();
966 clearArenaAges(); 966 clearArenaAges();
967 m_threadLocalWeakCallbackStack->clear();
967 } 968 }
968 969
969 void ThreadState::postGC(BlinkGC::GCType gcType) 970 void ThreadState::postGC(BlinkGC::GCType gcType)
970 { 971 {
971 ASSERT(isInGC()); 972 ASSERT(isInGC());
972 for (int i = 0; i < BlinkGC::NumberOfArenas; i++) 973 for (int i = 0; i < BlinkGC::NumberOfArenas; i++)
973 m_arenas[i]->prepareForSweep(); 974 m_arenas[i]->prepareForSweep();
974 975
975 if (gcType == BlinkGC::GCWithSweep) { 976 if (gcType == BlinkGC::GCWithSweep) {
976 setGCState(EagerSweepScheduled); 977 setGCState(EagerSweepScheduled);
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 threadDump->AddScalar("dead_count", "objects", totalDeadCount); 1529 threadDump->AddScalar("dead_count", "objects", totalDeadCount);
1529 threadDump->AddScalar("live_size", "bytes", totalLiveSize); 1530 threadDump->AddScalar("live_size", "bytes", totalLiveSize);
1530 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); 1531 threadDump->AddScalar("dead_size", "bytes", totalDeadSize);
1531 1532
1532 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1533 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1533 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1534 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1534 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1535 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid());
1535 } 1536 }
1536 1537
1537 } // namespace blink 1538 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/CallbackStack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698