| 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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 // Don't shrink backings allocated on other threads. | 2731 // Don't shrink backings allocated on other threads. |
| 2732 BasePage* page = pageFromObject(address); | 2732 BasePage* page = pageFromObject(address); |
| 2733 if (page->isLargeObjectPage() || page->heap()->threadState() != state) | 2733 if (page->isLargeObjectPage() || page->heap()->threadState() != state) |
| 2734 return; | 2734 return; |
| 2735 | 2735 |
| 2736 HeapObjectHeader* header = HeapObjectHeader::fromPayload(address); | 2736 HeapObjectHeader* header = HeapObjectHeader::fromPayload(address); |
| 2737 header->checkHeader(); | 2737 header->checkHeader(); |
| 2738 static_cast<NormalPage*>(page)->heapForNormalPage()->shrinkObject(header, qu
antizedShrunkSize); | 2738 static_cast<NormalPage*>(page)->heapForNormalPage()->shrinkObject(header, qu
antizedShrunkSize); |
| 2739 } | 2739 } |
| 2740 | 2740 |
| 2741 bool HeapAllocator::shrinkVectorBacking(void* address, size_t quantizedCurrentSi
ze, size_t quantizedShrunkSize) | |
| 2742 { | |
| 2743 backingShrink(address, quantizedCurrentSize, quantizedShrunkSize); | |
| 2744 return true; | |
| 2745 } | |
| 2746 | |
| 2747 bool HeapAllocator::shrinkInlineVectorBacking(void* address, size_t quantizedCur
rentSize, size_t quantizedShrunkSize) | |
| 2748 { | |
| 2749 backingShrink(address, quantizedCurrentSize, quantizedShrunkSize); | |
| 2750 return true; | |
| 2751 } | |
| 2752 | |
| 2753 BasePage* Heap::lookup(Address address) | 2741 BasePage* Heap::lookup(Address address) |
| 2754 { | 2742 { |
| 2755 ASSERT(ThreadState::current()->isInGC()); | 2743 ASSERT(ThreadState::current()->isInGC()); |
| 2756 if (!s_regionTree) | 2744 if (!s_regionTree) |
| 2757 return nullptr; | 2745 return nullptr; |
| 2758 if (PageMemoryRegion* region = s_regionTree->lookup(address)) { | 2746 if (PageMemoryRegion* region = s_regionTree->lookup(address)) { |
| 2759 BasePage* page = region->pageFromAddress(address); | 2747 BasePage* page = region->pageFromAddress(address); |
| 2760 return page && !page->orphaned() ? page : nullptr; | 2748 return page && !page->orphaned() ? page : nullptr; |
| 2761 } | 2749 } |
| 2762 return nullptr; | 2750 return nullptr; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2868 Heap::RegionTree* Heap::s_regionTree = nullptr; |
| 2881 size_t Heap::s_allocatedObjectSize = 0; | 2869 size_t Heap::s_allocatedObjectSize = 0; |
| 2882 size_t Heap::s_allocatedSpace = 0; | 2870 size_t Heap::s_allocatedSpace = 0; |
| 2883 size_t Heap::s_markedObjectSize = 0; | 2871 size_t Heap::s_markedObjectSize = 0; |
| 2884 | 2872 |
| 2885 size_t Heap::s_externallyAllocatedBytes = 0; | 2873 size_t Heap::s_externallyAllocatedBytes = 0; |
| 2886 size_t Heap::s_externallyAllocatedBytesAlive = 0; | 2874 size_t Heap::s_externallyAllocatedBytesAlive = 0; |
| 2887 unsigned Heap::s_requestedUrgentGC = false; | 2875 unsigned Heap::s_requestedUrgentGC = false; |
| 2888 | 2876 |
| 2889 } // namespace blink | 2877 } // namespace blink |
| OLD | NEW |