Lines Matching +full:block +full:- +full:offset
1 //===--- InterpFrame.h - Call Frame implementation for the VM ---*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
66 /// Returns the offset on the stack at which the frame starts.
70 template <typename T> const T &getLocal(unsigned Offset) const {
71 return localRef<T>(Offset);
75 template <typename T> void setLocal(unsigned Offset, const T &Value) {
76 localRef<T>(Offset) = Value;
77 localInlineDesc(Offset)->IsInitialized = true;
81 Pointer getLocalPointer(unsigned Offset) const;
84 template <typename T> const T &getParam(unsigned Offset) const {
85 auto Pt = Params.find(Offset);
87 return stackRef<T>(Offset);
88 return Pointer(reinterpret_cast<Block *>(Pt->second.get())).deref<T>();
92 template <typename T> void setParam(unsigned Offset, const T &Value) {
93 getParamPointer(Offset).deref<T>() = Value;
96 /// Returns a pointer to an argument - lazily creates a block.
97 Pointer getParamPointer(unsigned Offset);
105 /// Checks if the frame is a root frame - return should quit the interpreter.
109 CodePtr getPC() const { return Func->getCodeBegin(); }
127 template <typename T> const T &stackRef(unsigned Offset) const {
129 return *reinterpret_cast<const T *>(Args - ArgSize + Offset);
132 /// Returns an offset to a local.
133 template <typename T> T &localRef(unsigned Offset) const {
134 return getLocalPointer(Offset).deref<T>();
137 /// Returns a pointer to a local's block.
138 Block *localBlock(unsigned Offset) const {
139 return reinterpret_cast<Block *>(Locals.get() + Offset - sizeof(Block));
143 InlineDescriptor *localInlineDesc(unsigned Offset) const {
144 return reinterpret_cast<InlineDescriptor *>(Locals.get() + Offset);
156 /// Pointer the non-primitive return value gets constructed in.
166 /// Offset on the stack at entry.