chromium/v8/src/maglev/maglev-assembler.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_ASSEMBLER_H_
#define V8_MAGLEV_MAGLEV_ASSEMBLER_H_

#include "src/codegen/machine-type.h"
#include "src/codegen/macro-assembler.h"
#include "src/common/globals.h"
#include "src/flags/flags.h"
#include "src/interpreter/bytecode-flags-and-tokens.h"
#include "src/maglev/maglev-code-gen-state.h"
#include "src/maglev/maglev-ir.h"

namespace v8 {
namespace internal {
namespace maglev {

class Graph;
class MaglevAssembler;

inline ExternalReference SpaceAllocationTopAddress(Isolate* isolate,
                                                   AllocationType alloc_type) {}

inline ExternalReference SpaceAllocationLimitAddress(
    Isolate* isolate, AllocationType alloc_type) {}

inline Builtin AllocateBuiltin(AllocationType alloc_type) {}

// Label allowed to be passed to deferred code.
class ZoneLabelRef {};

// The slot index is the offset from the frame pointer.
struct StackSlot {};

// Helper for generating the platform-specific parts of map comparison
// operations.
class MapCompare {};

class V8_EXPORT_PRIVATE MaglevAssembler : public MacroAssembler {};

// Shared logic for per-architecture TemporaryRegisterScope.
template <typename Derived>
class MaglevAssembler::TemporaryRegisterScopeBase {};

class SaveRegisterStateForCall {};

ZoneLabelRef::ZoneLabelRef(MaglevAssembler* masm)
    :{}

// ---
// Deopt
// ---

inline bool MaglevAssembler::IsDeoptLabel(Label* label) {}

template <typename NodeT>
inline Label* MaglevAssembler::GetDeoptLabel(NodeT* node,
                                             DeoptimizeReason reason) {}

template <typename NodeT>
inline void MaglevAssembler::EmitEagerDeopt(NodeT* node,
                                            DeoptimizeReason reason) {}

template <typename NodeT>
inline void MaglevAssembler::EmitEagerDeoptIf(Condition cond,
                                              DeoptimizeReason reason,
                                              NodeT* node) {}

template <typename NodeT>
void MaglevAssembler::EmitEagerDeoptIfSmi(NodeT* node, Register object,
                                          DeoptimizeReason reason) {}

template <typename NodeT>
void MaglevAssembler::EmitEagerDeoptIfNotSmi(NodeT* node, Register object,
                                             DeoptimizeReason reason) {}


// Helpers for pushing arguments.
template <typename T>
class RepeatIterator {};

template <typename T>
auto RepeatValue(T val, int count) {}

namespace detail {

template <class T>
struct is_iterator_range : std::false_type {};
is_iterator_range<base::iterator_range<T>>;

}  // namespace detail

// General helpers.

inline Condition ToCondition(AssertCondition cond) {}

constexpr Condition ConditionFor(Operation operation) {}

constexpr Condition UnsignedConditionFor(Operation operation) {}

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

#endif  // V8_MAGLEV_MAGLEV_ASSEMBLER_H_