#ifndef V8_MAGLEV_MAGLEV_IR_INL_H_
#define V8_MAGLEV_MAGLEV_IR_INL_H_
#include "src/interpreter/bytecode-register.h"
#include "src/maglev/maglev-ir.h"
namespace v8 {
namespace internal {
namespace maglev {
inline const VirtualObject::List& GetVirtualObjects(
const DeoptFrame& deopt_frame) { … }
namespace detail {
enum class DeoptFrameVisitMode { … };
template <DeoptFrameVisitMode mode, typename T>
using const_if_default =
std::conditional_t<mode == DeoptFrameVisitMode::kDefault, const T, T>;
template <DeoptFrameVisitMode mode>
using ValueNodeT =
std::conditional_t<mode == DeoptFrameVisitMode::kDefault, ValueNode*,
ValueNode*&>;
template <DeoptFrameVisitMode mode, typename Function>
void DeepForEachInputSingleFrameImpl(
const_if_default<mode, DeoptFrame>& frame, InputLocation*& input_location,
Function&& f,
std::function<bool(interpreter::Register)> is_result_register) { … }
template <DeoptFrameVisitMode mode, typename Function>
void DeepForVirtualObject(VirtualObject* vobject,
InputLocation*& input_location,
const VirtualObject::List& virtual_objects,
Function&& f) { … }
template <DeoptFrameVisitMode mode, typename Function>
void DeepForEachInputAndVirtualObject(
const_if_default<mode, DeoptFrame>& frame, InputLocation*& input_location,
Function&& f,
std::function<bool(interpreter::Register)> is_result_register =
[](interpreter::Register) { … }
template <DeoptFrameVisitMode mode, typename Function>
void DeepForEachInputImpl(const_if_default<mode, DeoptFrame>& frame,
InputLocation*& input_location, Function&& f) { … }
template <DeoptFrameVisitMode mode, typename Function>
void DeepForEachInputForEager(
const_if_default<mode, EagerDeoptInfo>* deopt_info, Function&& f) { … }
template <DeoptFrameVisitMode mode, typename Function>
void DeepForEachInputForLazy(const_if_default<mode, LazyDeoptInfo>* deopt_info,
Function&& f) { … }
template <typename Function>
void DeepForEachInput(const EagerDeoptInfo* deopt_info, Function&& f) { … }
template <typename Function>
void DeepForEachInput(const LazyDeoptInfo* deopt_info, Function&& f) { … }
template <typename Function>
void DeepForEachInputRemovingIdentities(EagerDeoptInfo* deopt_info,
Function&& f) { … }
template <typename Function>
void DeepForEachInputRemovingIdentities(LazyDeoptInfo* deopt_info,
Function&& f) { … }
}
#ifdef DEBUG
inline RegList GetGeneralRegistersUsedAsInputs(
const EagerDeoptInfo* deopt_info) { … }
#endif
#define DCHECK_REGLIST_EMPTY(...) …
static constexpr int kNoVreg = …;
inline void DefineAsRegister(Node* node) { … }
inline void DefineAsConstant(Node* node) { … }
inline void DefineAsFixed(Node* node, Register reg) { … }
inline void DefineSameAsFirst(Node* node) { … }
inline void UseRegister(Input& input) { … }
inline void UseAndClobberRegister(Input& input) { … }
inline void UseAny(Input& input) { … }
inline void UseFixed(Input& input, Register reg) { … }
inline void UseFixed(Input& input, DoubleRegister reg) { … }
}
}
}
#endif