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

Unified Diff: src/objects.cc

Issue 2795763002: Collect array buffer allocation sizes for UMA in megabytes. (Closed)
Patch Set: Fix that allocation size can be zero. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/counters.h ('K') | « src/counters.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 2901840af92fbe0b1cd995ba1129a4cb4024befa..bcab746854c04c35201e31649b41ec118f2499e3 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -19473,12 +19473,7 @@ bool JSArrayBuffer::SetupAllocatingData(Handle<JSArrayBuffer> array_buffer,
// Prevent creating array buffers when serializing.
DCHECK(!isolate->serializer_enabled());
if (allocated_length != 0) {
- constexpr size_t kMinBigAllocation = 1 << 20;
- if (allocated_length >= kMinBigAllocation) {
- isolate->counters()->array_buffer_big_allocations()->AddSample(
- sizeof(uint64_t) * kBitsPerByte -
- base::bits::CountLeadingZeros64(allocated_length));
- }
+ isolate->counters()->array_buffer_big_allocations()->Add(allocated_length);
if (initialize) {
data = isolate->array_buffer_allocator()->Allocate(allocated_length);
} else {
@@ -19486,9 +19481,8 @@ bool JSArrayBuffer::SetupAllocatingData(Handle<JSArrayBuffer> array_buffer,
allocated_length);
}
if (data == NULL) {
- isolate->counters()->array_buffer_new_size_failures()->AddSample(
- sizeof(uint64_t) * kBitsPerByte -
- base::bits::CountLeadingZeros64(allocated_length));
+ isolate->counters()->array_buffer_new_size_failures()->Add(
+ allocated_length);
return false;
}
} else {
« src/counters.h ('K') | « src/counters.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698