19#ifdef V8_ENABLE_SPARKPLUG
23#ifdef V8_ENABLE_MAGLEV
27#if V8_ENABLE_WEBASSEMBLY
63 uintptr_t limit, uintptr_t jslimit) {
90void StackGuard::AdjustStackLimitForSimulator() {
101void StackGuard::ResetStackLimitForSimulator() {
116 uint32_t intercepted =
123 uint32_t restored_flags = 0;
125 current !=
nullptr; current = current->
prev_) {
126 restored_flags |= (current->intercepted_flags_ & scope->
intercept_mask_);
127 current->intercepted_flags_ &= ~scope->intercept_mask_;
150 interrupt = interrupt << 1) {
153 top->prev_->Intercept(flag)) {
189 current !=
nullptr; current = current->
prev_) {
190 current->intercepted_flags_ &= ~flag;
219 mask = TERMINATE_EXECUTION;
249 const uintptr_t kLimitSize =
v8_flags.stack_size *
KB;
255 real_climit_ = limit;
266 uintptr_t stored_limit = per_thread->stack_limit();
268 if (stored_limit != 0) {
277bool TestAndClear(
int* bitfield,
int mask) {
286 explicit ShouldBeZeroOnReturnScope(
int*) {}
288 explicit ShouldBeZeroOnReturnScope(
int* v) :
v_(v) {}
289 ~ShouldBeZeroOnReturnScope() {
DCHECK_EQ(*
v_, 0); }
315 ShouldBeZeroOnReturnScope should_be_zero_on_return(&interrupt_flags);
317 if (TestAndClear(&interrupt_flags, TERMINATE_EXECUTION)) {
322 if (TestAndClear(&interrupt_flags, GC_REQUEST)) {
327 if (TestAndClear(&interrupt_flags, START_INCREMENTAL_MARKING)) {
331 if (TestAndClear(&interrupt_flags, GLOBAL_SAFEPOINT)) {
336#if V8_ENABLE_WEBASSEMBLY
337 if (TestAndClear(&interrupt_flags, GROW_SHARED_MEMORY)) {
339 BackingStore::UpdateSharedWasmMemoryObjects(
isolate_);
342 if (TestAndClear(&interrupt_flags, LOG_WASM_CODE)) {
347 if (TestAndClear(&interrupt_flags, WASM_CODE_GC)) {
353 if (TestAndClear(&interrupt_flags, DEOPT_MARKED_ALLOCATION_SITES)) {
355 "V8.GCDeoptMarkedAllocationSites");
359 if (TestAndClear(&interrupt_flags, INSTALL_CODE)) {
361 "V8.InstallOptimizedFunctions");
366#ifdef V8_ENABLE_SPARKPLUG
367 if (TestAndClear(&interrupt_flags, INSTALL_BASELINE_CODE)) {
369 "V8.FinalizeBaselineConcurrentCompilation");
370 isolate_->baseline_batch_compiler()->InstallBatch();
374#ifdef V8_ENABLE_MAGLEV
375 if (TestAndClear(&interrupt_flags, INSTALL_MAGLEV_CODE)) {
377 "V8.FinalizeMaglevConcurrentCompilation");
378 isolate_->maglev_concurrent_dispatcher()->FinalizeFinishedJobs();
382 if (TestAndClear(&interrupt_flags, API_INTERRUPT)) {
383 TRACE_EVENT0(
"v8.execute",
"V8.InvokeApiInterruptCallbacks");
388#ifdef V8_RUNTIME_CALL_STATS
392 if (TracingFlags::is_runtime_stats_enabled() &&
393 Protectors::IsNoProfilingIntact(
isolate_)) {
394 Protectors::InvalidateNoProfiling(
isolate_);
static StackSlot GetStackStart()
void DeoptMarkedAllocationSites()
V8_EXPORT_PRIVATE void StartIncrementalMarkingOnInterrupt()
V8_EXPORT_PRIVATE double MonotonicallyIncreasingTimeInMs() const
const uint32_t intercept_mask_
bool Intercept(StackGuard::InterruptFlag flag)
uint32_t intercepted_flags_
OptimizingCompileDispatcher * optimizing_compile_dispatcher()
void InvokeApiInterruptCallbacks()
PerIsolateThreadData * FindOrAllocatePerThreadDataForThisThread()
FutexWaitListNode * futex_wait_list_node()
Tagged< Object > TerminateExecution()
bool concurrent_recompilation_enabled()
LocalHeap * main_thread_local_heap()
void InstallOptimizedFunctions()
static uintptr_t JsLimitFromCLimit(v8::internal::Isolate *isolate, uintptr_t c_limit)
void set_interrupt_requested(InterruptLevel level, bool requested)
uint32_t interrupt_flags_
void Initialize(Isolate *isolate, const ExecutionAccess &lock)
base::AtomicWord jslimit_
void set_jslimit(uintptr_t limit)
bool has_interrupt_requested(InterruptLevel level)
InterruptsScope * interrupt_scopes_
void InitThread(const ExecutionAccess &lock)
static const uintptr_t kInterruptLimit
static constexpr InterruptFlag InterruptLevelMask(InterruptLevel level)
void update_interrupt_requests_and_stack_limits(const ExecutionAccess &lock)
ThreadLocal thread_local_
bool has_pending_interrupts(const ExecutionAccess &lock)
void ClearInterrupt(InterruptFlag flag)
bool HasTerminationRequest()
Tagged< Object > HandleInterrupts(InterruptLevel level=InterruptLevel::kAnyEffect)
char * ArchiveStackGuard(char *to)
void PopInterruptsScope()
void SetStackLimitForStackSwitching(uintptr_t limit)
void PushInterruptsScope(InterruptsScope *scope)
void SetStackLimitInternal(const ExecutionAccess &lock, uintptr_t limit, uintptr_t jslimit)
void SetStackLimit(uintptr_t limit)
char * RestoreStackGuard(char *from)
void RequestInterrupt(InterruptFlag flag)
void FreeThreadResources()
bool CheckInterrupt(InterruptFlag flag)
int FetchAndClearInterrupts(InterruptLevel level)
void ReportLiveCodeFromStackForGC(Isolate *)
void LogOutstandingCodesForIsolate(Isolate *)
ZoneVector< RpoNumber > & result
Atomic8 Relaxed_CompareAndSwap(volatile Atomic8 *ptr, Atomic8 old_value, Atomic8 new_value)
WasmEngine * GetWasmEngine()
refactor address components for immediate indexing make OptimizeMaglevOnNextCall optimize to turbofan instead of maglev filter for tracing turbofan compilation trace turbo cfg trace TurboFan s graph trimmer trace TurboFan s control equivalence trace TurboFan s register allocator trace stack load store counters for optimized code in run fuzzing &&concurrent_recompilation trace_turbo trace_turbo_scheduled trace_turbo_stack_accesses verify TurboFan machine graph of code stubs enable FixedArray bounds checks print TurboFan statistics of wasm compilations maximum cumulative size of bytecode considered for inlining scale factor of bytecode size used to calculate the inlining budget * KB
V8_EXPORT_PRIVATE FlagValues v8_flags
void MemCopy(void *dest, const void *src, size_t size)
#define DCHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
#define TRACE_EVENT0(category_group, name)
#define TRACE_DISABLED_BY_DEFAULT(name)