fd306a0658
Before, the standard way to create a RegList was either: RegList list = (1 << 0) | (1 << 1) | ... or RegList list = rax.bit() | rdx.bit() | ... The first way allows to make the RegList constexpr, but needs comments to document which registers you are referring to, and it has no checks that all bits you set on the RegList actually belong to valid registers. The second one uses the symbolic names, hence is much more readable and makes it harder to construct invalid RegLists. It's not constexpr though, since the {bit()} method on the register types is not constexpr. This CL adds a constexpr accessor to get the code and bit of a constexpr Register, and adds a helper method to create a constexpr RegList like this: constexpr RegList list = Register::ListOf<rax, rdx, rdi>(); This new method is used in a number of places to test its applicability. Other uses of the old pattern remain and can be cleaned up later. R=tebbi@chromium.org Change-Id: Ie7b1d6342dc5f316dcfedd0363b3540ad5e7f413 Reviewed-on: https://chromium-review.googlesource.com/728026 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#48887} |
||
---|---|---|
.. | ||
api | ||
asmjs | ||
base | ||
compiler | ||
compiler-dispatcher | ||
heap | ||
interpreter | ||
libplatform | ||
parser | ||
wasm | ||
zone | ||
bigint-unittest.cc | ||
BUILD.gn | ||
cancelable-tasks-unittest.cc | ||
char-predicates-unittest.cc | ||
code-stub-assembler-unittest.cc | ||
code-stub-assembler-unittest.h | ||
counters-unittest.cc | ||
DEPS | ||
detachable-vector-unittest.cc | ||
eh-frame-iterator-unittest.cc | ||
eh-frame-writer-unittest.cc | ||
locked-queue-unittest.cc | ||
object-unittest.cc | ||
register-configuration-unittest.cc | ||
run-all-unittests.cc | ||
source-position-table-unittest.cc | ||
test-helpers.cc | ||
test-helpers.h | ||
test-utils.cc | ||
test-utils.h | ||
unicode-unittest.cc | ||
unittests.gyp | ||
unittests.isolate | ||
unittests.status | ||
value-serializer-unittest.cc |