| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm % nit
for (auto& member : members) {Coudl we merge the loop above into this one?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Coudl we merge the loop above into this one?
I merged the loops and left behind a TODO to use a single global variable checks as a fast path here. We need to expose that on V8 first though
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: third_party/blink/renderer/platform/heap/member.h
Insertions: 16, Deletions: 15.
@@ -230,26 +230,27 @@
}
static void NotifyNewElements(base::span<T> members) {
- // Checking one pointer is sufficient for determining whether a
- // marking or generational barrier is required. We need a non-null pointer
- // to check if the write barrier is needed. nullptr will just always bail
- // out.
- T* first_non_null = [&]() -> T* {
- for (auto& member : members) {
- if (static_cast<bool>(member)) {
- return &member;
- }
+ // TODO(mlippautz): We can expose whether the write barrier is enabled at
+ // all and get away with a single global variable check here.
+
+ // We need a non-null pointer to check if the write barrier is needed.
+ // nullptr will just always bail out.
+ auto current = members.begin();
+ for (; current != members.end(); ++current) {
+ if (static_cast<bool>(*current)) {
+ break;
}
- return nullptr;
- }();
- if (!first_non_null) {
+ }
+ if (current == members.end()) {
return;
}
- if (!WriteBarrier::IsWriteBarrierNeeded(first_non_null)) [[likely]] {
+ // Checking one pointer is sufficient for determining whether a
+ // marking or generational barrier is required.
+ if (!WriteBarrier::IsWriteBarrierNeeded(&*current)) {
return;
}
- for (auto& member : members) {
- WriteBarrier::DispatchForObject(&member);
+ for (; current != members.end(); ++current) {
+ WriteBarrier::DispatchForObject(&*current);
}
}
};
```
heap: Make range-based write barrier more robust
Fix bailouts on the barrier for possible nullptr cases.
CONV=47326a54-47d2-449d-b308-f51eb6b5b3b8
TAG=AGY
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |