5#ifndef V8_MAGLEV_MAGLEV_COMPILATION_INFO_H_
6#define V8_MAGLEV_MAGLEV_COMPILATION_INFO_H_
19class DefaultAllocationPolicy;
25class PersistentHandles;
26class SharedFunctionInfo;
27class TranslationArrayBuilder;
35class MaglevCompilationUnit;
36class MaglevGraphLabeller;
37class MaglevCodeGenerator;
41#define MAGLEV_COMPILATION_FLAG_LIST(V) \
44 V(print_maglev_code) \
45 V(print_maglev_graph) \
46 V(trace_maglev_regalloc)
59 static std::unique_ptr<MaglevCompilationInfo>
New(
63 return std::unique_ptr<MaglevCompilationInfo>(
93#ifdef V8_ENABLE_MAGLEV
94 void set_code_generator(std::unique_ptr<MaglevCodeGenerator> code_generator);
101 bool Name() const { return Name##_; }
117 std::unique_ptr<PersistentHandles>&& persistent_handles);
136 std::optional<compiler::JSHeapBroker*>
broker = std::nullopt,
138 bool for_turboshaft_frontend =
false);
170#ifdef V8_ENABLE_MAGLEV
172 std::unique_ptr<MaglevCodeGenerator> code_generator_;
175#define V(Name) const bool Name##_;
198 std::unique_ptr<PersistentHandles>
ph_;
static constexpr BytecodeOffset None()
MaybeIndirectHandle< Code > get_code()
static std::unique_ptr< MaglevCompilationInfo > NewForTurboshaft(Isolate *isolate, compiler::JSHeapBroker *broker, IndirectHandle< JSFunction > function, BytecodeOffset osr_offset, bool specialize_to_function_context)
bool could_not_inline_all_candidates_
bool could_not_inline_all_candidates()
static std::unique_ptr< MaglevCompilationInfo > New(Isolate *isolate, IndirectHandle< JSFunction > function, BytecodeOffset osr_offset)
compiler::JSHeapBroker * broker_
IndirectHandle< Code > code_
void ReopenAndCanonicalizeHandlesInNewScope(Isolate *isolate)
void set_could_not_inline_all_candidates()
void set_graph_labeller(MaglevGraphLabeller *graph_labeller)
std::unique_ptr< MaglevGraphLabeller > graph_labeller_
void set_persistent_handles(std::unique_ptr< PersistentHandles > &&persistent_handles)
MaglevGraphLabeller * graph_labeller() const
void set_canonical_handles(std::unique_ptr< CanonicalHandlesMap > &&canonical_handles)
bool collect_source_positions() const
MaglevCompilationUnit * toplevel_compilation_unit_
std::unique_ptr< CanonicalHandlesMap > canonical_handles_
BytecodeOffset osr_offset_
bool specialize_to_function_context() const
std::unique_ptr< PersistentHandles > DetachPersistentHandles()
CanonicalHandlesMap * canonical_handles()
std::unique_ptr< PersistentHandles > ph_
const bool specialize_to_function_context_
IndirectHandle< JSFunction > toplevel_function() const
std::unique_ptr< CanonicalHandlesMap > DetachCanonicalHandles()
bool toplevel_is_osr() const
IndirectHandle< JSFunction > toplevel_function_
void set_code(IndirectHandle< Code > code)
bool has_graph_labeller() const
MaglevCompilationUnit * toplevel_compilation_unit() const
bool collect_source_positions_
MaglevCompilationInfo(Isolate *isolate, IndirectHandle< JSFunction > function, BytecodeOffset osr_offset, std::optional< compiler::JSHeapBroker * > broker=std::nullopt, std::optional< bool > specialize_to_function_context=std::nullopt, bool for_turboshaft_frontend=false)
compiler::JSHeapBroker * broker() const
BytecodeOffset toplevel_osr_offset() const
#define MAGLEV_COMPILATION_FLAG_LIST(V)
#define DCHECK(condition)