Пример #1
0
bool CCodeBlock::Compile()
{
    CPU_Message("====== Code Block ======");
    CPU_Message("Native entry point: %X", CompiledLocation());
    CPU_Message("Start of Block: %X", VAddrEnter());
    CPU_Message("No of Sections: %d", NoOfSections());
    CPU_Message("====== recompiled code ======");

    m_RecompilerOps->EnterCodeBlock();
    if (g_System->bLinkBlocks())
    {
        while (m_EnterSection->GenerateNativeCode(NextTest()));
    }
    else
    {
        if (!m_EnterSection->GenerateNativeCode(NextTest()))
        {
            return false;
        }
    }
    m_RecompilerOps->CompileExitCode();

    uint32_t PAddr;
    g_TransVaddr->TranslateVaddr(VAddrFirst(), PAddr);
    MD5(g_MMU->Rdram() + PAddr, (VAddrLast() - VAddrFirst()) + 4).get_digest(m_Hash);

#if defined(ANDROID) && (defined(__arm__) || defined(_M_ARM))
    __clear_cache_android((uint8_t *)((uint32_t)m_CompiledLocation & ~1), (uint8_t *)(*g_RecompPos));
#endif
    return true;
}
Пример #2
0
bool CCodeBlock::Compile()
{
    CPU_Message("====== Code Block ======");
    CPU_Message("x86 code at: %X",CompiledLocation());
    CPU_Message("Start of Block: %X",VAddrEnter() );
    CPU_Message("No of Sections: %d",NoOfSections() );
    CPU_Message("====== recompiled code ======");

    EnterCodeBlock();

    if (g_SyncSystem)
    {
        //if ((uint32_t)BlockInfo.CompiledLocation == 0x60A7B73B)
        //{
        //	X86BreakPoint(__FILEW__,__LINE__);
        //}
        //MoveConstToVariable((uint32_t)BlockInfo.CompiledLocation,&CurrentBlock,"CurrentBlock");
    }

    if (g_System->bLinkBlocks())
    {
        while (m_EnterSection->GenerateX86Code(NextTest()));
    }
    else
    {
        if (!m_EnterSection->GenerateX86Code(NextTest()))
        {
            return false;
        }
    }
    CompileExitCode();

    uint32_t PAddr;
    g_TransVaddr->TranslateVaddr(VAddrFirst(),PAddr);
    MD5(g_MMU->Rdram() + PAddr,(VAddrLast() - VAddrFirst()) + 4).get_digest(m_Hash);

    return true;
}