| OLD | NEW |
| 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 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 #undef STRINGIFY_REASON | 1871 #undef STRINGIFY_REASON |
| 1872 case NumberOfGCReason: ASSERT_NOT_REACHED(); | 1872 case NumberOfGCReason: ASSERT_NOT_REACHED(); |
| 1873 } | 1873 } |
| 1874 return "<Unknown>"; | 1874 return "<Unknown>"; |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 void Heap::collectGarbage(ThreadState::StackState stackState, ThreadState::GCTyp
e gcType, GCReason reason) | 1877 void Heap::collectGarbage(ThreadState::StackState stackState, ThreadState::GCTyp
e gcType, GCReason reason) |
| 1878 { | 1878 { |
| 1879 ThreadState* state = ThreadState::current(); | 1879 ThreadState* state = ThreadState::current(); |
| 1880 RELEASE_ASSERT(!state->isInGC()); | 1880 RELEASE_ASSERT(!state->isInGC()); |
| 1881 state->completeSweep(); |
| 1881 ThreadState::GCState originalGCState = state->gcState(); | 1882 ThreadState::GCState originalGCState = state->gcState(); |
| 1882 state->setGCState(ThreadState::StoppingOtherThreads); | 1883 state->setGCState(ThreadState::StoppingOtherThreads); |
| 1883 | 1884 |
| 1884 GCScope gcScope(stackState); | 1885 GCScope gcScope(stackState); |
| 1885 // Check if we successfully parked the other threads. If not we bail out of | 1886 // Check if we successfully parked the other threads. If not we bail out of |
| 1886 // the GC. | 1887 // the GC. |
| 1887 if (!gcScope.allThreadsParked()) { | 1888 if (!gcScope.allThreadsParked()) { |
| 1888 // Restore the original GCState. | 1889 // Restore the original GCState. |
| 1889 state->setGCState(originalGCState); | 1890 state->setGCState(originalGCState); |
| 1890 return; | 1891 return; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 size_t Heap::s_allocatedObjectSize = 0; | 2228 size_t Heap::s_allocatedObjectSize = 0; |
| 2228 size_t Heap::s_allocatedSpace = 0; | 2229 size_t Heap::s_allocatedSpace = 0; |
| 2229 size_t Heap::s_markedObjectSize = 0; | 2230 size_t Heap::s_markedObjectSize = 0; |
| 2230 // We don't want to use 0 KB for the initial value because it may end up | 2231 // We don't want to use 0 KB for the initial value because it may end up |
| 2231 // triggering the first GC of some thread too prematurely. | 2232 // triggering the first GC of some thread too prematurely. |
| 2232 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; | 2233 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; |
| 2233 size_t Heap::s_externalObjectSizeAtLastGC = 0; | 2234 size_t Heap::s_externalObjectSizeAtLastGC = 0; |
| 2234 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 2235 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 2235 | 2236 |
| 2236 } // namespace blink | 2237 } // namespace blink |
| OLD | NEW |