#include "src/codegen/compiler.h"
#include <algorithm>
#include <memory>
#include <optional>
#include "src/api/api-inl.h"
#include "src/asmjs/asm-js.h"
#include "src/ast/prettyprinter.h"
#include "src/ast/scopes.h"
#include "src/base/logging.h"
#include "src/base/platform/time.h"
#include "src/baseline/baseline.h"
#include "src/codegen/assembler-inl.h"
#include "src/codegen/compilation-cache.h"
#include "src/codegen/optimized-compilation-info.h"
#include "src/codegen/pending-optimization-table.h"
#include "src/codegen/script-details.h"
#include "src/codegen/unoptimized-compilation-info.h"
#include "src/common/assert-scope.h"
#include "src/common/globals.h"
#include "src/common/message-template.h"
#include "src/compiler-dispatcher/lazy-compile-dispatcher.h"
#include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
#include "src/compiler/turbofan.h"
#include "src/debug/debug.h"
#include "src/debug/liveedit.h"
#include "src/diagnostics/code-tracer.h"
#include "src/execution/frames-inl.h"
#include "src/execution/isolate-inl.h"
#include "src/execution/isolate.h"
#include "src/execution/local-isolate.h"
#include "src/execution/vm-state-inl.h"
#include "src/flags/flags.h"
#include "src/handles/global-handles-inl.h"
#include "src/handles/handles.h"
#include "src/handles/maybe-handles.h"
#include "src/handles/persistent-handles.h"
#include "src/heap/heap-inl.h"
#include "src/heap/local-factory-inl.h"
#include "src/heap/local-heap-inl.h"
#include "src/heap/parked-scope-inl.h"
#include "src/init/bootstrapper.h"
#include "src/interpreter/interpreter.h"
#include "src/logging/counters-scopes.h"
#include "src/logging/log-inl.h"
#include "src/logging/runtime-call-stats-scope.h"
#include "src/objects/feedback-cell-inl.h"
#include "src/objects/js-function-inl.h"
#include "src/objects/map.h"
#include "src/objects/object-list-macros.h"
#include "src/objects/objects-body-descriptors-inl.h"
#include "src/objects/shared-function-info.h"
#include "src/objects/string.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parser.h"
#include "src/parsing/parsing.h"
#include "src/parsing/pending-compilation-error-handler.h"
#include "src/parsing/scanner-character-streams.h"
#include "src/snapshot/code-serializer.h"
#include "src/tracing/traced-value.h"
#include "src/utils/ostreams.h"
#include "src/zone/zone-list-inl.h"
#ifdef V8_ENABLE_MAGLEV
#include "src/maglev/maglev-concurrent-dispatcher.h"
#include "src/maglev/maglev.h"
#endif
namespace v8 {
namespace internal {
namespace {
constexpr bool IsOSR(BytecodeOffset osr_offset) { … }
void SetTieringState(IsolateForSandbox isolate, Tagged<JSFunction> function,
BytecodeOffset osr_offset, TieringState value) { … }
void ResetTieringState(IsolateForSandbox isolate, Tagged<JSFunction> function,
BytecodeOffset osr_offset) { … }
class CompilerTracer : public AllStatic { … };
}
void Compiler::LogFunctionCompilation(Isolate* isolate,
LogEventListener::CodeTag code_type,
DirectHandle<Script> script,
Handle<SharedFunctionInfo> shared,
Handle<FeedbackVector> vector,
Handle<AbstractCode> abstract_code,
CodeKind kind, double time_taken_ms) { … }
namespace {
ScriptOriginOptions OriginOptionsForEval(
Tagged<Object> script, ParsingWhileDebugging parsing_while_debugging) { … }
}
CompilationJob::Status UnoptimizedCompilationJob::ExecuteJob() { … }
CompilationJob::Status UnoptimizedCompilationJob::FinalizeJob(
Handle<SharedFunctionInfo> shared_info, Isolate* isolate) { … }
CompilationJob::Status UnoptimizedCompilationJob::FinalizeJob(
Handle<SharedFunctionInfo> shared_info, LocalIsolate* isolate) { … }
namespace {
void LogUnoptimizedCompilation(Isolate* isolate,
Handle<SharedFunctionInfo> shared,
LogEventListener::CodeTag code_type,
base::TimeDelta time_taken_to_execute,
base::TimeDelta time_taken_to_finalize) { … }
}
CompilationJob::Status OptimizedCompilationJob::PrepareJob(Isolate* isolate) { … }
CompilationJob::Status OptimizedCompilationJob::ExecuteJob(
RuntimeCallStats* stats, LocalIsolate* local_isolate) { … }
CompilationJob::Status OptimizedCompilationJob::FinalizeJob(Isolate* isolate) { … }
GlobalHandleVector<Map> OptimizedCompilationJob::CollectRetainedMaps(
Isolate* isolate, DirectHandle<Code> code) { … }
void OptimizedCompilationJob::RegisterWeakObjectsInOptimizedCode(
Isolate* isolate, DirectHandle<NativeContext> context,
DirectHandle<Code> code, GlobalHandleVector<Map> maps) { … }
CompilationJob::Status TurbofanCompilationJob::RetryOptimization(
BailoutReason reason) { … }
CompilationJob::Status TurbofanCompilationJob::AbortOptimization(
BailoutReason reason) { … }
void TurbofanCompilationJob::RecordCompilationStats(ConcurrencyMode mode,
Isolate* isolate) const { … }
void TurbofanCompilationJob::RecordFunctionCompilation(
LogEventListener::CodeTag code_type, Isolate* isolate) const { … }
uint64_t TurbofanCompilationJob::trace_id() const { … }
namespace {
#if V8_ENABLE_WEBASSEMBLY
bool UseAsmWasm(FunctionLiteral* literal, bool asm_wasm_broken) { … }
#endif
}
void Compiler::InstallInterpreterTrampolineCopy(
Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
LogEventListener::CodeTag log_tag) { … }
namespace {
template <typename IsolateT>
void InstallUnoptimizedCode(UnoptimizedCompilationInfo* compilation_info,
DirectHandle<SharedFunctionInfo> shared_info,
IsolateT* isolate) { … }
template <typename IsolateT>
void EnsureInfosArrayOnScript(DirectHandle<Script> script,
ParseInfo* parse_info, IsolateT* isolate) { … }
void UpdateSharedFunctionFlagsAfterCompilation(FunctionLiteral* literal) { … }
template <typename IsolateT>
CompilationJob::Status FinalizeSingleUnoptimizedCompilationJob(
UnoptimizedCompilationJob* job, Handle<SharedFunctionInfo> shared_info,
IsolateT* isolate,
FinalizeUnoptimizedCompilationDataList*
finalize_unoptimized_compilation_data_list) { … }
std::unique_ptr<UnoptimizedCompilationJob>
ExecuteSingleUnoptimizedCompilationJob(
ParseInfo* parse_info, FunctionLiteral* literal, Handle<Script> script,
AccountingAllocator* allocator,
std::vector<FunctionLiteral*>* eager_inner_literals,
LocalIsolate* local_isolate) { … }
template <typename IsolateT>
bool IterativelyExecuteAndFinalizeUnoptimizedCompilationJobs(
IsolateT* isolate, Handle<Script> script, ParseInfo* parse_info,
AccountingAllocator* allocator, IsCompiledScope* is_compiled_scope,
FinalizeUnoptimizedCompilationDataList*
finalize_unoptimized_compilation_data_list,
DeferredFinalizationJobDataList*
jobs_to_retry_finalization_on_main_thread) { … }
bool FinalizeDeferredUnoptimizedCompilationJobs(
Isolate* isolate, DirectHandle<Script> script,
DeferredFinalizationJobDataList* deferred_jobs,
PendingCompilationErrorHandler* pending_error_handler,
FinalizeUnoptimizedCompilationDataList*
finalize_unoptimized_compilation_data_list) { … }
class OptimizedCodeCache : public AllStatic { … };
bool PrepareJobWithHandleScope(OptimizedCompilationJob* job, Isolate* isolate,
OptimizedCompilationInfo* compilation_info,
ConcurrencyMode mode) { … }
bool CompileTurbofan_NotConcurrent(Isolate* isolate,
TurbofanCompilationJob* job) { … }
bool CompileTurbofan_Concurrent(Isolate* isolate,
std::unique_ptr<TurbofanCompilationJob> job) { … }
enum class CompileResultBehavior { … };
bool ShouldOptimize(CodeKind code_kind,
DirectHandle<SharedFunctionInfo> shared) { … }
MaybeHandle<Code> CompileTurbofan(Isolate* isolate, Handle<JSFunction> function,
DirectHandle<SharedFunctionInfo> shared,
ConcurrencyMode mode,
BytecodeOffset osr_offset,
CompileResultBehavior result_behavior) { … }
#ifdef V8_ENABLE_MAGLEV
void RecordMaglevFunctionCompilation(Isolate* isolate,
DirectHandle<JSFunction> function,
Handle<AbstractCode> code) { … }
#endif
MaybeHandle<Code> CompileMaglev(Isolate* isolate, Handle<JSFunction> function,
ConcurrencyMode mode, BytecodeOffset osr_offset,
CompileResultBehavior result_behavior) { … }
MaybeHandle<Code> GetOrCompileOptimized(
Isolate* isolate, Handle<JSFunction> function, ConcurrencyMode mode,
CodeKind code_kind, BytecodeOffset osr_offset = BytecodeOffset::None(),
CompileResultBehavior result_behavior = CompileResultBehavior::kDefault) { … }
void SpawnDuplicateConcurrentJobForStressTesting(Isolate* isolate,
Handle<JSFunction> function,
ConcurrencyMode mode,
CodeKind code_kind) { … }
bool FailAndClearException(Isolate* isolate) { … }
template <typename IsolateT>
bool PrepareException(IsolateT* isolate, ParseInfo* parse_info) { … }
bool FailWithPreparedException(
Isolate* isolate, Handle<Script> script,
const PendingCompilationErrorHandler* pending_error_handler,
Compiler::ClearExceptionFlag flag = Compiler::KEEP_EXCEPTION) { … }
bool FailWithException(Isolate* isolate, Handle<Script> script,
ParseInfo* parse_info,
Compiler::ClearExceptionFlag flag) { … }
void FinalizeUnoptimizedCompilation(
Isolate* isolate, Handle<Script> script,
const UnoptimizedCompileFlags& flags,
const UnoptimizedCompileState* compile_state,
const FinalizeUnoptimizedCompilationDataList&
finalize_unoptimized_compilation_data_list) { … }
void FinalizeUnoptimizedScriptCompilation(
Isolate* isolate, Handle<Script> script,
const UnoptimizedCompileFlags& flags,
const UnoptimizedCompileState* compile_state,
const FinalizeUnoptimizedCompilationDataList&
finalize_unoptimized_compilation_data_list) { … }
void CompileAllWithBaseline(Isolate* isolate,
const FinalizeUnoptimizedCompilationDataList&
finalize_unoptimized_compilation_data_list) { … }
template <typename IsolateT>
Handle<SharedFunctionInfo> CreateTopLevelSharedFunctionInfo(
ParseInfo* parse_info, Handle<Script> script, IsolateT* isolate) { … }
Handle<SharedFunctionInfo> GetOrCreateTopLevelSharedFunctionInfo(
ParseInfo* parse_info, Handle<Script> script, Isolate* isolate,
IsCompiledScope* is_compiled_scope) { … }
MaybeHandle<SharedFunctionInfo> CompileToplevel(
ParseInfo* parse_info, Handle<Script> script,
MaybeHandle<ScopeInfo> maybe_outer_scope_info, Isolate* isolate,
IsCompiledScope* is_compiled_scope) { … }
#ifdef V8_RUNTIME_CALL_STATS
RuntimeCallCounterId RuntimeCallCounterIdForCompile(ParseInfo* parse_info) { … }
#endif
}
CompilationHandleScope::~CompilationHandleScope() { … }
FinalizeUnoptimizedCompilationData::FinalizeUnoptimizedCompilationData(
LocalIsolate* isolate, Handle<SharedFunctionInfo> function_handle,
MaybeHandle<CoverageInfo> coverage_info,
base::TimeDelta time_taken_to_execute,
base::TimeDelta time_taken_to_finalize)
: … { … }
DeferredFinalizationJobData::DeferredFinalizationJobData(
LocalIsolate* isolate, Handle<SharedFunctionInfo> function_handle,
std::unique_ptr<UnoptimizedCompilationJob> job)
: … { … }
BackgroundCompileTask::BackgroundCompileTask(
ScriptStreamingData* streamed_data, Isolate* isolate, ScriptType type,
ScriptCompiler::CompileOptions options,
ScriptCompiler::CompilationDetails* compilation_details,
CompileHintCallback compile_hint_callback, void* compile_hint_callback_data)
: … { … }
BackgroundCompileTask::BackgroundCompileTask(
Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
std::unique_ptr<Utf16CharacterStream> character_stream,
WorkerThreadRuntimeCallStats* worker_thread_runtime_stats,
TimedHistogram* timer, int max_stack_size)
: … { … }
BackgroundCompileTask::~BackgroundCompileTask() = default;
void SetScriptFieldsFromDetails(Isolate* isolate, Tagged<Script> script,
const ScriptDetails& script_details,
DisallowGarbageCollection* no_gc) { … }
namespace {
#ifdef ENABLE_SLOW_DCHECKS
class MergeAssumptionChecker final : public ObjectVisitor {
public:
explicit MergeAssumptionChecker(PtrComprCageBase cage_base)
: cage_base_(cage_base) {}
void IterateObjects(Tagged<HeapObject> start) {
QueueVisit(start, kNormalObject);
while (to_visit_.size() > 0) {
std::pair<Tagged<HeapObject>, ObjectKind> pair = to_visit_.top();
to_visit_.pop();
Tagged<HeapObject> current = pair.first;
if (IsScript(current)) {
Tagged<HeapObject> infos = Cast<Script>(current)->infos();
QueueVisit(infos, kScriptInfosList);
} else if (IsBytecodeArray(current)) {
Tagged<HeapObject> constants =
Cast<BytecodeArray>(current)->constant_pool();
QueueVisit(constants, kConstantPool);
}
current_object_kind_ = pair.second;
current->IterateBody(cage_base_, this);
QueueVisit(current->map(), kNormalObject);
}
}
void VisitPointers(Tagged<HeapObject> host, ObjectSlot start,
ObjectSlot end) override {
MaybeObjectSlot maybe_start(start);
MaybeObjectSlot maybe_end(end);
VisitPointers(host, maybe_start, maybe_end);
}
void VisitPointers(Tagged<HeapObject> host, MaybeObjectSlot start,
MaybeObjectSlot end) override {
for (MaybeObjectSlot current = start; current != end; ++current) {
Tagged<MaybeObject> maybe_obj = current.load(cage_base_);
Tagged<HeapObject> obj;
bool is_weak = maybe_obj.IsWeak();
if (maybe_obj.GetHeapObject(&obj)) {
if (IsSharedFunctionInfo(obj)) {
CHECK((current_object_kind_ == kConstantPool && !is_weak) ||
(current_object_kind_ == kScriptInfosList && is_weak));
} else if (IsScopeInfo(obj)) {
CHECK((current_object_kind_ == kConstantPool && !is_weak) ||
(current_object_kind_ == kNormalObject && !is_weak) ||
(current_object_kind_ == kScriptInfosList && is_weak));
} else if (IsScript(obj)) {
CHECK(IsSharedFunctionInfo(host) &&
current == MaybeObjectSlot(host.address() +
SharedFunctionInfo::kScriptOffset));
} else if (IsFixedArray(obj) && current_object_kind_ == kConstantPool) {
QueueVisit(obj, kConstantPool);
}
QueueVisit(obj, kNormalObject);
}
}
}
void VisitInstructionStreamPointer(Tagged<Code> host,
InstructionStreamSlot slot) override {
UNREACHABLE();
}
void VisitCodeTarget(Tagged<InstructionStream> host,
RelocInfo* rinfo) override {
UNREACHABLE();
}
void VisitEmbeddedPointer(Tagged<InstructionStream> host,
RelocInfo* rinfo) override {
UNREACHABLE();
}
private:
enum ObjectKind {
kNormalObject,
kConstantPool,
kScriptInfosList,
};
void QueueVisit(Tagged<HeapObject> obj, ObjectKind kind) {
if (visited_.insert(obj).second) {
to_visit_.push(std::make_pair(obj, kind));
}
}
DisallowGarbageCollection no_gc_;
PtrComprCageBase cage_base_;
std::stack<std::pair<Tagged<HeapObject>, ObjectKind>> to_visit_;
std::unordered_set<Tagged<HeapObject>, Object::Hasher> visited_;
ObjectKind current_object_kind_ = kNormalObject;
};
#endif
}
bool BackgroundCompileTask::is_streaming_compilation() const { … }
void BackgroundCompileTask::Run() { … }
void BackgroundCompileTask::RunOnMainThread(Isolate* isolate) { … }
void BackgroundCompileTask::Run(
LocalIsolate* isolate, ReusableUnoptimizedCompileState* reusable_state) { … }
class ConstantPoolPointerForwarder { … };
void BackgroundMergeTask::SetUpOnMainThread(Isolate* isolate,
Handle<String> source_text,
const ScriptDetails& script_details,
LanguageMode language_mode) { … }
void BackgroundMergeTask::SetUpOnMainThread(
Isolate* isolate, DirectHandle<Script> cached_script) { … }
static bool force_gc_during_next_merge_for_testing_ = …;
void BackgroundMergeTask::ForceGCDuringNextMergeForTesting() { … }
void BackgroundMergeTask::BeginMergeInBackground(
LocalIsolate* isolate, DirectHandle<Script> new_script) { … }
Handle<SharedFunctionInfo> BackgroundMergeTask::CompleteMergeInForeground(
Isolate* isolate, DirectHandle<Script> new_script) { … }
MaybeHandle<SharedFunctionInfo> BackgroundCompileTask::FinalizeScript(
Isolate* isolate, DirectHandle<String> source,
const ScriptDetails& script_details,
MaybeHandle<Script> maybe_cached_script) { … }
bool BackgroundCompileTask::FinalizeFunction(
Isolate* isolate, Compiler::ClearExceptionFlag flag) { … }
void BackgroundCompileTask::AbortFunction() { … }
void BackgroundCompileTask::ReportStatistics(Isolate* isolate) { … }
BackgroundDeserializeTask::BackgroundDeserializeTask(
Isolate* isolate, std::unique_ptr<ScriptCompiler::CachedData> cached_data)
: … { … }
void BackgroundDeserializeTask::Run() { … }
void BackgroundDeserializeTask::SourceTextAvailable(
Isolate* isolate, Handle<String> source_text,
const ScriptDetails& script_details) { … }
bool BackgroundDeserializeTask::ShouldMergeWithExistingScript() const { … }
void BackgroundDeserializeTask::MergeWithExistingScript() { … }
MaybeHandle<SharedFunctionInfo> BackgroundDeserializeTask::Finish(
Isolate* isolate, DirectHandle<String> source,
const ScriptDetails& script_details) { … }
bool Compiler::CollectSourcePositions(Isolate* isolate,
Handle<SharedFunctionInfo> shared_info) { … }
bool Compiler::Compile(Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
ClearExceptionFlag flag,
IsCompiledScope* is_compiled_scope,
CreateSourcePositions create_source_positions_flag) { … }
bool Compiler::Compile(Isolate* isolate, Handle<JSFunction> function,
ClearExceptionFlag flag,
IsCompiledScope* is_compiled_scope) { … }
bool Compiler::CompileSharedWithBaseline(Isolate* isolate,
Handle<SharedFunctionInfo> shared,
Compiler::ClearExceptionFlag flag,
IsCompiledScope* is_compiled_scope) { … }
bool Compiler::CompileBaseline(Isolate* isolate,
DirectHandle<JSFunction> function,
ClearExceptionFlag flag,
IsCompiledScope* is_compiled_scope) { … }
MaybeHandle<SharedFunctionInfo> Compiler::CompileToplevel(
ParseInfo* parse_info, Handle<Script> script, Isolate* isolate,
IsCompiledScope* is_compiled_scope) { … }
bool Compiler::FinalizeBackgroundCompileTask(BackgroundCompileTask* task,
Isolate* isolate,
ClearExceptionFlag flag) { … }
void Compiler::CompileOptimized(Isolate* isolate, Handle<JSFunction> function,
ConcurrencyMode mode, CodeKind code_kind) { … }
MaybeHandle<SharedFunctionInfo> Compiler::CompileForLiveEdit(
ParseInfo* parse_info, Handle<Script> script,
MaybeHandle<ScopeInfo> outer_scope_info, Isolate* isolate) { … }
MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
Handle<String> source, Handle<SharedFunctionInfo> outer_info,
Handle<Context> context, LanguageMode language_mode,
ParseRestriction restriction, int parameters_end_pos, int eval_position,
ParsingWhileDebugging parsing_while_debugging) { … }
bool CodeGenerationFromStringsAllowed(Isolate* isolate,
Handle<NativeContext> context,
Handle<String> source) { … }
bool ModifyCodeGenerationFromStrings(Isolate* isolate,
Handle<NativeContext> context,
Handle<i::Object>* source,
bool is_code_like) { … }
std::pair<MaybeHandle<String>, bool> Compiler::ValidateDynamicCompilationSource(
Isolate* isolate, Handle<NativeContext> context,
Handle<i::Object> original_source, bool is_code_like) { … }
MaybeHandle<JSFunction> Compiler::GetFunctionFromValidatedString(
Handle<NativeContext> native_context, MaybeHandle<String> source,
ParseRestriction restriction, int parameters_end_pos) { … }
MaybeHandle<JSFunction> Compiler::GetFunctionFromString(
Handle<NativeContext> context, Handle<Object> source,
int parameters_end_pos, bool is_code_like) { … }
namespace {
struct ScriptCompileTimerScope { … };
Handle<Script> NewScript(Isolate* isolate, ParseInfo* parse_info,
Handle<String> source, ScriptDetails script_details,
NativesFlag natives) { … }
MaybeHandle<SharedFunctionInfo> CompileScriptOnMainThread(
const UnoptimizedCompileFlags flags, Handle<String> source,
const ScriptDetails& script_details, NativesFlag natives,
v8::Extension* extension, Isolate* isolate,
MaybeHandle<Script> maybe_script, IsCompiledScope* is_compiled_scope,
CompileHintCallback compile_hint_callback = nullptr,
void* compile_hint_callback_data = nullptr) { … }
class StressBackgroundCompileThread : public ParkingThread { … };
bool CanBackgroundCompile(const ScriptDetails& script_details,
v8::Extension* extension,
ScriptCompiler::CompileOptions compile_options,
NativesFlag natives) { … }
bool CompilationExceptionIsRangeError(Isolate* isolate, Handle<Object> obj) { … }
MaybeHandle<SharedFunctionInfo> CompileScriptOnBothBackgroundAndMainThread(
Handle<String> source, const ScriptDetails& script_details,
Isolate* isolate, IsCompiledScope* is_compiled_scope) { … }
namespace {
ScriptCompiler::InMemoryCacheResult CategorizeLookupResult(
const CompilationCacheScript::LookupResult& lookup_result) { … }
}
MaybeHandle<SharedFunctionInfo> GetSharedFunctionInfoForScriptImpl(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details, v8::Extension* extension,
AlignedCachedData* cached_data, BackgroundDeserializeTask* deserialize_task,
v8::CompileHintCallback compile_hint_callback,
void* compile_hint_callback_data,
ScriptCompiler::CompileOptions compile_options,
ScriptCompiler::NoCacheReason no_cache_reason, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
}
MaybeHandle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details,
ScriptCompiler::CompileOptions compile_options,
ScriptCompiler::NoCacheReason no_cache_reason, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
MaybeHandle<SharedFunctionInfo>
Compiler::GetSharedFunctionInfoForScriptWithExtension(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details, v8::Extension* extension,
ScriptCompiler::CompileOptions compile_options, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
MaybeHandle<SharedFunctionInfo>
Compiler::GetSharedFunctionInfoForScriptWithCachedData(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details, AlignedCachedData* cached_data,
ScriptCompiler::CompileOptions compile_options,
ScriptCompiler::NoCacheReason no_cache_reason, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
MaybeHandle<SharedFunctionInfo>
Compiler::GetSharedFunctionInfoForScriptWithDeserializeTask(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details,
BackgroundDeserializeTask* deserialize_task,
ScriptCompiler::CompileOptions compile_options,
ScriptCompiler::NoCacheReason no_cache_reason, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
MaybeHandle<SharedFunctionInfo>
Compiler::GetSharedFunctionInfoForScriptWithCompileHints(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details,
v8::CompileHintCallback compile_hint_callback,
void* compile_hint_callback_data,
ScriptCompiler::CompileOptions compile_options,
ScriptCompiler::NoCacheReason no_cache_reason, NativesFlag natives,
ScriptCompiler::CompilationDetails* compilation_details) { … }
MaybeHandle<JSFunction> Compiler::GetWrappedFunction(
Handle<String> source, Handle<Context> context,
const ScriptDetails& script_details, AlignedCachedData* cached_data,
v8::ScriptCompiler::CompileOptions compile_options,
v8::ScriptCompiler::NoCacheReason no_cache_reason) { … }
MaybeHandle<SharedFunctionInfo>
Compiler::GetSharedFunctionInfoForStreamedScript(
Isolate* isolate, Handle<String> source,
const ScriptDetails& script_details, ScriptStreamingData* streaming_data,
ScriptCompiler::CompilationDetails* compilation_details) { … }
template <typename IsolateT>
Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
FunctionLiteral* literal, Handle<Script> script, IsolateT* isolate) { … }
template Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
FunctionLiteral* literal, Handle<Script> script, Isolate* isolate);
template Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
FunctionLiteral* literal, Handle<Script> script, LocalIsolate* isolate);
MaybeHandle<Code> Compiler::CompileOptimizedOSR(Isolate* isolate,
Handle<JSFunction> function,
BytecodeOffset osr_offset,
ConcurrencyMode mode,
CodeKind code_kind) { … }
void Compiler::DisposeTurbofanCompilationJob(Isolate* isolate,
TurbofanCompilationJob* job) { … }
void Compiler::FinalizeTurbofanCompilationJob(TurbofanCompilationJob* job,
Isolate* isolate) { … }
void Compiler::FinalizeMaglevCompilationJob(maglev::MaglevCompilationJob* job,
Isolate* isolate) { … }
void Compiler::PostInstantiation(Isolate* isolate,
DirectHandle<JSFunction> function,
IsCompiledScope* is_compiled_scope) { … }
std::unique_ptr<v8::tracing::TracedValue> Compiler::AddScriptCompiledTrace(
Isolate* isolate, DirectHandle<SharedFunctionInfo> shared) { … }
void Compiler::EmitScriptSourceTextTrace(
Isolate* isolate, DirectHandle<SharedFunctionInfo> shared) { … }
ScriptStreamingData::ScriptStreamingData(
std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream,
ScriptCompiler::StreamedSource::Encoding encoding)
: … { … }
ScriptStreamingData::~ScriptStreamingData() = default;
void ScriptStreamingData::Release() { … }
}
}