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

Side by Side Diff: Source/platform/heap/Heap.h

Issue 1150563005: Oilpan: ASan-exempt Heap::willObjectBeLazilySwept(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | « Source/platform/Timer.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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 820
821 // Is the finalizable GC object still alive, but slated for lazy sweeping? 821 // Is the finalizable GC object still alive, but slated for lazy sweeping?
822 // If a lazy sweep is in progress, returns true if the object was found 822 // If a lazy sweep is in progress, returns true if the object was found
823 // to be not reachable during the marking phase, but it has yet to be swept 823 // to be not reachable during the marking phase, but it has yet to be swept
824 // and finalized. The predicate returns false in all other cases. 824 // and finalized. The predicate returns false in all other cases.
825 // 825 //
826 // Holding a reference to an already-dead object is not a valid state 826 // Holding a reference to an already-dead object is not a valid state
827 // to be in; willObjectBeLazilySwept() has undefined behavior if passed 827 // to be in; willObjectBeLazilySwept() has undefined behavior if passed
828 // such a reference. 828 // such a reference.
829 template<typename T> 829 template<typename T>
830 NO_LAZY_SWEEP_SANITIZE_ADDRESS
830 static bool willObjectBeLazilySwept(const T* objectPointer) 831 static bool willObjectBeLazilySwept(const T* objectPointer)
831 { 832 {
832 static_assert(IsGarbageCollectedType<T>::value, "only objects deriving f rom GarbageCollected can be used."); 833 static_assert(IsGarbageCollectedType<T>::value, "only objects deriving f rom GarbageCollected can be used.");
833 #if ENABLE(OILPAN) 834 #if ENABLE(OILPAN)
834 BasePage* page = pageFromObject(objectPointer); 835 BasePage* page = pageFromObject(objectPointer);
835 if (page->hasBeenSwept()) 836 if (page->hasBeenSwept())
836 return false; 837 return false;
837 ASSERT(page->heap()->threadState()->isSweepingInProgress()); 838 ASSERT(page->heap()->threadState()->isSweepingInProgress());
838 839
839 return !ObjectAliveTrait<T>::isHeapObjectAlive(s_markingVisitor, const_c ast<T*>(objectPointer)); 840 return !ObjectAliveTrait<T>::isHeapObjectAlive(s_markingVisitor, const_c ast<T*>(objectPointer));
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 size_t copySize = previousHeader->payloadSize(); 1267 size_t copySize = previousHeader->payloadSize();
1267 if (copySize > size) 1268 if (copySize > size)
1268 copySize = size; 1269 copySize = size;
1269 memcpy(address, previous, copySize); 1270 memcpy(address, previous, copySize);
1270 return address; 1271 return address;
1271 } 1272 }
1272 1273
1273 } // namespace blink 1274 } // namespace blink
1274 1275
1275 #endif // Heap_h 1276 #endif // Heap_h
OLDNEW
« no previous file with comments | « Source/platform/Timer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698