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

Side by Side Diff: Source/platform/heap/Heap.cpp

Issue 1158243004: Fix nested parking of threads while setting up a garbage collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 RELEASE_ASSERT(!state->isInGC()); 1875 RELEASE_ASSERT(!state->isInGC());
1876 state->completeSweep(); 1876 state->completeSweep();
1877 ThreadState::GCState originalGCState = state->gcState(); 1877 ThreadState::GCState originalGCState = state->gcState();
1878 state->setGCState(ThreadState::StoppingOtherThreads); 1878 state->setGCState(ThreadState::StoppingOtherThreads);
1879 1879
1880 GCScope gcScope(stackState); 1880 GCScope gcScope(stackState);
1881 // Check if we successfully parked the other threads. If not we bail out of 1881 // Check if we successfully parked the other threads. If not we bail out of
1882 // the GC. 1882 // the GC.
1883 if (!gcScope.allThreadsParked()) { 1883 if (!gcScope.allThreadsParked()) {
1884 // Restore the original GCState. 1884 // Restore the original GCState.
1885 state->setGCState(originalGCState); 1885 if (LIKELY(state->gcState() == ThreadState::StoppingOtherThreads))
1886 state->setGCState(originalGCState);
1886 return; 1887 return;
1887 } 1888 }
1888 1889
1889 if (state->isMainThread()) 1890 if (state->isMainThread())
1890 ScriptForbiddenScope::enter(); 1891 ScriptForbiddenScope::enter();
1891 1892
1892 s_lastGCWasConservative = false; 1893 s_lastGCWasConservative = false;
1893 1894
1894 TRACE_EVENT2("blink_gc", "Heap::collectGarbage", 1895 TRACE_EVENT2("blink_gc", "Heap::collectGarbage",
1895 "lazySweeping", gcType == ThreadState::GCWithoutSweep, 1896 "lazySweeping", gcType == ThreadState::GCWithoutSweep,
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 size_t Heap::s_allocatedObjectSize = 0; 2224 size_t Heap::s_allocatedObjectSize = 0;
2224 size_t Heap::s_allocatedSpace = 0; 2225 size_t Heap::s_allocatedSpace = 0;
2225 size_t Heap::s_markedObjectSize = 0; 2226 size_t Heap::s_markedObjectSize = 0;
2226 // We don't want to use 0 KB for the initial value because it may end up 2227 // We don't want to use 0 KB for the initial value because it may end up
2227 // triggering the first GC of some thread too prematurely. 2228 // triggering the first GC of some thread too prematurely.
2228 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; 2229 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024;
2229 size_t Heap::s_externalObjectSizeAtLastGC = 0; 2230 size_t Heap::s_externalObjectSizeAtLastGC = 0;
2230 double Heap::s_estimatedMarkingTimePerByte = 0.0; 2231 double Heap::s_estimatedMarkingTimePerByte = 0.0;
2231 2232
2232 } // namespace blink 2233 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698