chromium/v8/src/maglev/maglev-regalloc-data.h

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_MAGLEV_MAGLEV_REGALLOC_DATA_H_
#define V8_MAGLEV_MAGLEV_REGALLOC_DATA_H_

#include "src/base/pointer-with-payload.h"
#include "src/codegen/register.h"
#include "src/compiler/backend/instruction.h"
#include "src/maglev/maglev-assembler.h"

namespace v8 {
namespace internal {
namespace maglev {

class ValueNode;

static constexpr int kAllocatableGeneralRegisterCount =MaglevAssembler::GetAllocatableRegisters().Count();
static constexpr int kAllocatableDoubleRegisterCount =MaglevAssembler::GetAllocatableDoubleRegisters().Count();

template <typename T>
struct AllocatableRegisters;

template <>
struct AllocatableRegisters<Register> {};

template <>
struct AllocatableRegisters<DoubleRegister> {};

struct RegisterStateFlags {};
constexpr bool operator==(const RegisterStateFlags& left,
                          const RegisterStateFlags& right) {}

RegisterState;

struct RegisterMerge {};

inline bool LoadMergeState(RegisterState state, RegisterMerge** merge) {}

inline bool LoadMergeState(RegisterState state, ValueNode** node,
                           RegisterMerge** merge) {}

}  // namespace maglev
}  // namespace internal
}  // namespace v8

#endif  // V8_MAGLEV_MAGLEV_REGALLOC_DATA_H_