Chromium Code Reviews| 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 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2118 | 2118 |
| 2119 #if !ENABLE(ASSERT) | 2119 #if !ENABLE(ASSERT) |
| 2120 s_heapDoesNotContainCache->addEntry(address); | 2120 s_heapDoesNotContainCache->addEntry(address); |
| 2121 #else | 2121 #else |
| 2122 if (!s_heapDoesNotContainCache->lookup(address)) | 2122 if (!s_heapDoesNotContainCache->lookup(address)) |
| 2123 s_heapDoesNotContainCache->addEntry(address); | 2123 s_heapDoesNotContainCache->addEntry(address); |
| 2124 #endif | 2124 #endif |
| 2125 return nullptr; | 2125 return nullptr; |
| 2126 } | 2126 } |
| 2127 | 2127 |
| 2128 bool Heap::isObjectAlive(const void* objectPointer) | |
| 2129 { | |
| 2130 if (!ThreadState::current()->isSweepingInProgress()) | |
| 2131 return true; | |
| 2132 | |
| 2133 return s_markingVisitor->isMarked(objectPointer); | |
|
haraken
2015/01/14 14:29:08
Hmm, what happens in the following case?
(1) Mark
sof
2015/01/14 14:36:19
I suppose we can look at the page & see if it has
haraken
2015/01/14 14:37:44
That would work :)
Also should we use isMarked or
sof
2015/01/14 15:53:32
Actually, if we constrain ourselves to GC objects
sof
2015/01/14 16:06:01
Renamed to isFinalizedObjectAlive() + clarified th
| |
| 2134 } | |
| 2135 | |
| 2128 #if ENABLE(GC_PROFILE_MARKING) | 2136 #if ENABLE(GC_PROFILE_MARKING) |
| 2129 const GCInfo* Heap::findGCInfo(Address address) | 2137 const GCInfo* Heap::findGCInfo(Address address) |
| 2130 { | 2138 { |
| 2131 return ThreadState::findGCInfoFromAllThreads(address); | 2139 return ThreadState::findGCInfoFromAllThreads(address); |
| 2132 } | 2140 } |
| 2133 #endif | 2141 #endif |
| 2134 | 2142 |
| 2135 #if ENABLE(GC_PROFILE_MARKING) | 2143 #if ENABLE(GC_PROFILE_MARKING) |
| 2136 void Heap::dumpPathToObjectOnNextGC(void* p) | 2144 void Heap::dumpPathToObjectOnNextGC(void* p) |
| 2137 { | 2145 { |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2686 bool Heap::s_shutdownCalled = false; | 2694 bool Heap::s_shutdownCalled = false; |
| 2687 bool Heap::s_lastGCWasConservative = false; | 2695 bool Heap::s_lastGCWasConservative = false; |
| 2688 FreePagePool* Heap::s_freePagePool; | 2696 FreePagePool* Heap::s_freePagePool; |
| 2689 OrphanedPagePool* Heap::s_orphanedPagePool; | 2697 OrphanedPagePool* Heap::s_orphanedPagePool; |
| 2690 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2698 Heap::RegionTree* Heap::s_regionTree = nullptr; |
| 2691 size_t Heap::s_allocatedObjectSize = 0; | 2699 size_t Heap::s_allocatedObjectSize = 0; |
| 2692 size_t Heap::s_allocatedSpace = 0; | 2700 size_t Heap::s_allocatedSpace = 0; |
| 2693 size_t Heap::s_markedObjectSize = 0; | 2701 size_t Heap::s_markedObjectSize = 0; |
| 2694 | 2702 |
| 2695 } // namespace blink | 2703 } // namespace blink |
| OLD | NEW |