Search in sources :

Example 1 with RegisterMapper

use of com.android.dx.ssa.RegisterMapper in project buck by facebook.

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(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 : RegisterMapper(com.android.dx.ssa.RegisterMapper) BasicRegisterMapper(com.android.dx.ssa.BasicRegisterMapper) RopMethod(com.android.dx.rop.code.RopMethod)

Aggregations

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