Commit bfcb2f82 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[compiler] Output RegisterBitVector for debugging

This adds an output operator for {RegisterBitVector}, mostly for getting
better DCHECK error messages.

R=thibaudm@chromium.org

Bug: v8:12330
Change-Id: I98f822f94a3b6a240c8ead7ea4de4049abe9998e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3372909Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78512}
parent 57f06a8b
......@@ -4,6 +4,8 @@
#include "src/compiler/backend/mid-tier-register-allocator.h"
#include <ostream>
#include "src/base/bits.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
......@@ -1324,6 +1326,7 @@ class RegisterBitVector {
bool IsEmpty() const { return bits_ == 0; }
private:
friend std::ostream& operator<<(std::ostream&, RegisterBitVector);
explicit RegisterBitVector(uintptr_t bits) : bits_(bits) {}
static_assert(RegisterConfiguration::kMaxRegisters <= sizeof(uintptr_t) * 8,
......@@ -1331,6 +1334,10 @@ class RegisterBitVector {
uintptr_t bits_;
};
std::ostream& operator<<(std::ostream& os, RegisterBitVector register_bits) {
return os << std::hex << register_bits.bits_ << std::dec;
}
// A SinglePassRegisterAllocator is a fast register allocator that does a single
// pass through the instruction stream without performing any live-range
// analysis beforehand. It deals with a single RegisterKind, either general or
......
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