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

Unified Diff: src/heap/object-stats.h

Issue 2147983002: [heap] ObjectStats: Use ieee754 log2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/object-stats.h
diff --git a/src/heap/object-stats.h b/src/heap/object-stats.h
index 21b5e700b9acb73e5932d4ca46fcb1e9b59b2718..54dc833e01f217e8b9ac9d8b434650e1c11c832b 100644
--- a/src/heap/object-stats.h
+++ b/src/heap/object-stats.h
@@ -5,8 +5,7 @@
#ifndef V8_HEAP_OBJECT_STATS_H_
#define V8_HEAP_OBJECT_STATS_H_
-#include <math.h>
-
+#include "src/base/ieee754.h"
#include "src/heap/heap.h"
#include "src/heap/objects-visiting.h"
#include "src/objects.h"
@@ -92,8 +91,8 @@ class ObjectStats {
int HistogramIndexFromSize(size_t size) {
if (size == 0) return 0;
- int idx =
- static_cast<int>(log2(static_cast<double>(size))) - kFirstBucketShift;
+ int idx = static_cast<int>(base::ieee754::log2(static_cast<double>(size))) -
+ kFirstBucketShift;
return idx < 0 ? 0 : idx;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698