#include "src/maglev/maglev-compilation-info.h"
#include <optional>
#include "src/codegen/compiler.h"
#include "src/compiler/compilation-dependencies.h"
#include "src/compiler/js-heap-broker.h"
#include "src/execution/isolate.h"
#include "src/flags/flags.h"
#include "src/handles/persistent-handles.h"
#ifdef V8_ENABLE_MAGLEV
#include "src/maglev/maglev-code-generator.h"
#include "src/maglev/maglev-concurrent-dispatcher.h"
#endif
#include "src/maglev/maglev-compilation-unit.h"
#include "src/maglev/maglev-graph-labeller.h"
#include "src/objects/js-function-inl.h"
#include "src/utils/identity-map.h"
namespace v8 {
namespace internal {
namespace maglev {
namespace {
constexpr char kMaglevZoneName[] = …;
class V8_NODISCARD MaglevCompilationHandleScope final { … };
static bool SpecializeToFunctionContext(
Isolate* isolate, BytecodeOffset osr_offset,
DirectHandle<JSFunction> function,
std::optional<bool> specialize_to_function_context_override) { … }
}
MaglevCompilationInfo::MaglevCompilationInfo(
Isolate* isolate, Handle<JSFunction> function, BytecodeOffset osr_offset,
std::optional<compiler::JSHeapBroker*> js_broker,
std::optional<bool> specialize_to_function_context,
bool for_turboshaft_frontend)
: … { … }
MaglevCompilationInfo::~MaglevCompilationInfo() { … }
void MaglevCompilationInfo::set_graph_labeller(
MaglevGraphLabeller* graph_labeller) { … }
#ifdef V8_ENABLE_MAGLEV
void MaglevCompilationInfo::set_code_generator(
std::unique_ptr<MaglevCodeGenerator> code_generator) { … }
#endif
namespace {
template <typename T>
Handle<T> CanonicalHandle(CanonicalHandlesMap* canonical_handles,
Tagged<T> object, Isolate* isolate) { … }
}
void MaglevCompilationInfo::ReopenAndCanonicalizeHandlesInNewScope(
Isolate* isolate) { … }
void MaglevCompilationInfo::set_persistent_handles(
std::unique_ptr<PersistentHandles>&& persistent_handles) { … }
std::unique_ptr<PersistentHandles>
MaglevCompilationInfo::DetachPersistentHandles() { … }
void MaglevCompilationInfo::set_canonical_handles(
std::unique_ptr<CanonicalHandlesMap>&& canonical_handles) { … }
bool MaglevCompilationInfo::is_detached() { … }
std::unique_ptr<CanonicalHandlesMap>
MaglevCompilationInfo::DetachCanonicalHandles() { … }
}
}
}