X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..refs/heads/master:/assembler/MacroAssemblerCodeRef.h diff --git a/assembler/MacroAssemblerCodeRef.h b/assembler/MacroAssemblerCodeRef.h index 5795126..b4d6c0b 100644 --- a/assembler/MacroAssemblerCodeRef.h +++ b/assembler/MacroAssemblerCodeRef.h @@ -132,6 +132,12 @@ public: ASSERT_VALID_CODE_POINTER(m_value); } + template + 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) @@ -312,11 +318,7 @@ public: 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(1) : 0; - } + explicit operator bool() const { return m_value; } bool operator==(const MacroAssemblerCodePtr& other) const { @@ -436,11 +438,7 @@ public: return JSC::tryToDisassemble(m_codePtr, size(), prefix, WTF::dataFile()); } - typedef void* (MacroAssemblerCodeRef::*UnspecifiedBoolType); - operator UnspecifiedBoolType*() const - { - return !!m_codePtr ? reinterpret_cast(1) : 0; - } + explicit operator bool() const { return !!m_codePtr; } void dump(PrintStream& out) const {