Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapPage.cpp

Issue 1676973002: Introduce HeapAllocHooks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: haraken's review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 NO_SANITIZE_ADDRESS 91 NO_SANITIZE_ADDRESS
92 void HeapObjectHeader::zapMagic() 92 void HeapObjectHeader::zapMagic()
93 { 93 {
94 ASSERT(checkHeader()); 94 ASSERT(checkHeader());
95 m_magic = zappedMagic; 95 m_magic = zappedMagic;
96 } 96 }
97 #endif 97 #endif
98 98
99 void HeapObjectHeader::finalize(Address object, size_t objectSize) 99 void HeapObjectHeader::finalize(Address object, size_t objectSize)
100 { 100 {
101 HeapAllocHooks::freeHookIfEnabled(object);
101 const GCInfo* gcInfo = Heap::gcInfo(gcInfoIndex()); 102 const GCInfo* gcInfo = Heap::gcInfo(gcInfoIndex());
102 if (gcInfo->hasFinalizer()) 103 if (gcInfo->hasFinalizer())
103 gcInfo->m_finalize(object); 104 gcInfo->m_finalize(object);
104 105
105 ASAN_RETIRE_CONTAINER_ANNOTATION(object, objectSize); 106 ASAN_RETIRE_CONTAINER_ANNOTATION(object, objectSize);
106 } 107 }
107 108
108 BaseHeap::BaseHeap(ThreadState* state, int index) 109 BaseHeap::BaseHeap(ThreadState* state, int index)
109 : m_firstPage(nullptr) 110 : m_firstPage(nullptr)
110 , m_firstUnsweptPage(nullptr) 111 , m_firstUnsweptPage(nullptr)
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 1603
1603 m_hasEntries = true; 1604 m_hasEntries = true;
1604 size_t index = hash(address); 1605 size_t index = hash(address);
1605 ASSERT(!(index & 1)); 1606 ASSERT(!(index & 1));
1606 Address cachePage = roundToBlinkPageStart(address); 1607 Address cachePage = roundToBlinkPageStart(address);
1607 m_entries[index + 1] = m_entries[index]; 1608 m_entries[index + 1] = m_entries[index];
1608 m_entries[index] = cachePage; 1609 m_entries[index] = cachePage;
1609 } 1610 }
1610 1611
1611 } // namespace blink 1612 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698