| 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 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2373 #if ENABLE(GC_PROFILE_MARKING) | 2373 #if ENABLE(GC_PROFILE_MARKING) |
| 2374 const GCInfo* Heap::findGCInfo(Address address) | 2374 const GCInfo* Heap::findGCInfo(Address address) |
| 2375 { | 2375 { |
| 2376 return ThreadState::findGCInfoFromAllThreads(address); | 2376 return ThreadState::findGCInfoFromAllThreads(address); |
| 2377 } | 2377 } |
| 2378 #endif | 2378 #endif |
| 2379 | 2379 |
| 2380 #if ENABLE(GC_PROFILE_MARKING) | 2380 #if ENABLE(GC_PROFILE_MARKING) |
| 2381 void Heap::dumpPathToObjectOnNextGC(void* p) | 2381 void Heap::dumpPathToObjectOnNextGC(void* p) |
| 2382 { | 2382 { |
| 2383 static_cast<MarkingVisitor*>(s_markingVisitor)->dumpPathToObjectOnNextGC(p); | 2383 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->dumpPathToObj
ectOnNextGC(p); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 String Heap::createBacktraceString() | 2386 String Heap::createBacktraceString() |
| 2387 { | 2387 { |
| 2388 int framesToShow = 3; | 2388 int framesToShow = 3; |
| 2389 int stackFrameSize = 16; | 2389 int stackFrameSize = 16; |
| 2390 ASSERT(stackFrameSize >= framesToShow); | 2390 ASSERT(stackFrameSize >= framesToShow); |
| 2391 typedef void* FramePointer; | 2391 typedef void* FramePointer; |
| 2392 FramePointer* stackFrame = static_cast<FramePointer*>(alloca(sizeof(FramePoi
nter) * stackFrameSize)); | 2392 FramePointer* stackFrame = static_cast<FramePointer*>(alloca(sizeof(FramePoi
nter) * stackFrameSize)); |
| 2393 WTFGetBacktrace(stackFrame, &stackFrameSize); | 2393 WTFGetBacktrace(stackFrame, &stackFrameSize); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2541 ScriptForbiddenScope::enter(); | 2541 ScriptForbiddenScope::enter(); |
| 2542 | 2542 |
| 2543 s_lastGCWasConservative = false; | 2543 s_lastGCWasConservative = false; |
| 2544 | 2544 |
| 2545 TRACE_EVENT2("blink_gc", "Heap::collectGarbage", | 2545 TRACE_EVENT2("blink_gc", "Heap::collectGarbage", |
| 2546 "precise", stackState == ThreadState::NoHeapPointersOnStack, | 2546 "precise", stackState == ThreadState::NoHeapPointersOnStack, |
| 2547 "forced", gcType == ThreadState::ForcedGC); | 2547 "forced", gcType == ThreadState::ForcedGC); |
| 2548 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink_gc", "BlinkGC"); | 2548 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink_gc", "BlinkGC"); |
| 2549 double timeStamp = WTF::currentTimeMS(); | 2549 double timeStamp = WTF::currentTimeMS(); |
| 2550 #if ENABLE(GC_PROFILE_MARKING) | 2550 #if ENABLE(GC_PROFILE_MARKING) |
| 2551 static_cast<MarkingVisitor*>(s_markingVisitor)->objectGraph().clear(); | 2551 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); |
| 2552 #endif | 2552 #endif |
| 2553 | 2553 |
| 2554 // Disallow allocation during garbage collection (but not | 2554 // Disallow allocation during garbage collection (but not |
| 2555 // during the finalization that happens when the gcScope is | 2555 // during the finalization that happens when the gcScope is |
| 2556 // torn down). | 2556 // torn down). |
| 2557 ThreadState::NoAllocationScope noAllocationScope(state); | 2557 ThreadState::NoAllocationScope noAllocationScope(state); |
| 2558 | 2558 |
| 2559 enterGC(); | 2559 enterGC(); |
| 2560 preGC(); | 2560 preGC(); |
| 2561 | 2561 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2583 | 2583 |
| 2584 // Now we can delete all orphaned pages because there are no dangling | 2584 // Now we can delete all orphaned pages because there are no dangling |
| 2585 // pointers to the orphaned pages. (If we have such dangling pointers, | 2585 // pointers to the orphaned pages. (If we have such dangling pointers, |
| 2586 // we should have crashed during marking before getting here.) | 2586 // we should have crashed during marking before getting here.) |
| 2587 orphanedPagePool()->decommitOrphanedPages(); | 2587 orphanedPagePool()->decommitOrphanedPages(); |
| 2588 | 2588 |
| 2589 postGC(); | 2589 postGC(); |
| 2590 leaveGC(); | 2590 leaveGC(); |
| 2591 | 2591 |
| 2592 #if ENABLE(GC_PROFILE_MARKING) | 2592 #if ENABLE(GC_PROFILE_MARKING) |
| 2593 static_cast<MarkingVisitor*>(s_markingVisitor)->reportStats(); | 2593 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->reportStats()
; |
| 2594 #endif | 2594 #endif |
| 2595 | 2595 |
| 2596 if (Platform::current()) { | 2596 if (Platform::current()) { |
| 2597 Platform::current()->histogramCustomCounts("BlinkGC.CollectGarbage", WTF
::currentTimeMS() - timeStamp, 0, 10 * 1000, 50); | 2597 Platform::current()->histogramCustomCounts("BlinkGC.CollectGarbage", WTF
::currentTimeMS() - timeStamp, 0, 10 * 1000, 50); |
| 2598 Platform::current()->histogramCustomCounts("BlinkGC.TotalObjectSpace", H
eap::allocatedObjectSize() / 1024, 0, 4 * 1024 * 1024, 50); | 2598 Platform::current()->histogramCustomCounts("BlinkGC.TotalObjectSpace", H
eap::allocatedObjectSize() / 1024, 0, 4 * 1024 * 1024, 50); |
| 2599 Platform::current()->histogramCustomCounts("BlinkGC.TotalAllocatedSpace"
, Heap::allocatedSpace() / 1024, 0, 4 * 1024 * 1024, 50); | 2599 Platform::current()->histogramCustomCounts("BlinkGC.TotalAllocatedSpace"
, Heap::allocatedSpace() / 1024, 0, 4 * 1024 * 1024, 50); |
| 2600 } | 2600 } |
| 2601 | 2601 |
| 2602 if (state->isMainThread()) | 2602 if (state->isMainThread()) |
| 2603 ScriptForbiddenScope::exit(); | 2603 ScriptForbiddenScope::exit(); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 bool Heap::s_lastGCWasConservative = false; | 2946 bool Heap::s_lastGCWasConservative = false; |
| 2947 bool Heap::s_inGC = false; | 2947 bool Heap::s_inGC = false; |
| 2948 FreePagePool* Heap::s_freePagePool; | 2948 FreePagePool* Heap::s_freePagePool; |
| 2949 OrphanedPagePool* Heap::s_orphanedPagePool; | 2949 OrphanedPagePool* Heap::s_orphanedPagePool; |
| 2950 Heap::RegionTree* Heap::s_regionTree = 0; | 2950 Heap::RegionTree* Heap::s_regionTree = 0; |
| 2951 size_t Heap::s_allocatedObjectSize = 0; | 2951 size_t Heap::s_allocatedObjectSize = 0; |
| 2952 size_t Heap::s_allocatedSpace = 0; | 2952 size_t Heap::s_allocatedSpace = 0; |
| 2953 size_t Heap::s_markedObjectSize = 0; | 2953 size_t Heap::s_markedObjectSize = 0; |
| 2954 | 2954 |
| 2955 } // namespace blink | 2955 } // namespace blink |
| OLD | NEW |