+ void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[RegisterFile::ArgumentCount].payload() = count; }
+ void setCallee(JSObject* callee) { static_cast<Register*>(this)[RegisterFile::Callee] = Register::withCallee(callee); }
+ void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[RegisterFile::CodeBlock] = codeBlock; }
+ void setReturnPC(void* value) { static_cast<Register*>(this)[RegisterFile::ReturnPC] = (Instruction*)value; }
+
+#if ENABLE(DFG_JIT)
+ bool isInlineCallFrame();
+
+ void setInlineCallFrame(InlineCallFrame* inlineCallFrame) { static_cast<Register*>(this)[RegisterFile::ReturnPC] = inlineCallFrame; }
+
+ // Call this to get the semantically correct JS CallFrame* for the
+ // currently executing function.
+ CallFrame* trueCallFrame(AbstractPC);
+
+ // Call this to get the semantically correct JS CallFrame* corresponding
+ // to the caller. This resolves issues surrounding inlining and the
+ // HostCallFrameFlag stuff.
+ CallFrame* trueCallerFrame();
+#else
+ bool isInlineCallFrame() { return false; }
+
+ CallFrame* trueCallFrame(AbstractPC) { return this; }
+ CallFrame* trueCallerFrame() { return callerFrame()->removeHostCallFrameFlag(); }
+#endif
+
+ // Call this to get the true call frame (accounted for inlining and any
+ // other optimizations), when you have entered into VM code through one
+ // of the "blessed" entrypoints (JITStubs or DFGOperations). This means
+ // that if you're pretty much anywhere in the VM you can safely call this;
+ // though if you were to magically get an ExecState* by, say, interrupting
+ // a thread that is running JS code and brutishly scraped the call frame
+ // register, calling this method would probably lead to horrible things
+ // happening.
+ CallFrame* trueCallFrameFromVMCode() { return trueCallFrame(AbstractPC()); }
+
+ private:
+ static const intptr_t HostCallFrameFlag = 1;
+ static const int s_thisArgumentOffset = -1 - RegisterFile::CallFrameHeaderSize;
+ static const int s_firstArgumentOffset = s_thisArgumentOffset - 1;
+
+#ifndef NDEBUG
+ RegisterFile* registerFile();
+#endif
+#if ENABLE(DFG_JIT)
+ bool isInlineCallFrameSlow();
+#endif