Search in sources :

Example 1 with RegisterMapper

use of com.taobao.android.dx.ssa.RegisterMapper in project atlas by alibaba.

the class SsaToRop method convert.

/**
     * Performs the conversion.
     *
     * @return {@code non-null;} rop-form output
     */
private RopMethod convert() {
    if (DEBUG) {
        interference.dumpToStdout();
    }
    // These are other allocators for debugging or historical comparison:
    // allocator = new NullRegisterAllocator(ssaMeth, interference);
    // allocator = new FirstFitAllocator(ssaMeth, interference);
    RegisterAllocator allocator = new FirstFitLocalCombiningAllocator(optimizer, ssaMeth, interference, minimizeRegisters);
    RegisterMapper mapper = allocator.allocateRegisters();
    if (DEBUG) {
        System.out.println("Printing reg map");
        System.out.println(((BasicRegisterMapper) mapper).toHuman());
    }
    ssaMeth.setBackMode();
    ssaMeth.mapRegisters(mapper);
    removePhiFunctions();
    if (allocator.wantsParamsMovedHigh()) {
        moveParametersToHighRegisters();
    }
    removeEmptyGotos();
    RopMethod ropMethod = new RopMethod(convertBasicBlocks(), ssaMeth.blockIndexToRopLabel(ssaMeth.getEntryBlockIndex()));
    ropMethod = new IdenticalBlockCombiner(ropMethod).process();
    return ropMethod;
}
Also used : BasicRegisterMapper(com.taobao.android.dx.ssa.BasicRegisterMapper) RegisterMapper(com.taobao.android.dx.ssa.RegisterMapper) RopMethod(com.taobao.android.dx.rop.code.RopMethod)

Aggregations

RopMethod (com.taobao.android.dx.rop.code.RopMethod)1 BasicRegisterMapper (com.taobao.android.dx.ssa.BasicRegisterMapper)1 RegisterMapper (com.taobao.android.dx.ssa.RegisterMapper)1