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

Unified Diff: runtime/platform/utils.h

Issue 10806078: Improve the performance of bit set searches with a compiler intrinsic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 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 | runtime/platform/utils_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/utils.h
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 22ee772b7de01c5976c433766821b16cc2f9928b..4cd71913f7ed85987e60790b95836037cc81929c 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -79,6 +79,9 @@ class Utils {
static uint32_t RoundUpToPowerOfTwo(uint32_t x);
static int CountOneBits(uint32_t x);
+ static int CountTrailingZeros(uint32_t x);
+ static int CountTrailingZeros(uint64_t x);
+
// Computes a hash value for the given string.
static uint32_t StringHash(const char* data, int length);
@@ -170,4 +173,14 @@ class Utils {
} // namespace dart
+#if defined(TARGET_OS_LINUX)
+#include "platform/utils_linux.h"
+#elif defined(TARGET_OS_MACOS)
+#include "platform/utils_macos.h"
+#elif defined(TARGET_OS_WINDOWS)
+#include "platform/utils_win.h"
+#else
+#error Unknown target os.
+#endif
+
#endif // PLATFORM_UTILS_H_
« no previous file with comments | « no previous file | runtime/platform/utils_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698