Chromium Code Reviews| 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 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2012 | 2012 |
| 2013 // Disallow allocation during garbage collection (but not during the | 2013 // Disallow allocation during garbage collection (but not during the |
| 2014 // finalization that happens when the gcScope is torn down). | 2014 // finalization that happens when the gcScope is torn down). |
| 2015 ThreadState::NoAllocationScope noAllocationScope(state); | 2015 ThreadState::NoAllocationScope noAllocationScope(state); |
| 2016 | 2016 |
| 2017 preGC(); | 2017 preGC(); |
| 2018 | 2018 |
| 2019 StackFrameDepthScope stackDepthScope; | 2019 StackFrameDepthScope stackDepthScope; |
| 2020 | 2020 |
| 2021 size_t totalObjectSize = Heap::allocatedObjectSize() + Heap::markedObjectSiz e(); | 2021 size_t totalObjectSize = Heap::allocatedObjectSize() + Heap::markedObjectSiz e(); |
| 2022 Heap::resetHeapCounters(); | 2022 if (gcType == ThreadState::TakeSnapshot) |
|
ssid
2015/06/18 12:01:07
Do you mean != ?
With !=,
The allocatedObjectSize
haraken
2015/06/18 18:43:43
Nice catch!
| |
| 2023 Heap::resetHeapCounters(); | |
| 2023 | 2024 |
| 2024 // 1. Trace persistent roots. | 2025 // 1. Trace persistent roots. |
| 2025 ThreadState::visitPersistentRoots(gcScope.visitor()); | 2026 ThreadState::visitPersistentRoots(gcScope.visitor()); |
| 2026 | 2027 |
| 2027 // 2. Trace objects reachable from the stack. We do this independent of the | 2028 // 2. Trace objects reachable from the stack. We do this independent of the |
| 2028 // given stackState since other threads might have a different stack state. | 2029 // given stackState since other threads might have a different stack state. |
| 2029 ThreadState::visitStackRoots(gcScope.visitor()); | 2030 ThreadState::visitStackRoots(gcScope.visitor()); |
| 2030 | 2031 |
| 2031 // 3. Transitive closure to trace objects including ephemerons. | 2032 // 3. Transitive closure to trace objects including ephemerons. |
| 2032 processMarkingStack(gcScope.visitor()); | 2033 processMarkingStack(gcScope.visitor()); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2322 size_t Heap::s_allocatedObjectSize = 0; | 2323 size_t Heap::s_allocatedObjectSize = 0; |
| 2323 size_t Heap::s_allocatedSpace = 0; | 2324 size_t Heap::s_allocatedSpace = 0; |
| 2324 size_t Heap::s_markedObjectSize = 0; | 2325 size_t Heap::s_markedObjectSize = 0; |
| 2325 // We don't want to use 0 KB for the initial value because it may end up | 2326 // We don't want to use 0 KB for the initial value because it may end up |
| 2326 // triggering the first GC of some thread too prematurely. | 2327 // triggering the first GC of some thread too prematurely. |
| 2327 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; | 2328 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; |
| 2328 size_t Heap::s_externalObjectSizeAtLastGC = 0; | 2329 size_t Heap::s_externalObjectSizeAtLastGC = 0; |
| 2329 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 2330 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 2330 | 2331 |
| 2331 } // namespace blink | 2332 } // namespace blink |
| OLD | NEW |