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

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

Issue 1141543002: Oilpan: add release assert to catch nested GCs. (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 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2259 STRINGIFY_REASON(ForcedGC); 2259 STRINGIFY_REASON(ForcedGC);
2260 #undef STRINGIFY_REASON 2260 #undef STRINGIFY_REASON
2261 case NumberOfGCReason: ASSERT_NOT_REACHED(); 2261 case NumberOfGCReason: ASSERT_NOT_REACHED();
2262 } 2262 }
2263 return "<Unknown>"; 2263 return "<Unknown>";
2264 } 2264 }
2265 2265
2266 void Heap::collectGarbage(ThreadState::StackState stackState, ThreadState::GCTyp e gcType, GCReason reason) 2266 void Heap::collectGarbage(ThreadState::StackState stackState, ThreadState::GCTyp e gcType, GCReason reason)
2267 { 2267 {
2268 ThreadState* state = ThreadState::current(); 2268 ThreadState* state = ThreadState::current();
2269 RELEASE_ASSERT(!state->isInGC());
2269 ThreadState::GCState originalGCState = state->gcState(); 2270 ThreadState::GCState originalGCState = state->gcState();
2270 state->setGCState(ThreadState::StoppingOtherThreads); 2271 state->setGCState(ThreadState::StoppingOtherThreads);
2271 2272
2272 GCScope gcScope(stackState); 2273 GCScope gcScope(stackState);
2273 // Check if we successfully parked the other threads. If not we bail out of 2274 // Check if we successfully parked the other threads. If not we bail out of
2274 // the GC. 2275 // the GC.
2275 if (!gcScope.allThreadsParked()) { 2276 if (!gcScope.allThreadsParked()) {
2276 // Restore the original GCState. 2277 // Restore the original GCState.
2277 state->setGCState(originalGCState); 2278 state->setGCState(originalGCState);
2278 return; 2279 return;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 size_t Heap::s_allocatedObjectSize = 0; 2616 size_t Heap::s_allocatedObjectSize = 0;
2616 size_t Heap::s_allocatedSpace = 0; 2617 size_t Heap::s_allocatedSpace = 0;
2617 size_t Heap::s_markedObjectSize = 0; 2618 size_t Heap::s_markedObjectSize = 0;
2618 // We don't want to use 0 KB for the initial value because it may end up 2619 // We don't want to use 0 KB for the initial value because it may end up
2619 // triggering the first GC of some thread too prematurely. 2620 // triggering the first GC of some thread too prematurely.
2620 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; 2621 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024;
2621 size_t Heap::s_externalObjectSizeAtLastGC = 0; 2622 size_t Heap::s_externalObjectSizeAtLastGC = 0;
2622 double Heap::s_estimatedMarkingTimePerByte = 0.0; 2623 double Heap::s_estimatedMarkingTimePerByte = 0.0;
2623 2624
2624 } // namespace blink 2625 } // 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