MethodCallLinkStatus.h [plain text]
#ifndef MethodCallLinkStatus_h
#define MethodCallLinkStatus_h
namespace JSC {
class CodeBlock;
class JSObject;
class Structure;
class MethodCallLinkStatus {
public:
MethodCallLinkStatus()
: m_structure(0)
, m_prototypeStructure(0)
, m_function(0)
, m_prototype(0)
{
}
MethodCallLinkStatus(
Structure* structure,
Structure* prototypeStructure,
JSObject* function,
JSObject* prototype)
: m_structure(structure)
, m_prototypeStructure(prototypeStructure)
, m_function(function)
, m_prototype(prototype)
{
if (!m_function) {
ASSERT(!m_structure);
ASSERT(!m_prototypeStructure);
ASSERT(!m_prototype);
} else
ASSERT(m_structure);
ASSERT(!m_prototype == !m_prototypeStructure);
}
static MethodCallLinkStatus computeFor(CodeBlock*, unsigned bytecodeIndex);
bool isSet() const { return !!m_function; }
bool operator!() const { return !m_function; }
bool needsPrototypeCheck() const { return !!m_prototype; }
Structure* structure() { return m_structure; }
Structure* prototypeStructure() { return m_prototypeStructure; }
JSObject* function() const { return m_function; }
JSObject* prototype() const { return m_prototype; }
private:
Structure* m_structure;
Structure* m_prototypeStructure;
JSObject* m_function;
JSObject* m_prototype;
};
}
#endif // MethodCallLinkStatus_h