Commit 7c369ec8 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[compiler] Use templates to speed up liveness calculation

Instead of using runtime lookups of various bytecode properties (like
whether they read/write the accumulator, what their operands do to
registers, etc), do a switch over the bytecode itself once and dispatch
to update methods that are templated on the bytecode and statically know
everything about it.

Change-Id: I0ae111af54277c26c7d0d67a404a2ef75f81fcf4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455826Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79102}
parent adfe633a
This diff is collapsed.
......@@ -65,7 +65,7 @@ class V8_EXPORT_PRIVATE Register final {
return Register(kRegisterFileStartOffset - operand);
}
static Register FromShortStar(Bytecode bytecode) {
static constexpr Register FromShortStar(Bytecode bytecode) {
DCHECK(Bytecodes::IsShortStar(bytecode));
return Register(static_cast<int>(Bytecode::kStar0) -
static_cast<int>(bytecode));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment