chromium/v8/src/interpreter/bytecode-operands.h

// Copyright 2016 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_INTERPRETER_BYTECODE_OPERANDS_H_
#define V8_INTERPRETER_BYTECODE_OPERANDS_H_

#include "src/base/bounds.h"
#include "src/common/globals.h"

namespace v8 {
namespace internal {
namespace interpreter {

#define INVALID_OPERAND_TYPE_LIST(V)

#define REGISTER_INPUT_OPERAND_TYPE_LIST(V)

#define REGISTER_OUTPUT_OPERAND_TYPE_LIST(V)

#define SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V)

#define UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V)

#define UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(V)

// Carefully ordered for operand type range checks below.
#define NON_REGISTER_OPERAND_TYPE_LIST(V)

// Carefully ordered for operand type range checks below.
#define REGISTER_OPERAND_TYPE_LIST(V)

// The list of operand types used by bytecodes.
// Carefully ordered for operand type range checks below.
#define OPERAND_TYPE_LIST(V)

// Enumeration of scaling factors applicable to scalable operands. Code
// relies on being able to cast values to integer scaling values.
#define OPERAND_SCALE_LIST(V)

enum class OperandScale : uint8_t {};

// Enumeration of the size classes of operand types used by
// bytecodes. Code relies on being able to cast values to integer
// types to get the size in bytes.
enum class OperandSize : uint8_t {};

// Primitive operand info used that summarize properties of operands.
// Columns are Name, IsScalable, IsUnsigned, UnscaledSize.
#define OPERAND_TYPE_INFO_LIST(V)

enum class OperandTypeInfo : uint8_t {};

// Enumeration of operand types used by bytecodes.
enum class OperandType : uint8_t {};

enum class ImplicitRegisterUse : uint8_t {};

constexpr inline ImplicitRegisterUse operator&(ImplicitRegisterUse lhs,
                                               ImplicitRegisterUse rhs) {}

constexpr inline ImplicitRegisterUse operator|(ImplicitRegisterUse lhs,
                                               ImplicitRegisterUse rhs) {}

V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
                                           const ImplicitRegisterUse& use);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
                                           const OperandScale& operand_scale);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
                                           const OperandSize& operand_size);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
                                           const OperandType& operand_type);

class BytecodeOperands : public AllStatic {};

}  // namespace interpreter
}  // namespace internal
}  // namespace v8

#endif  // V8_INTERPRETER_BYTECODE_OPERANDS_H_