v8/test/unittests/base
Clemens Backes fa056cd088 [utils] Move {WhichPowerOf2} to base::bits
{WhichPowerOf2} is basically the same as {CountTrailingZeros}, with a
restriction to powers of two. Since it does not use or depend on any v8
internals, it can be moved to src/base/bits.h.
This CL also changes the implementation to use the CTZ builtin if
available, and falls back to popcnt otherwise.

Drive-by: Make it constexpr, and rename to {WhichPowerOfTwo}.

R=sigurds@chromium.org

Bug: v8:9810, v8:8912
Change-Id: I8368d098f9ab1247f3b9f036f1385a38de10cc6a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903966
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64851}
2019-11-08 09:45:50 +00:00
..
platform Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
utils [cleanup] Eliminate non-const reference parameters 2019-09-10 11:47:39 +00:00
address-region-unittest.cc [ptr-compr] Re-imlpement BoundedPageAllocator::ReleasePages() 2018-09-28 10:41:06 +00:00
atomic-utils-unittest.cc Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
bits-unittest.cc [utils] Move {WhichPowerOf2} to base::bits 2019-11-08 09:45:50 +00:00
cpu-unittest.cc [x86] Disable AVX unless the operating system explicitly claims to support it. 2015-01-27 09:59:24 +00:00
division-by-constant-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
flags-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
functional-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
ieee754-unittest.cc [ubsan] Fix various cases of undefined behavior 2019-01-10 13:52:04 +00:00
iterator-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
list-unittest.cc [heap] Remove anchor page from Space. 2018-05-22 17:48:02 +00:00
logging-unittest.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
macros-unittest.cc Account for different interpretations of "trivially copyable" 2018-03-02 15:45:14 +00:00
ostreams-unittest.cc Move utility code to src/utils 2019-05-23 14:13:34 +00:00
region-allocator-unittest.cc [ptr-compr] Re-imlpement BoundedPageAllocator::ReleasePages() 2018-09-28 10:41:06 +00:00
sys-info-unittest.cc Remove NaCl support. 2016-07-27 07:50:31 +00:00
template-utils-unittest.cc Replace base::make_unique by std::make_unique 2019-09-10 11:21:51 +00:00
threaded-list-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
vlq-base64-unittest.cc Add Base64 VLQ decoding support 2019-07-16 16:16:24 +00:00