Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Good catch! LGTM
return !HeapLayout::InYoungGeneration(object) ||
Nit: We could split this condition up a bit, now that we have this in its own function. Something like:
```
if (!InYoungGeneration(object)) return true;
...
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Nit: We could split this condition up a bit, now that we have this in its own function. Something like:
```
if (!InYoungGeneration(object)) return true;
...
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/heap/scavenger.cc
Insertions: 12, Deletions: 5.
@@ -1089,11 +1089,18 @@
namespace {
bool HeapObjectWillBeOld(const Heap* heap, Tagged<HeapObject> object) {
- return !HeapLayout::InYoungGeneration(object) ||
- HeapLayout::InAnyLargeSpace(object) ||
- (HeapLayout::IsSelfForwarded(object) &&
- MemoryChunkMetadata::FromHeapObject(heap->isolate(), object)
- ->will_be_promoted());
+ if (!HeapLayout::InYoungGeneration(object)) {
+ return true;
+ }
+ if (HeapLayout::InAnyLargeSpace(object)) {
+ return true;
+ }
+ if (HeapLayout::IsSelfForwarded(object) &&
+ MemoryChunkMetadata::FromHeapObject(heap->isolate(), object)
+ ->will_be_promoted()) {
+ return true;
+ }
+ return false;
}
} // namespace
```
[heap] Fix age check for scavenged objects
The check was only looking at `HeapLayout::InYoungGeneration` and
ignored large pages and pinned promoted pages. As a result, it was
possible to miss a old-to-new slot, which could lead to a memory
corruption.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |