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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 #endif | 1072 #endif |
1073 | 1073 |
1074 threadState()->shouldFlushHeapDoesNotContainCache(); | 1074 threadState()->shouldFlushHeapDoesNotContainCache(); |
1075 PageMemory* pageMemory = PageMemory::allocate(largeObjectSize); | 1075 PageMemory* pageMemory = PageMemory::allocate(largeObjectSize); |
1076 threadState()->allocatedRegionsSinceLastGC().append(pageMemory->region()); | 1076 threadState()->allocatedRegionsSinceLastGC().append(pageMemory->region()); |
1077 Address largeObjectAddress = pageMemory->writableStart(); | 1077 Address largeObjectAddress = pageMemory->writableStart(); |
1078 Address headerAddress = largeObjectAddress + sizeof(LargeObjectPage) + Large
ObjectPage::headerPadding(); | 1078 Address headerAddress = largeObjectAddress + sizeof(LargeObjectPage) + Large
ObjectPage::headerPadding(); |
1079 #if ENABLE(ASSERT) | 1079 #if ENABLE(ASSERT) |
1080 // Verify that the allocated PageMemory is expectedly zeroed. | 1080 // Verify that the allocated PageMemory is expectedly zeroed. |
1081 for (size_t i = 0; i < largeObjectSize; ++i) | 1081 for (size_t i = 0; i < largeObjectSize; ++i) |
1082 ASSERT(!headerAddress[i]); | 1082 ASSERT(!largeObjectAddress[i]); |
1083 #endif | 1083 #endif |
1084 ASSERT(gcInfoIndex > 0); | 1084 ASSERT(gcInfoIndex > 0); |
1085 HeapObjectHeader* header = new (NotNull, headerAddress) HeapObjectHeader(lar
geObjectSizeInHeader, gcInfoIndex); | 1085 HeapObjectHeader* header = new (NotNull, headerAddress) HeapObjectHeader(lar
geObjectSizeInHeader, gcInfoIndex); |
1086 Address result = headerAddress + sizeof(*header); | 1086 Address result = headerAddress + sizeof(*header); |
1087 ASSERT(!(reinterpret_cast<uintptr_t>(result) & allocationMask)); | 1087 ASSERT(!(reinterpret_cast<uintptr_t>(result) & allocationMask)); |
1088 LargeObjectPage* largeObject = new (largeObjectAddress) LargeObjectPage(page
Memory, this, allocationSize); | 1088 LargeObjectPage* largeObject = new (largeObjectAddress) LargeObjectPage(page
Memory, this, allocationSize); |
1089 header->checkHeader(); | 1089 header->checkHeader(); |
1090 | 1090 |
1091 // Poison the object header and allocationGranularity bytes after the object | 1091 // Poison the object header and allocationGranularity bytes after the object |
1092 ASAN_POISON_MEMORY_REGION(header, sizeof(*header)); | 1092 ASAN_POISON_MEMORY_REGION(header, sizeof(*header)); |
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2771 bool Heap::s_shutdownCalled = false; | 2771 bool Heap::s_shutdownCalled = false; |
2772 bool Heap::s_lastGCWasConservative = false; | 2772 bool Heap::s_lastGCWasConservative = false; |
2773 FreePagePool* Heap::s_freePagePool; | 2773 FreePagePool* Heap::s_freePagePool; |
2774 OrphanedPagePool* Heap::s_orphanedPagePool; | 2774 OrphanedPagePool* Heap::s_orphanedPagePool; |
2775 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2775 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2776 size_t Heap::s_allocatedObjectSize = 0; | 2776 size_t Heap::s_allocatedObjectSize = 0; |
2777 size_t Heap::s_allocatedSpace = 0; | 2777 size_t Heap::s_allocatedSpace = 0; |
2778 size_t Heap::s_markedObjectSize = 0; | 2778 size_t Heap::s_markedObjectSize = 0; |
2779 | 2779 |
2780 } // namespace blink | 2780 } // namespace blink |
OLD | NEW |