Displaying 1 result from an estimated 1 matches for "methodentry".
2012 Jul 07
2
[LLVMdev] Crash using the JIT on x86 but work on x64
...nion Retyper
    {
        const T object;
        void* pointer;
        Retyper(T obj) : object(obj) { }
    };
    return Retyper(object).pointer;
}
template<typename T, typename M>
const static void* getMethodPointer(const T* object, M method) // will work for virtual methods
{
    union MethodEntry
    {
        intptr_t offset;
        void* function;
    };
    const MethodEntry* entry = static_cast<const MethodEntry*>(void_cast(&method));
    if (entry->offset % sizeof(intptr_t) == 0) // looks like that's how the runtime guesses virtual from static
        return getMeth...