ASSERT_VALID_CODE_POINTER(m_value);
}
+ template<typename returnType, typename argType1, typename argType2, typename argType3, typename argType4, typename argType5, typename argType6>
+ FunctionPtr(returnType(*value)(argType1, argType2, argType3, argType4, argType5, argType6))
+ : m_value((void*)value)
+ {
+ ASSERT_VALID_CODE_POINTER(m_value);
+ }
// MSVC doesn't seem to treat functions with different calling conventions as
// different types; these methods already defined for fastcall, below.
#if CALLING_CONVENTION_IS_STDCALL && !OS(WINDOWS)
void* dataLocation() const { ASSERT_VALID_CODE_POINTER(m_value); return m_value; }
#endif
- typedef void* (MacroAssemblerCodePtr::*UnspecifiedBoolType);
- operator UnspecifiedBoolType*() const
- {
- return !!m_value ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0;
- }
+ explicit operator bool() const { return m_value; }
bool operator==(const MacroAssemblerCodePtr& other) const
{
return JSC::tryToDisassemble(m_codePtr, size(), prefix, WTF::dataFile());
}
- typedef void* (MacroAssemblerCodeRef::*UnspecifiedBoolType);
- operator UnspecifiedBoolType*() const
- {
- return !!m_codePtr ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0;
- }
+ explicit operator bool() const { return !!m_codePtr; }
void dump(PrintStream& out) const
{