v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
compiler.h
Go to the documentation of this file.
1// Copyright 2012 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_COMPILER_H_
6#define V8_CODEGEN_COMPILER_H_
7
8#include <forward_list>
9#include <memory>
10
17#include "src/common/globals.h"
28#include "src/zone/zone.h"
29
30namespace v8 {
31
32namespace tracing {
33class TracedValue;
34} // namespace tracing
35
36namespace internal {
37
38// Forward declarations.
39class AlignedCachedData;
40class BackgroundCompileTask;
41class IsCompiledScope;
42class OptimizedCompilationInfo;
43class ParseInfo;
44class RuntimeCallStats;
45class TimedHistogram;
46class TurbofanCompilationJob;
47class UnoptimizedCompilationInfo;
48class UnoptimizedCompilationJob;
49class UnoptimizedJSFrame;
50class WorkerThreadRuntimeCallStats;
51struct ScriptDetails;
52struct ScriptStreamingData;
53
54namespace maglev {
55class MaglevCompilationJob;
56
57static inline bool IsMaglevEnabled() { return v8_flags.maglev; }
58
59static inline bool IsMaglevOsrEnabled() {
60 return IsMaglevEnabled() && v8_flags.maglev_osr;
61}
62
63} // namespace maglev
64
65// The V8 compiler API.
66//
67// This is the central hub for dispatching to the various compilers within V8.
68// Logic for which compiler to choose and how to wire compilation results into
69// the object heap should be kept inside this class.
70//
71// General strategy: Scripts are translated into anonymous functions w/o
72// parameters which then can be executed. If the source code contains other
73// functions, they might be compiled and allocated as part of the compilation
74// of the source code or deferred for lazy compilation at a later point.
76 public:
77 enum ClearExceptionFlag { KEEP_EXCEPTION, CLEAR_EXCEPTION };
78
79 // ===========================================================================
80 // The following family of methods ensures a given function is compiled. The
81 // general contract is that failures will be reported by returning {false},
82 // whereas successful compilation ensures the {is_compiled} predicate on the
83 // given function holds (except for live-edit, which compiles the world).
84
85 static bool Compile(Isolate* isolate, Handle<SharedFunctionInfo> shared,
86 ClearExceptionFlag flag,
87 IsCompiledScope* is_compiled_scope,
88 CreateSourcePositions create_source_positions_flag =
89 CreateSourcePositions::kNo);
90 static bool Compile(Isolate* isolate, DirectHandle<JSFunction> function,
91 ClearExceptionFlag flag,
92 IsCompiledScope* is_compiled_scope);
93 static MaybeHandle<SharedFunctionInfo> CompileToplevel(
94 ParseInfo* parse_info, Handle<Script> script, Isolate* isolate,
95 IsCompiledScope* is_compiled_scope);
96
97 static bool CompileSharedWithBaseline(Isolate* isolate,
99 ClearExceptionFlag flag,
100 IsCompiledScope* is_compiled_scope);
101 static bool CompileBaseline(Isolate* isolate,
103 ClearExceptionFlag flag,
104 IsCompiledScope* is_compiled_scope);
105
106 static void CompileOptimized(Isolate* isolate,
108 ConcurrencyMode mode, CodeKind code_kind);
109
110 // Generate and return optimized code for OSR. The empty handle is returned
111 // either on failure, or after spawning a concurrent OSR task (in which case
112 // a future OSR request will pick up the resulting code object).
113 V8_WARN_UNUSED_RESULT static MaybeHandle<Code> CompileOptimizedOSR(
114 Isolate* isolate, DirectHandle<JSFunction> function,
115 BytecodeOffset osr_offset, ConcurrencyMode mode, CodeKind code_kind);
116
118 CompileForLiveEdit(ParseInfo* parse_info, Handle<Script> script,
119 MaybeDirectHandle<ScopeInfo> outer_scope_info,
120 Isolate* isolate);
121
122 // Collect source positions for a function that has already been compiled to
123 // bytecode, but for which source positions were not collected (e.g. because
124 // they were not immediately needed).
125 static bool CollectSourcePositions(Isolate* isolate,
127
128 // Finalize and install code from previously run background compile task.
129 static bool FinalizeBackgroundCompileTask(BackgroundCompileTask* task,
130 Isolate* isolate,
131 ClearExceptionFlag flag);
132
133 // Dispose a job without finalization.
134 static void DisposeTurbofanCompilationJob(Isolate* isolate,
136
137 // Finalize and install Turbofan code from a previously run job.
138 static void FinalizeTurbofanCompilationJob(TurbofanCompilationJob* job,
139 Isolate* isolate);
140
141 // Finalize and install Maglev code from a previously run job.
142 static void FinalizeMaglevCompilationJob(maglev::MaglevCompilationJob* job,
143 Isolate* isolate);
144
145 // Dispose a Maglev compile job.
146 static void DisposeMaglevCompilationJob(maglev::MaglevCompilationJob* job,
147 Isolate* isolate);
148
149 // Give the compiler a chance to perform low-latency initialization tasks of
150 // the given {function} on its instantiation. Note that only the runtime will
151 // offer this chance, optimized closure instantiation will not call this.
152 static void PostInstantiation(Isolate* isolate,
154 IsCompiledScope* is_compiled_scope);
155
156 // ===========================================================================
157 // The following family of methods instantiates new functions for scripts or
158 // function literals. The decision whether those functions will be compiled,
159 // is left to the discretion of the compiler.
160 //
161 // Please note this interface returns shared function infos. This means you
162 // need to call Factory::NewFunctionFromSharedFunctionInfo before you have a
163 // real function with a context.
164
165 // Create a (bound) function for a String source within a context for eval.
167 GetFunctionFromEval(DirectHandle<String> source,
169 DirectHandle<Context> context, LanguageMode language_mode,
170 ParseRestriction restriction, int parameters_end_pos,
171 int eval_position,
172 ParsingWhileDebugging parsing_while_debugging =
173 ParsingWhileDebugging::kNo);
174
175 // Create a function that results from wrapping |source| in a function,
176 // with |arguments| being a list of parameters for that function.
179 const ScriptDetails& script_details, AlignedCachedData* cached_data,
181 v8::ScriptCompiler::NoCacheReason no_cache_reason);
182
183 // Create a (bound) function for a String source within a context for eval.
185 GetFunctionFromString(DirectHandle<NativeContext> context,
186 Handle<i::Object> source, int parameters_end_pos,
187 bool is_code_like);
188
189 // Decompose GetFunctionFromString into two functions, to allow callers to
190 // deal separately with a case of object not handled by the embedder.
191 V8_WARN_UNUSED_RESULT static std::pair<MaybeDirectHandle<String>, bool>
192 ValidateDynamicCompilationSource(Isolate* isolate,
194 Handle<i::Object> source_object,
195 bool is_code_like = false);
197 GetFunctionFromValidatedString(DirectHandle<NativeContext> context,
199 ParseRestriction restriction,
200 int parameters_end_pos);
201
202 // Create a shared function info object for a String source.
203 static MaybeDirectHandle<SharedFunctionInfo> GetSharedFunctionInfoForScript(
204 Isolate* isolate, Handle<String> source,
205 const ScriptDetails& script_details,
206 ScriptCompiler::CompileOptions compile_options,
207 ScriptCompiler::NoCacheReason no_cache_reason,
208 NativesFlag is_natives_code,
209 ScriptCompiler::CompilationDetails* compilation_details);
210
211 // Create a shared function info object for a String source.
213 GetSharedFunctionInfoForScriptWithExtension(
214 Isolate* isolate, Handle<String> source,
215 const ScriptDetails& script_details, v8::Extension* extension,
216 ScriptCompiler::CompileOptions compile_options,
217 NativesFlag is_natives_code,
218 ScriptCompiler::CompilationDetails* compilation_details);
219
220 // Create a shared function info object for a String source and serialized
221 // cached data. The cached data may be rejected, in which case this function
222 // will set cached_data->rejected() to true.
224 GetSharedFunctionInfoForScriptWithCachedData(
225 Isolate* isolate, Handle<String> source,
226 const ScriptDetails& script_details, AlignedCachedData* cached_data,
227 ScriptCompiler::CompileOptions compile_options,
228 ScriptCompiler::NoCacheReason no_cache_reason,
229 NativesFlag is_natives_code,
230 ScriptCompiler::CompilationDetails* compilation_details);
231
232 // Create a shared function info object for a String source and a task that
233 // has deserialized cached data on a background thread. The cached data from
234 // the task may be rejected, in which case this function will set
235 // deserialize_task->rejected() to true.
237 GetSharedFunctionInfoForScriptWithDeserializeTask(
238 Isolate* isolate, Handle<String> source,
239 const ScriptDetails& script_details,
240 BackgroundDeserializeTask* deserialize_task,
241 ScriptCompiler::CompileOptions compile_options,
242 ScriptCompiler::NoCacheReason no_cache_reason,
243 NativesFlag is_natives_code,
244 ScriptCompiler::CompilationDetails* compilation_details);
245
247 GetSharedFunctionInfoForScriptWithCompileHints(
248 Isolate* isolate, Handle<String> source,
249 const ScriptDetails& script_details,
250 v8::CompileHintCallback compile_hint_callback,
251 void* compile_hint_callback_data,
252 ScriptCompiler::CompileOptions compile_options,
253 ScriptCompiler::NoCacheReason no_cache_reason,
254 NativesFlag is_natives_code,
255 ScriptCompiler::CompilationDetails* compilation_details);
256
257 // Create a shared function info object for a Script source that has already
258 // been parsed and possibly compiled on a background thread while being loaded
259 // from a streamed source. On return, the data held by |streaming_data| will
260 // have been released, however the object itself isn't freed and is still
261 // owned by the caller.
263 GetSharedFunctionInfoForStreamedScript(
264 Isolate* isolate, Handle<String> source,
265 const ScriptDetails& script_details, ScriptStreamingData* streaming_data,
266 ScriptCompiler::CompilationDetails* compilation_details);
267
268 // Create a shared function info object for the given function literal
269 // node (the code may be lazily compiled).
270 template <typename IsolateT>
271 static DirectHandle<SharedFunctionInfo> GetSharedFunctionInfo(
272 FunctionLiteral* node, DirectHandle<Script> script, IsolateT* isolate);
273
274 static void LogFunctionCompilation(Isolate* isolate,
279 DirectHandle<AbstractCode> abstract_code,
280 CodeKind kind, double time_taken_ms);
281
282 static void InstallInterpreterTrampolineCopy(
283 Isolate* isolate, DirectHandle<SharedFunctionInfo> shared_info,
285};
286
287// A base class for compilation jobs intended to run concurrent to the main
288// thread. The current state of the job can be checked using {state()}.
290 public:
291 enum Status { SUCCEEDED, FAILED, RETRY_ON_MAIN_THREAD };
292 enum class State {
293 kReadyToPrepare,
294 kReadyToExecute,
295 kReadyToFinalize,
296 kSucceeded,
297 kFailed,
298 };
299
300 explicit CompilationJob(State initial_state) : state_(initial_state) {}
301 virtual ~CompilationJob() = default;
302
303 State state() const { return state_; }
304
305 protected:
307 switch (status) {
308 case SUCCEEDED:
309 state_ = next_state;
310 break;
311 case FAILED:
312 state_ = State::kFailed;
313 break;
314 case RETRY_ON_MAIN_THREAD:
315 // Don't change the state, we'll re-try on the main thread.
316 break;
317 }
318 return status;
319 }
320
321 private:
323};
324
325// A base class for unoptimized compilation jobs.
326//
327// The job is split into two phases which are called in sequence on
328// different threads and with different limitations:
329// 1) ExecuteJob: Runs concurrently. No heap allocation or handle derefs.
330// 2) FinalizeJob: Runs on main thread. No dependency changes.
331//
332// Either of phases can either fail or succeed.
334 public:
341
342 // Executes the compile job. Can be called on a background thread.
344
345 // Finalizes the compile job. Must be called on the main thread.
348
349 // Finalizes the compile job. Can be called on a background thread, and might
350 // return RETRY_ON_MAIN_THREAD if the finalization can't be run on the
351 // background thread, and should instead be retried on the foreground thread.
353 DirectHandle<SharedFunctionInfo> shared_info, LocalIsolate* isolate);
354
355 void RecordCompilationStats(Isolate* isolate) const;
358 Isolate* isolate) const;
359
362 return parse_info_;
363 }
367
368 uintptr_t stack_limit() const { return stack_limit_; }
369
376
377 void ClearParseInfo() { parse_info_ = nullptr; }
378
379 protected:
380 // Overridden by the actual implementation.
381 virtual Status ExecuteJobImpl() = 0;
383 Isolate* isolate) = 0;
385 LocalIsolate* isolate) = 0;
386
387 private:
388 uintptr_t stack_limit_;
393};
394
395// A base class for optimized compilation jobs.
396//
397// The job is split into three phases which are called in sequence on
398// different threads and with different limitations:
399// 1) PrepareJob: Runs on main thread. No major limitations.
400// 2) ExecuteJob: Runs concurrently. No heap allocation or handle derefs.
401// 3) FinalizeJob: Runs on main thread. No dependency changes.
402//
403// Each of the three phases can either fail or succeed.
405 public:
406 OptimizedCompilationJob(const char* compiler_name, State initial_state)
407 : CompilationJob(initial_state), compiler_name_(compiler_name) {
408 timer_.Start();
409 }
410
411 // Prepare the compile job. Must be called on the main thread.
413
414 // Executes the compile job. Can be called on a background thread.
416 ExecuteJob(RuntimeCallStats* stats, LocalIsolate* local_isolate = nullptr);
417
418 // Finalizes the compile job. Must be called on the main thread.
420
421 const char* compiler_name() const { return compiler_name_; }
422
423 double prepare_in_ms() const {
425 }
426 double execute_in_ms() const {
428 }
429 double finalize_in_ms() const {
431 }
432
436
437 protected:
438 // Overridden by the actual implementation.
439 virtual Status PrepareJobImpl(Isolate* isolate) = 0;
441 LocalIsolate* local_heap) = 0;
442 virtual Status FinalizeJobImpl(Isolate* isolate) = 0;
443
444 // Register weak object to optimized code dependencies.
446 DirectHandle<Code> code);
451
455
457
458 private:
459 const char* const compiler_name_;
460};
461
462// Thin wrapper to split off Turbofan-specific parts.
464 public:
467 State initial_state);
468
472
473 // Report a transient failure, try again next time. Should only be called on
474 // optimization compilation jobs.
475 Status RetryOptimization(BailoutReason reason);
476
477 // Report a persistent failure, disable future optimization on the function.
478 // Should only be called on optimization compilation jobs.
479 Status AbortOptimization(BailoutReason reason);
480
481 void RecordCompilationStats(ConcurrencyMode mode, Isolate* isolate) const;
483 Isolate* isolate) const;
484
485 // Only used for concurrent builtin generation, which needs to be
486 // deterministic and reproducible.
487 virtual int FinalizeOrder() const { UNREACHABLE(); }
488
489 // Intended for use as a globally unique id in trace events.
490 uint64_t trace_id() const;
491
492 Isolate* isolate() const { return isolate_; }
493
494 void Cancel();
495
496 private:
499 uint64_t trace_id_;
500};
501
541
543 std::vector<FinalizeUnoptimizedCompilationData>;
544
546 public:
549 std::unique_ptr<UnoptimizedCompilationJob> job) {
550 UNREACHABLE();
551 }
554 std::unique_ptr<UnoptimizedCompilationJob> job);
555
559
560 UnoptimizedCompilationJob* job() const { return job_.get(); }
561
562 private:
564 std::unique_ptr<UnoptimizedCompilationJob> job_;
565};
566
567// A wrapper around a OptimizedCompilationInfo that detaches the Handles from
568// the underlying PersistentHandlesScope and stores them in info_ on
569// destruction.
581
583 std::vector<DeferredFinalizationJobData>;
584
586 public:
587 // Creates a new task that when run will parse and compile the streamed
588 // script associated with |data| and can be finalized with FinalizeScript.
589 // Note: does not take ownership of |data|.
591 v8::ScriptType type,
593 ScriptCompiler::CompilationDetails* compilation_details,
594 CompileHintCallback compile_hint_callback = nullptr,
595 void* compile_hint_callback_data = nullptr);
599
600 // Creates a new task that when run will parse and compile the non-top-level
601 // |shared_info| and can be finalized with FinalizeFunction in
602 // Compiler::FinalizeBackgroundCompileTask.
604 Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
605 std::unique_ptr<Utf16CharacterStream> character_stream,
606 WorkerThreadRuntimeCallStats* worker_thread_runtime_stats,
607 TimedHistogram* timer, int max_stack_size);
608
609 void Run();
610 void RunOnMainThread(Isolate* isolate);
611 void Run(LocalIsolate* isolate,
612 ReusableUnoptimizedCompileState* reusable_state);
613
614 MaybeHandle<SharedFunctionInfo> FinalizeScript(
615 Isolate* isolate, DirectHandle<String> source,
616 const ScriptDetails& script_details,
617 MaybeDirectHandle<Script> maybe_cached_script);
618
619 bool FinalizeFunction(Isolate* isolate, Compiler::ClearExceptionFlag flag);
620
621 void AbortFunction();
622
624
625 private:
626 void ReportStatistics(Isolate* isolate);
627
629
630 bool is_streaming_compilation() const;
631
632 // Data needed for parsing and compilation. These need to be initialized
633 // before the compilation starts.
637 std::unique_ptr<Utf16CharacterStream> character_stream_;
642
643 // Data needed for merging onto the main thread after background finalization.
644 std::unique_ptr<PersistentHandles> persistent_handles_;
651 int total_preparse_skipped_ = 0;
652
653 // Single function data for top-level function compilation.
658
659 CompileHintCallback compile_hint_callback_ = nullptr;
660 void* compile_hint_callback_data_ = nullptr;
661};
662
663// Contains all data which needs to be transmitted between threads for
664// background parsing and compiling and finalizing it on the main thread.
667 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream,
672
673 void Release();
674
675 // Internal implementation of v8::ScriptCompiler::StreamedSource.
676 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream;
678
679 // Task that performs background parsing and compilation.
680 std::unique_ptr<BackgroundCompileTask> task;
681};
682
684 public:
686 std::unique_ptr<ScriptCompiler::CachedData> data);
687
688 void Run();
689
690 // Checks the Isolate compilation cache to see whether it will be necessary to
691 // merge the newly deserialized objects into an existing Script. This can
692 // change the value of ShouldMergeWithExistingScript, and embedders should
693 // check the latter after calling this. May only be called on a thread where
694 // the Isolate is currently entered.
695 void SourceTextAvailable(Isolate* isolate, Handle<String> source_text,
696 const ScriptDetails& script_details);
697
698 // Returns whether the embedder should call MergeWithExistingScript. This
699 // function may be called from any thread, any number of times, but its return
700 // value is only meaningful after SourceTextAvailable has completed.
701 bool ShouldMergeWithExistingScript() const;
702
703 // Partially merges newly deserialized objects into an existing Script with
704 // the same source, as provided by SourceTextAvailable, and generates a list
705 // of follow-up work for the main thread. May be called from any thread, only
706 // once.
707 void MergeWithExistingScript();
708
710 Isolate* isolate, DirectHandle<String> source,
711 const ScriptDetails& script_details);
712
713 bool rejected() const { return cached_data_.rejected(); }
714
716 return background_time_in_microseconds_;
717 }
718
719 private:
725 int64_t background_time_in_microseconds_ = 0;
726};
727
728} // namespace internal
729} // namespace v8
730
731#endif // V8_CODEGEN_COMPILER_H_
Builtins::Kind kind
Definition builtins.cc:40
TimeDelta Elapsed() const
double InMillisecondsF() const
Definition time.cc:226
WorkerThreadRuntimeCallStats * worker_thread_runtime_call_stats_
Definition compiler.h:639
std::unique_ptr< Utf16CharacterStream > character_stream_
Definition compiler.h:637
MaybeIndirectHandle< SharedFunctionInfo > outer_function_sfi_
Definition compiler.h:645
ScriptCompiler::CompilationDetails * compilation_details_
Definition compiler.h:641
UnoptimizedCompileFlags flags_
Definition compiler.h:635
BackgroundCompileTask & operator=(const BackgroundCompileTask &)=delete
DeferredFinalizationJobDataList jobs_to_retry_finalization_on_main_thread_
Definition compiler.h:649
UnoptimizedCompileState compile_state_
Definition compiler.h:636
FinalizeUnoptimizedCompilationDataList finalize_unoptimized_compilation_data_
Definition compiler.h:648
BackgroundCompileTask(const BackgroundCompileTask &)=delete
UnoptimizedCompileFlags flags() const
Definition compiler.h:623
std::unique_ptr< PersistentHandles > persistent_handles_
Definition compiler.h:644
IndirectHandle< Script > script_
Definition compiler.h:646
base::SmallVector< v8::Isolate::UseCounterFeature, 8 > use_counts_
Definition compiler.h:650
MaybeIndirectHandle< SharedFunctionInfo > input_shared_info_
Definition compiler.h:654
CodeSerializer::OffThreadDeserializeData off_thread_data_
Definition compiler.h:722
int64_t background_time_in_microseconds() const
Definition compiler.h:715
BackgroundMergeTask background_merge_task_
Definition compiler.h:723
CompilationHandleScope(Isolate *isolate, OptimizedCompilationInfo *info)
Definition compiler.h:572
PersistentHandlesScope persistent_
Definition compiler.h:578
OptimizedCompilationInfo * info_
Definition compiler.h:579
V8_WARN_UNUSED_RESULT Status UpdateState(Status status, State next_state)
Definition compiler.h:306
virtual ~CompilationJob()=default
CompilationJob(State initial_state)
Definition compiler.h:300
DeferredFinalizationJobData(Isolate *isolate, DirectHandle< SharedFunctionInfo > function_handle, std::unique_ptr< UnoptimizedCompilationJob > job)
Definition compiler.h:547
std::unique_ptr< UnoptimizedCompilationJob > job_
Definition compiler.h:564
Handle< SharedFunctionInfo > function_handle_
Definition compiler.h:563
UnoptimizedCompilationJob * job() const
Definition compiler.h:560
Handle< SharedFunctionInfo > function_handle() const
Definition compiler.h:556
MaybeHandle< CoverageInfo > coverage_info_
Definition compiler.h:539
MaybeDirectHandle< CoverageInfo > coverage_info() const
Definition compiler.h:524
Handle< SharedFunctionInfo > function_handle_
Definition compiler.h:538
Handle< SharedFunctionInfo > function_handle() const
Definition compiler.h:520
FinalizeUnoptimizedCompilationData(Isolate *isolate, Handle< SharedFunctionInfo > function_handle, MaybeHandle< CoverageInfo > coverage_info, base::TimeDelta time_taken_to_execute, base::TimeDelta time_taken_to_finalize)
Definition compiler.h:504
const char * compiler_name() const
Definition compiler.h:421
void RegisterWeakObjectsInOptimizedCode(Isolate *isolate, DirectHandle< NativeContext > context, DirectHandle< Code > code, GlobalHandleVector< Map > maps)
Definition compiler.cc:504
OptimizedCompilationJob(const char *compiler_name, State initial_state)
Definition compiler.h:406
V8_WARN_UNUSED_RESULT base::TimeDelta ElapsedTime() const
Definition compiler.h:433
GlobalHandleVector< Map > CollectRetainedMaps(Isolate *isolate, DirectHandle< Code > code)
Definition compiler.cc:484
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT Status FinalizeJob(Isolate *isolate)
Definition compiler.cc:474
virtual Status PrepareJobImpl(Isolate *isolate)=0
virtual Status FinalizeJobImpl(Isolate *isolate)=0
virtual Status ExecuteJobImpl(RuntimeCallStats *stats, LocalIsolate *local_heap)=0
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT Status PrepareJob(Isolate *isolate)
Definition compiler.cc:453
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT Status ExecuteJob(RuntimeCallStats *stats, LocalIsolate *local_isolate=nullptr)
Definition compiler.cc:463
virtual int FinalizeOrder() const
Definition compiler.h:487
OptimizedCompilationInfo *const compilation_info_
Definition compiler.h:498
Status RetryOptimization(BailoutReason reason)
Definition compiler.cc:531
Status AbortOptimization(BailoutReason reason)
Definition compiler.cc:538
V8_EXPORT_PRIVATE TurbofanCompilationJob(Isolate *isolate, OptimizedCompilationInfo *compilation_info, State initial_state)
Definition compiler.cc:523
void RecordFunctionCompilation(LogEventListener::CodeTag code_type, Isolate *isolate) const
Definition compiler.cc:631
OptimizedCompilationInfo * compilation_info() const
Definition compiler.h:469
void RecordCompilationStats(ConcurrencyMode mode, Isolate *isolate) const
Definition compiler.cc:547
void RecordFunctionCompilation(LogEventListener::CodeTag code_type, Handle< SharedFunctionInfo > shared, Isolate *isolate) const
UnoptimizedCompilationInfo * compilation_info_
Definition compiler.h:390
virtual Status FinalizeJobImpl(DirectHandle< SharedFunctionInfo > shared_info, LocalIsolate *isolate)=0
base::TimeDelta time_taken_to_execute() const
Definition compiler.h:370
UnoptimizedCompilationJob(uintptr_t stack_limit, ParseInfo *parse_info, UnoptimizedCompilationInfo *compilation_info)
Definition compiler.h:335
V8_WARN_UNUSED_RESULT Status FinalizeJob(DirectHandle< SharedFunctionInfo > shared_info, Isolate *isolate)
Definition compiler.cc:398
void RecordCompilationStats(Isolate *isolate) const
base::TimeDelta time_taken_to_finalize() const
Definition compiler.h:373
UnoptimizedCompilationInfo * compilation_info() const
Definition compiler.h:364
V8_WARN_UNUSED_RESULT Status ExecuteJob()
Definition compiler.cc:390
virtual Status FinalizeJobImpl(DirectHandle< SharedFunctionInfo > shared_info, Isolate *isolate)=0
AlignedCachedData * cached_data_
JSRegExp::Flags flags_
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
std::string extension
PersistentHandlesScope persistent_
static bool IsMaglevOsrEnabled()
Definition compiler.h:59
static bool IsMaglevEnabled()
Definition compiler.h:57
std::vector< DeferredFinalizationJobData > DeferredFinalizationJobDataList
Definition compiler.h:582
V8_EXPORT_PRIVATE FlagValues v8_flags
std::vector< FinalizeUnoptimizedCompilationData > FinalizeUnoptimizedCompilationDataList
Definition compiler.h:542
bool(*)(int, void *) CompileHintCallback
ScriptType
Definition v8-script.h:397
OptimizedCompilationInfo * info_
Definition pipeline.cc:305
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
#define V8_EXPORT_PRIVATE
Definition macros.h:460
ScriptStreamingData & operator=(const ScriptStreamingData &)=delete
std::unique_ptr< ScriptCompiler::ExternalSourceStream > source_stream
Definition compiler.h:676
std::unique_ptr< BackgroundCompileTask > task
Definition compiler.h:680
ScriptCompiler::StreamedSource::Encoding encoding
Definition compiler.h:677
ScriptStreamingData(const ScriptStreamingData &)=delete
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:671
#define V8_NODISCARD
Definition v8config.h:693