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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 using HeapTraits = HeapIndexTrait<VectorBackingHeap>; | 2711 using HeapTraits = HeapIndexTrait<VectorBackingHeap>; |
2712 return backingExpand<HeapTraits, HeapTraits::HeapType, HeapTraits::HeaderTyp
e>(address, newSize); | 2712 return backingExpand<HeapTraits, HeapTraits::HeapType, HeapTraits::HeaderTyp
e>(address, newSize); |
2713 } | 2713 } |
2714 | 2714 |
2715 bool HeapAllocator::expandInlineVectorBacking(void* address, size_t newSize) | 2715 bool HeapAllocator::expandInlineVectorBacking(void* address, size_t newSize) |
2716 { | 2716 { |
2717 using HeapTraits = HeapIndexTrait<InlineVectorBackingHeap>; | 2717 using HeapTraits = HeapIndexTrait<InlineVectorBackingHeap>; |
2718 return backingExpand<HeapTraits, HeapTraits::HeapType, HeapTraits::HeaderTyp
e>(address, newSize); | 2718 return backingExpand<HeapTraits, HeapTraits::HeapType, HeapTraits::HeaderTyp
e>(address, newSize); |
2719 } | 2719 } |
2720 | 2720 |
2721 bool HeapAllocator::expandHashTableBacking(void* address, size_t newSize) | |
2722 { | |
2723 typedef HeapIndexTrait<HashTableBackingHeap> HeapTraits; | |
2724 typedef HeapTraits::HeapType HeapType; | |
2725 typedef HeapTraits::HeaderType HeaderType; | |
2726 return backingExpand<HeapTraits, HeapType, HeaderType>(address, newSize); | |
2727 } | |
2728 | |
2729 template<typename HeapTraits> | 2721 template<typename HeapTraits> |
2730 void HeapAllocator::backingShrink(void* address, size_t quantizedCurrentSize, si
ze_t quantizedShrunkSize) | 2722 void HeapAllocator::backingShrink(void* address, size_t quantizedCurrentSize, si
ze_t quantizedShrunkSize) |
2731 { | 2723 { |
2732 // We shrink the object only if the shrinking will make a non-small | 2724 // We shrink the object only if the shrinking will make a non-small |
2733 // prompt-free block. | 2725 // prompt-free block. |
2734 // FIXME: Optimize the threshold size. | 2726 // FIXME: Optimize the threshold size. |
2735 if (quantizedCurrentSize <= quantizedShrunkSize + sizeof(HeapObjectHeader) +
sizeof(void*) * 32) | 2727 if (quantizedCurrentSize <= quantizedShrunkSize + sizeof(HeapObjectHeader) +
sizeof(void*) * 32) |
2736 return; | 2728 return; |
2737 | 2729 |
2738 ThreadState* state = ThreadState::current(); | 2730 ThreadState* state = ThreadState::current(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2876 bool Heap::s_shutdownCalled = false; | 2868 bool Heap::s_shutdownCalled = false; |
2877 bool Heap::s_lastGCWasConservative = false; | 2869 bool Heap::s_lastGCWasConservative = false; |
2878 FreePagePool* Heap::s_freePagePool; | 2870 FreePagePool* Heap::s_freePagePool; |
2879 OrphanedPagePool* Heap::s_orphanedPagePool; | 2871 OrphanedPagePool* Heap::s_orphanedPagePool; |
2880 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2872 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2881 size_t Heap::s_allocatedObjectSize = 0; | 2873 size_t Heap::s_allocatedObjectSize = 0; |
2882 size_t Heap::s_allocatedSpace = 0; | 2874 size_t Heap::s_allocatedSpace = 0; |
2883 size_t Heap::s_markedObjectSize = 0; | 2875 size_t Heap::s_markedObjectSize = 0; |
2884 | 2876 |
2885 } // namespace blink | 2877 } // namespace blink |
OLD | NEW |