- ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain,
- CallFrame* callerFrame, int returnValueRegister, int argc, JSFunction* function)
+ static inline bool isCodeOriginIndex(uint32_t bits);
+ static inline uint32_t encodeAsCodeOriginIndex(uint32_t bits);
+
+ private:
+ enum TypeTag {
+ BytecodeLocationTag = 0,
+ CodeOriginIndexTag = 1,
+ };
+
+ static inline uint32_t encode(TypeTag, uint32_t bits);
+
+ static const uint32_t s_mask = 0x1;
+#if USE(JSVALUE64)
+ static const uint32_t s_shift = 31;
+ static const uint32_t s_shiftedMask = s_mask << s_shift;
+#else
+ static const uint32_t s_shift = 1;
+#endif
+ };
+
+ bool hasLocationAsBytecodeOffset() const;
+ bool hasLocationAsCodeOriginIndex() const;
+
+ unsigned locationAsRawBits() const;
+ unsigned locationAsBytecodeOffset() const;
+ unsigned locationAsCodeOriginIndex() const;
+
+ void setLocationAsRawBits(unsigned);
+ void setLocationAsBytecodeOffset(unsigned);
+
+#if ENABLE(DFG_JIT)
+ unsigned bytecodeOffsetFromCodeOriginIndex();
+#endif
+
+ // This will try to get you the bytecode offset, but you should be aware that
+ // this bytecode offset may be bogus in the presence of inlining. This will
+ // also return 0 if the call frame has no notion of bytecode offsets (for
+ // example if it's native code).
+ // https://bugs.webkit.org/show_bug.cgi?id=121754
+ unsigned bytecodeOffset();
+
+ // This will get you a CodeOrigin. It will always succeed. May return
+ // CodeOrigin(0) if we're in native code.
+ CodeOrigin codeOrigin();
+
+ Register* topOfFrame()
+ {
+ if (!codeBlock())
+ return registers();
+ return topOfFrameInternal();
+ }
+
+#if USE(JSVALUE32_64)
+ Instruction* currentVPC() const
+ {
+ return bitwise_cast<Instruction*>(this[JSStack::ArgumentCount].tag());
+ }
+ void setCurrentVPC(Instruction* vpc)