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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 635 |
636 bool gcTracingEnabled; | 636 bool gcTracingEnabled; |
637 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink_gc", &gcTracingEnabled); | 637 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink_gc", &gcTracingEnabled); |
638 if (!gcTracingEnabled) | 638 if (!gcTracingEnabled) |
639 return; | 639 return; |
640 | 640 |
641 // These values are divided by 1024 to avoid overflow in practical cases (TR
ACE_COUNTER values are 32-bit ints). | 641 // These values are divided by 1024 to avoid overflow in practical cases (TR
ACE_COUNTER values are 32-bit ints). |
642 // They are capped to INT_MAX just in case. | 642 // They are capped to INT_MAX just in case. |
643 TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::all
ocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX))); | 643 TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::all
ocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX))); |
644 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::marked
ObjectSize() / 1024, static_cast<size_t>(INT_MAX))); | 644 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::marked
ObjectSize() / 1024, static_cast<size_t>(INT_MAX))); |
645 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeAtLastCompleteSweepKB", st
d::min(Heap::markedObjectSizeAtLastCompleteSweep() / 1024, static_cast<size_t>(I
NT_MAX))); | 645 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::markedObjectSiz
eAtLastCompleteSweepKB", std::min(Heap::markedObjectSizeAtLastCompleteSweep() /
1024, static_cast<size_t>(INT_MAX))); |
646 TRACE_COUNTER1("blink_gc", "Heap::allocatedSpaceKB", std::min(Heap::allocate
dSpace() / 1024, static_cast<size_t>(INT_MAX))); | 646 TRACE_COUNTER1("blink_gc", "Heap::allocatedSpaceKB", std::min(Heap::allocate
dSpace() / 1024, static_cast<size_t>(INT_MAX))); |
647 TRACE_COUNTER1("blink_gc", "Heap::objectSizeAtLastGCKB", std::min(Heap::obje
ctSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); | 647 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::objectSizeAtLas
tGCKB", std::min(Heap::objectSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX)
)); |
648 TRACE_COUNTER1("blink_gc", "Heap::wrapperCount", std::min(Heap::wrapperCount
(), static_cast<size_t>(INT_MAX))); | 648 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::wrapperCount",
std::min(Heap::wrapperCount(), static_cast<size_t>(INT_MAX))); |
649 TRACE_COUNTER1("blink_gc", "Heap::wrapperCountAtLastGC", std::min(Heap::wrap
perCountAtLastGC(), static_cast<size_t>(INT_MAX))); | 649 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::wrapperCountAtL
astGC", std::min(Heap::wrapperCountAtLastGC(), static_cast<size_t>(INT_MAX))); |
650 TRACE_COUNTER1("blink_gc", "Heap::collectedWrapperCount", std::min(Heap::col
lectedWrapperCount(), static_cast<size_t>(INT_MAX))); | 650 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::collectedWrappe
rCount", std::min(Heap::collectedWrapperCount(), static_cast<size_t>(INT_MAX))); |
651 TRACE_COUNTER1("blink_gc", "Heap::partitionAllocSizeAtLastGCKB", std::min(He
ap::partitionAllocSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); | 651 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink_gc"), "Heap::partitionAllocS
izeAtLastGCKB", std::min(Heap::partitionAllocSizeAtLastGC() / 1024, static_cast<
size_t>(INT_MAX))); |
652 TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::m
in(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_
MAX))); | 652 TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::m
in(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_
MAX))); |
653 } | 653 } |
654 | 654 |
655 size_t Heap::objectPayloadSizeForTesting() | 655 size_t Heap::objectPayloadSizeForTesting() |
656 { | 656 { |
657 size_t objectPayloadSize = 0; | 657 size_t objectPayloadSize = 0; |
658 for (ThreadState* state : ThreadState::attachedThreads()) { | 658 for (ThreadState* state : ThreadState::attachedThreads()) { |
659 state->setGCState(ThreadState::GCRunning); | 659 state->setGCState(ThreadState::GCRunning); |
660 state->makeConsistentForGC(); | 660 state->makeConsistentForGC(); |
661 objectPayloadSize += state->objectPayloadSizeForTesting(); | 661 objectPayloadSize += state->objectPayloadSizeForTesting(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 size_t Heap::s_objectSizeAtLastGC = 0; | 786 size_t Heap::s_objectSizeAtLastGC = 0; |
787 size_t Heap::s_markedObjectSize = 0; | 787 size_t Heap::s_markedObjectSize = 0; |
788 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; | 788 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; |
789 size_t Heap::s_wrapperCount = 0; | 789 size_t Heap::s_wrapperCount = 0; |
790 size_t Heap::s_wrapperCountAtLastGC = 0; | 790 size_t Heap::s_wrapperCountAtLastGC = 0; |
791 size_t Heap::s_collectedWrapperCount = 0; | 791 size_t Heap::s_collectedWrapperCount = 0; |
792 size_t Heap::s_partitionAllocSizeAtLastGC = 0; | 792 size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
793 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 793 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
794 | 794 |
795 } // namespace blink | 795 } // namespace blink |
OLD | NEW |