5#ifndef RUNTIME_VM_STACK_FRAME_H_
6#define RUNTIME_VM_STACK_FRAME_H_
13#if defined(TARGET_ARCH_IA32)
15#elif defined(TARGET_ARCH_X64)
17#elif defined(TARGET_ARCH_ARM)
19#elif defined(TARGET_ARCH_ARM64)
21#elif defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
24#error Unknown architecture.
30class ObjectPointerVisitor;
58 return raw_pc == StubCode::DeoptimizeLazyFromReturn().EntryPoint();
61 set_pc(StubCode::DeoptimizeLazyFromReturn().EntryPoint());
68 ASSERT(original_pc != StubCode::DeoptimizeLazyFromReturn().EntryPoint());
78 *
reinterpret_cast<CodePtr*
>(
109 bool* needs_stacktrace,
111 bool* is_optimized)
const;
121 : fp_(0), sp_(0), pc_(0), thread_(
thread) {}
136 CodePtr GetCodeObject()
const;
138 uword GetCallerFp()
const {
139 return *(
reinterpret_cast<uword*
>(
fp() +
143 uword GetCallerPc()
const {
146 ASSERT(raw_pc != StubCode::DeoptimizeLazyFromThrow().EntryPoint());
147 if (raw_pc == StubCode::DeoptimizeLazyFromReturn().EntryPoint()) {
182 virtual const char*
GetName()
const {
return "exit"; }
204 virtual const char*
GetName()
const {
return "entry"; }
260 bool HasNext()
const {
273 explicit FrameSetIterator(Thread* thread)
274 : fp_(0), sp_(0), pc_(0), stack_frame_(thread), thread_(thread) {}
280 StackFrame stack_frame_;
288 ExitFrame* NextExitFrame();
291 EntryFrame* NextEntryFrame();
295 FrameSetIterator* NextFrameSet() {
return &frames_; }
299 void SetupLastExitFrameData();
300 void SetupNextExitFrameData();
305 FrameSetIterator frames_;
306 StackFrame* current_frame_;
326 cross_thread_policy) {}
334 cross_thread_policy) {}
346 cross_thread_policy) {}
349 : frames_(orig.frames_) {}
370 bool Done()
const {
return index_ == -1; }
375 return function_.
ptr();
388#if !defined(DART_PRECOMPILED_RUNTIME)
393 void SetDone() { index_ = -1; }
396 intptr_t num_materializations_;
397 intptr_t dest_frame_size_;
399 TypedData& deopt_info_;
402 GrowableArray<DeoptInstr*> deopt_instructions_;
403 ObjectPool& object_table_;
409void ValidateFrames();
413 intptr_t var_index) {
414 return fp_offset + var_index;
423 return other_fp <
fp;
DartFrameIterator(uword fp, uword sp, uword pc, Thread *thread, StackFrameIterator::CrossThreadPolicy cross_thread_policy)
DartFrameIterator(Thread *thread, StackFrameIterator::CrossThreadPolicy cross_thread_policy)
DartFrameIterator(uword last_fp, Thread *thread, StackFrameIterator::CrossThreadPolicy cross_thread_policy)
DartFrameIterator(const DartFrameIterator &orig)
virtual const char * GetName() const
virtual void VisitObjectPointers(ObjectPointerVisitor *visitor)
bool IsEntryFrame() const
bool IsDartFrame(bool validate=true) const
virtual void VisitObjectPointers(ObjectPointerVisitor *visitor)
bool IsDartFrame(bool validate=true) const
virtual const char * GetName() const
intptr_t GetDeoptFpOffset() const
InlinedFunctionsIterator(const Code &code, uword pc)
FunctionPtr function() const
uword FindPendingDeopt(uword fp)
bool HasNextFrame() const
StackFrameIterator(ValidationPolicy validation_policy, Thread *thread, CrossThreadPolicy cross_thread_policy)
@ kAllowCrossThreadIteration
@ kNoCrossThreadIteration
virtual bool IsEntryFrame() const
virtual void VisitObjectPointers(ObjectPointerVisitor *visitor)
Isolate * isolate() const
virtual bool IsExitFrame() const
const char * ToCString() const
CodePtr LookupDartCode() const
virtual bool IsStubFrame() const
bool IsBareInstructionsStubFrame() const
bool FindExceptionHandler(Thread *thread, uword *handler_pc, bool *needs_stacktrace, bool *is_catch_all, bool *is_optimized) const
static int SavedCallerPpSlotFromFp()
TokenPosition GetTokenPos() const
void UnmarkForLazyDeopt()
bool IsBareInstructionsDartFrame() const
virtual bool IsDartFrame(bool validate=true) const
FunctionPtr LookupDartFunction() const
bool IsMarkedForLazyDeopt() const
virtual const char * GetName() const
StackFrame(Thread *thread)
void set_pc_marker(CodePtr code)
uword GetCallerSp() const
static void DumpCurrentTrace()
IsolateGroup * isolate_group() const
friend class FrameSetIterator
virtual bool IsValid() const
static bool InInvocationStub(uword pc)
PendingDeopts & pending_deopts()
Isolate * isolate() const
IsolateGroup * isolate_group() const
static constexpr int kSavedCallerPcSlotFromFp
static DART_FORCE_INLINE intptr_t LocalVarIndex(intptr_t fp_offset, intptr_t var_index)
static constexpr int kSavedCallerFpSlotFromFp
static constexpr uword kInterruptStackLimit
static DART_FORCE_INLINE uword ParamAddress(uword fp, intptr_t reverse_index)
static constexpr int kParamEndSlotFromFp
static constexpr int kCallerSpSlotFromFp
static constexpr int kSavedPcSlotFromSp
FrameLayout runtime_frame_layout
static DART_FORCE_INLINE uword LocalVarAddress(uword fp, intptr_t index)
constexpr intptr_t kWordSize
static DART_FORCE_INLINE bool IsCalleeFrameOf(uword fp, uword other_fp)
intptr_t saved_caller_pp_from_fp