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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 void Heap::flushHeapDoesNotContainCache() | 153 void Heap::flushHeapDoesNotContainCache() |
| 154 { | 154 { |
| 155 s_heapDoesNotContainCache->flush(); | 155 s_heapDoesNotContainCache->flush(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void Heap::init() | 158 void Heap::init() |
| 159 { | 159 { |
| 160 ThreadState::init(); | 160 ThreadState::init(); |
| 161 s_markingStack = new CallbackStack(); | 161 s_markingStack = new CallbackStack(4096); |
|
sof
2016/02/14 21:47:03
These are fairly arbitrary numbers, are they based
| |
| 162 s_postMarkingCallbackStack = new CallbackStack(); | 162 s_postMarkingCallbackStack = new CallbackStack(128); |
| 163 s_globalWeakCallbackStack = new CallbackStack(); | 163 s_globalWeakCallbackStack = new CallbackStack(2048); |
| 164 s_ephemeronStack = new CallbackStack(); | 164 s_ephemeronStack = new CallbackStack(128); |
| 165 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); | 165 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); |
| 166 s_freePagePool = new FreePagePool(); | 166 s_freePagePool = new FreePagePool(); |
| 167 s_orphanedPagePool = new OrphanedPagePool(); | 167 s_orphanedPagePool = new OrphanedPagePool(); |
| 168 s_allocatedSpace = 0; | 168 s_allocatedSpace = 0; |
| 169 s_allocatedObjectSize = 0; | 169 s_allocatedObjectSize = 0; |
| 170 s_objectSizeAtLastGC = 0; | 170 s_objectSizeAtLastGC = 0; |
| 171 s_markedObjectSize = 0; | 171 s_markedObjectSize = 0; |
| 172 s_markedObjectSizeAtLastCompleteSweep = 0; | 172 s_markedObjectSizeAtLastCompleteSweep = 0; |
| 173 s_wrapperCount = 0; | 173 s_wrapperCount = 0; |
| 174 s_wrapperCountAtLastGC = 0; | 174 s_wrapperCountAtLastGC = 0; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 ASSERT(!ThreadState::current()->isInGC()); | 360 ASSERT(!ThreadState::current()->isInGC()); |
| 361 for (ThreadState* state : ThreadState::attachedThreads()) | 361 for (ThreadState* state : ThreadState::attachedThreads()) |
| 362 state->preGC(); | 362 state->preGC(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 void Heap::postGC(BlinkGC::GCType gcType) | 365 void Heap::postGC(BlinkGC::GCType gcType) |
| 366 { | 366 { |
| 367 ASSERT(ThreadState::current()->isInGC()); | 367 ASSERT(ThreadState::current()->isInGC()); |
| 368 for (ThreadState* state : ThreadState::attachedThreads()) | 368 for (ThreadState* state : ThreadState::attachedThreads()) |
| 369 state->postGC(gcType); | 369 state->postGC(gcType); |
| 370 | |
| 371 ASSERT(s_markingStack->isEmpty()); | |
| 372 ASSERT(s_postMarkingCallbackStack->isEmpty()); | |
| 373 ASSERT(s_globalWeakCallbackStack->isEmpty()); | |
| 374 ASSERT(s_ephemeronStack->isEmpty()); | |
| 370 } | 375 } |
| 371 | 376 |
| 372 const char* Heap::gcReasonString(BlinkGC::GCReason reason) | 377 const char* Heap::gcReasonString(BlinkGC::GCReason reason) |
| 373 { | 378 { |
| 374 switch (reason) { | 379 switch (reason) { |
| 375 case BlinkGC::IdleGC: | 380 case BlinkGC::IdleGC: |
| 376 return "IdleGC"; | 381 return "IdleGC"; |
| 377 case BlinkGC::PreciseGC: | 382 case BlinkGC::PreciseGC: |
| 378 return "PreciseGC"; | 383 return "PreciseGC"; |
| 379 case BlinkGC::ConservativeGC: | 384 case BlinkGC::ConservativeGC: |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 size_t Heap::s_wrapperCountAtLastGC = 0; | 731 size_t Heap::s_wrapperCountAtLastGC = 0; |
| 727 size_t Heap::s_collectedWrapperCount = 0; | 732 size_t Heap::s_collectedWrapperCount = 0; |
| 728 size_t Heap::s_partitionAllocSizeAtLastGC = 0; | 733 size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
| 729 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 734 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 730 bool Heap::s_isLowEndDevice = false; | 735 bool Heap::s_isLowEndDevice = false; |
| 731 #if ENABLE(ASSERT) | 736 #if ENABLE(ASSERT) |
| 732 uint16_t Heap::s_gcGeneration = 0; | 737 uint16_t Heap::s_gcGeneration = 0; |
| 733 #endif | 738 #endif |
| 734 | 739 |
| 735 } // namespace blink | 740 } // namespace blink |
| OLD | NEW |