• Clemens Backes's avatar
    [utils] Move {WhichPowerOf2} to base::bits · fa056cd0
    Clemens Backes authored
    {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/+/1903966Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64851}
    fa056cd0
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
assembler Loading commit data...
base Loading commit data...
codegen Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
date Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
heap Loading commit data...
interpreter Loading commit data...
libplatform Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parser Loading commit data...
profiler Loading commit data...
regress Loading commit data...
strings Loading commit data...
tasks Loading commit data...
torque Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
run-all-unittests.cc Loading commit data...
test-helpers.cc Loading commit data...
test-helpers.h Loading commit data...
test-utils.cc Loading commit data...
test-utils.h Loading commit data...
testcfg.py Loading commit data...
unittests.status Loading commit data...