Java Code Examples for com.android.dx.rop.code.RegisterSpec#getLocalItem()

The following examples show how to use com.android.dx.rop.code.RegisterSpec#getLocalItem() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalList.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param address {@code >= 0;} address
 * @param disposition {@code non-null;} disposition of the local
 * @param spec {@code non-null;} register spec representing
 * the variable
 */
public Entry(int address, Disposition disposition, RegisterSpec spec) {
    if (address < 0) {
        throw new IllegalArgumentException("address < 0");
    }

    if (disposition == null) {
        throw new NullPointerException("disposition == null");
    }

    try {
        if (spec.getLocalItem() == null) {
            throw new NullPointerException(
                    "spec.getLocalItem() == null");
        }
    } catch (NullPointerException ex) {
        // Elucidate the exception.
        throw new NullPointerException("spec == null");
    }

    this.address = address;
    this.disposition = disposition;
    this.spec = spec;
    this.type = CstType.intern(spec.getType());
}
 
Example 2
Source File: NormalSsaInsn.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public RegisterSpec getLocalAssignment() {
    RegisterSpec assignment;

    if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
        assignment = insn.getSources().get(0);
    } else {
        assignment = getResult();
    }

    if (assignment == null) {
        return null;
    }

    LocalItem local = assignment.getLocalItem();

    if (local == null) {
        return null;
    }

    return assignment;
}
 
Example 3
Source File: LocalList.java    From buck with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param address {@code >= 0;} address
 * @param disposition {@code non-null;} disposition of the local
 * @param spec {@code non-null;} register spec representing
 * the variable
 */
public Entry(int address, Disposition disposition, RegisterSpec spec) {
    if (address < 0) {
        throw new IllegalArgumentException("address < 0");
    }

    if (disposition == null) {
        throw new NullPointerException("disposition == null");
    }

    try {
        if (spec.getLocalItem() == null) {
            throw new NullPointerException(
                    "spec.getLocalItem() == null");
        }
    } catch (NullPointerException ex) {
        // Elucidate the exception.
        throw new NullPointerException("spec == null");
    }

    this.address = address;
    this.disposition = disposition;
    this.spec = spec;
    this.type = CstType.intern(spec.getType());
}
 
Example 4
Source File: LocalList.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param address {@code >= 0;} address
 * @param disposition {@code non-null;} disposition of the local
 * @param spec {@code non-null;} register spec representing
 * the variable
 */
public Entry(int address, Disposition disposition, RegisterSpec spec) {
    if (address < 0) {
        throw new IllegalArgumentException("address < 0");
    }

    if (disposition == null) {
        throw new NullPointerException("disposition == null");
    }

    try {
        if (spec.getLocalItem() == null) {
            throw new NullPointerException(
                    "spec.getLocalItem() == null");
        }
    } catch (NullPointerException ex) {
        // Elucidate the exception.
        throw new NullPointerException("spec == null");
    }

    this.address = address;
    this.disposition = disposition;
    this.spec = spec;
    this.type = CstType.intern(spec.getType());
}
 
Example 5
Source File: NormalSsaInsn.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public RegisterSpec getLocalAssignment() {
    RegisterSpec assignment;

    if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
        assignment = insn.getSources().get(0);
    } else {
        assignment = getResult();
    }

    if (assignment == null) {
        return null;
    }

    LocalItem local = assignment.getLocalItem();

    if (local == null) {
        return null;
    }

    return assignment;
}
 
Example 6
Source File: NormalSsaInsn.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public RegisterSpec getLocalAssignment() {
    RegisterSpec assignment;

    if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
        assignment = insn.getSources().get(0);
    } else {
        assignment = getResult();
    }

    if (assignment == null) {
        return null;
    }

    LocalItem local = assignment.getLocalItem();

    if (local == null) {
        return null;
    }

    return assignment;
}
 
Example 7
Source File: LocalList.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param address {@code >= 0;} address
 * @param disposition {@code non-null;} disposition of the local
 * @param spec {@code non-null;} register spec representing
 * the variable
 */
public Entry(int address, Disposition disposition, RegisterSpec spec) {
    if (address < 0) {
        throw new IllegalArgumentException("address < 0");
    }

    if (disposition == null) {
        throw new NullPointerException("disposition == null");
    }

    try {
        if (spec.getLocalItem() == null) {
            throw new NullPointerException(
                    "spec.getLocalItem() == null");
        }
    } catch (NullPointerException ex) {
        // Elucidate the exception.
        throw new NullPointerException("spec == null");
    }

    this.address = address;
    this.disposition = disposition;
    this.spec = spec;
    this.type = CstType.intern(spec.getType());
}
 
Example 8
Source File: OutputFinisher.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Helper for {@link #getAllConstants} which adds all the info for
 * a single {@code RegisterSpec}.
 *
 * @param result {@code non-null;} result set to add to
 * @param spec {@code null-ok;} register spec to add
 */
private static void addConstants(HashSet<Constant> result,
        RegisterSpec spec) {
    if (spec == null) {
        return;
    }

    LocalItem local = spec.getLocalItem();
    CstString name = local.getName();
    CstString signature = local.getSignature();
    Type type = spec.getType();

    if (type != Type.KNOWN_NULL) {
        result.add(CstType.intern(type));
    } else {
        /* If this a "known null", let's use "Object" because that's going to be the
         * resulting type in {@link LocalList.MakeState#filterSpec} */
        result.add(CstType.intern(Type.OBJECT));
    }

    if (name != null) {
        result.add(name);
    }

    if (signature != null) {
        result.add(signature);
    }
}
 
Example 9
Source File: ConstCollector.java    From buck with Apache License 2.0 5 votes vote down vote up
/**
 * Inserts mark-locals if necessary when changing a register. If
 * the definition of {@code origReg} is associated with a local
 * variable, then insert a mark-local for {@code newReg} just below
 * it. We expect the definition of  {@code origReg} to ultimately
 * be removed by the dead code eliminator
 *
 * @param origReg {@code non-null;} original register
 * @param newReg {@code non-null;} new register that will replace
 * {@code origReg}
 */
private void fixLocalAssignment(RegisterSpec origReg,
        RegisterSpec newReg) {
    for (SsaInsn use : ssaMeth.getUseListForRegister(origReg.getReg())) {
        RegisterSpec localAssignment = use.getLocalAssignment();
        if (localAssignment == null) {
            continue;
        }

        if (use.getResult() == null) {
            /*
             * This is a mark-local. it will be updated when all uses
             * are updated.
             */
            continue;
        }

        LocalItem local = localAssignment.getLocalItem();

        // Un-associate original use.
        use.setResultLocal(null);

        // Now add a mark-local to the new reg immediately after.
        newReg = newReg.withLocalItem(local);

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(newReg),
                    SourcePosition.NO_INFO, null,
                            RegisterSpecList.make(newReg)),
                use.getBlock());

        ArrayList<SsaInsn> insns = use.getBlock().getInsns();

        insns.add(insns.indexOf(use) + 1, newInsn);
    }
}
 
Example 10
Source File: SsaRenamer.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/**
 * Records a debug (local variable) name for a specified register.
 *
 * @param ssaReg non-null named register spec in SSA name space
 */
private void setNameForSsaReg(RegisterSpec ssaReg) {
    int reg = ssaReg.getReg();
    LocalItem local = ssaReg.getLocalItem();

    ssaRegToLocalItems.ensureCapacity(reg + 1);
    while (ssaRegToLocalItems.size() <= reg) {
        ssaRegToLocalItems.add(null);
    }

    ssaRegToLocalItems.set(reg, local);
}
 
Example 11
Source File: ConstCollector.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/**
 * Inserts mark-locals if necessary when changing a register. If
 * the definition of {@code origReg} is associated with a local
 * variable, then insert a mark-local for {@code newReg} just below
 * it. We expect the definition of  {@code origReg} to ultimately
 * be removed by the dead code eliminator
 *
 * @param origReg {@code non-null;} original register
 * @param newReg {@code non-null;} new register that will replace
 * {@code origReg}
 */
private void fixLocalAssignment(RegisterSpec origReg,
        RegisterSpec newReg) {
    for (SsaInsn use : ssaMeth.getUseListForRegister(origReg.getReg())) {
        RegisterSpec localAssignment = use.getLocalAssignment();
        if (localAssignment == null) {
            continue;
        }

        if (use.getResult() == null) {
            /*
             * This is a mark-local. it will be updated when all uses
             * are updated.
             */
            continue;
        }

        LocalItem local = localAssignment.getLocalItem();

        // Un-associate original use.
        use.setResultLocal(null);

        // Now add a mark-local to the new reg immediately after.
        newReg = newReg.withLocalItem(local);

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(newReg),
                    SourcePosition.NO_INFO, null,
                            RegisterSpecList.make(newReg)),
                use.getBlock());

        ArrayList<SsaInsn> insns = use.getBlock().getInsns();

        insns.add(insns.indexOf(use) + 1, newInsn);
    }
}
 
Example 12
Source File: OutputFinisher.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/**
 * Helper for {@link #getAllConstants} which adds all the info for
 * a single {@code RegisterSpec}.
 *
 * @param result {@code non-null;} result set to add to
 * @param spec {@code null-ok;} register spec to add
 */
private static void addConstants(HashSet<Constant> result,
        RegisterSpec spec) {
    if (spec == null) {
        return;
    }

    LocalItem local = spec.getLocalItem();
    CstString name = local.getName();
    CstString signature = local.getSignature();
    Type type = spec.getType();

    if (type != Type.KNOWN_NULL) {
        result.add(CstType.intern(type));
    } else {
        /* If this a "known null", let's use "Object" because that's going to be the
         * resulting type in {@link LocalList.MakeState#filterSpec} */
        result.add(CstType.intern(Type.OBJECT));
    }

    if (name != null) {
        result.add(name);
    }

    if (signature != null) {
        result.add(signature);
    }
}
 
Example 13
Source File: SsaRenamer.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Records a debug (local variable) name for a specified register.
 *
 * @param ssaReg non-null named register spec in SSA name space
 */
private void setNameForSsaReg(RegisterSpec ssaReg) {
    int reg = ssaReg.getReg();
    LocalItem local = ssaReg.getLocalItem();

    ssaRegToLocalItems.ensureCapacity(reg + 1);
    while (ssaRegToLocalItems.size() <= reg) {
        ssaRegToLocalItems.add(null);
    }

    ssaRegToLocalItems.set(reg, local);
}
 
Example 14
Source File: SsaRenamer.java    From buck with Apache License 2.0 5 votes vote down vote up
/**
 * Records a debug (local variable) name for a specified register.
 *
 * @param ssaReg non-null named register spec in SSA name space
 */
private void setNameForSsaReg(RegisterSpec ssaReg) {
    int reg = ssaReg.getReg();
    LocalItem local = ssaReg.getLocalItem();

    ssaRegToLocalItems.ensureCapacity(reg + 1);
    while (ssaRegToLocalItems.size() <= reg) {
        ssaRegToLocalItems.add(null);
    }

    ssaRegToLocalItems.set(reg, local);
}
 
Example 15
Source File: OutputFinisher.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Helper for {@link #getAllConstants} which adds all the info for
 * a single {@code RegisterSpec}.
 *
 * @param result {@code non-null;} result set to add to
 * @param spec {@code null-ok;} register spec to add
 */
private static void addConstants(HashSet<Constant> result,
        RegisterSpec spec) {
    if (spec == null) {
        return;
    }

    LocalItem local = spec.getLocalItem();
    CstString name = local.getName();
    CstString signature = local.getSignature();
    Type type = spec.getType();

    if (type != Type.KNOWN_NULL) {
        result.add(CstType.intern(type));
    } else {
        /* If this a "known null", let's use "Object" because that's going to be the
         * resulting type in {@link LocalList.MakeState#filterSpec} */
        result.add(CstType.intern(Type.OBJECT));
    }

    if (name != null) {
        result.add(name);
    }

    if (signature != null) {
        result.add(signature);
    }
}
 
Example 16
Source File: SsaRenamer.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Records a debug (local variable) name for a specified register.
 *
 * @param ssaReg non-null named register spec in SSA name space
 */
private void setNameForSsaReg(RegisterSpec ssaReg) {
    int reg = ssaReg.getReg();
    LocalItem local = ssaReg.getLocalItem();

    ssaRegToLocalItems.ensureCapacity(reg + 1);
    while (ssaRegToLocalItems.size() <= reg) {
        ssaRegToLocalItems.add(null);
    }

    ssaRegToLocalItems.set(reg, local);
}
 
Example 17
Source File: ConstCollector.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Inserts mark-locals if necessary when changing a register. If
 * the definition of {@code origReg} is associated with a local
 * variable, then insert a mark-local for {@code newReg} just below
 * it. We expect the definition of  {@code origReg} to ultimately
 * be removed by the dead code eliminator
 *
 * @param origReg {@code non-null;} original register
 * @param newReg {@code non-null;} new register that will replace
 * {@code origReg}
 */
private void fixLocalAssignment(RegisterSpec origReg,
        RegisterSpec newReg) {
    for (SsaInsn use : ssaMeth.getUseListForRegister(origReg.getReg())) {
        RegisterSpec localAssignment = use.getLocalAssignment();
        if (localAssignment == null) {
            continue;
        }

        if (use.getResult() == null) {
            /*
             * This is a mark-local. it will be updated when all uses
             * are updated.
             */
            continue;
        }

        LocalItem local = localAssignment.getLocalItem();

        // Un-associate original use.
        use.setResultLocal(null);

        // Now add a mark-local to the new reg immediately after.
        newReg = newReg.withLocalItem(local);

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(newReg),
                    SourcePosition.NO_INFO, null,
                            RegisterSpecList.make(newReg)),
                use.getBlock());

        ArrayList<SsaInsn> insns = use.getBlock().getInsns();

        insns.add(insns.indexOf(use) + 1, newInsn);
    }
}
 
Example 18
Source File: SsaRenamer.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * Move insns are treated as a simple mapping operation, and
 * will later be removed unless they represent a local variable
 * assignment. If they represent a local variable assignement, they
 * are preserved.
 */
@Override
public void visitMoveInsn(NormalSsaInsn insn) {
    /*
     * For moves: copy propogate the move if we can, but don't
     * if we need to preserve local variable info and the
     * result has a different name than the source.
     */

    RegisterSpec ropResult = insn.getResult();
    int ropResultReg = ropResult.getReg();
    int ropSourceReg = insn.getSources().get(0).getReg();

    insn.mapSourceRegisters(mapper);
    int ssaSourceReg = insn.getSources().get(0).getReg();

    LocalItem sourceLocal
        = currentMapping[ropSourceReg].getLocalItem();
    LocalItem resultLocal = ropResult.getLocalItem();

    /*
     * A move from a register that's currently associated with a local
     * to one that will not be associated with a local does not need
     * to be preserved, but the local association should remain.
     * Hence, we inherit the sourceLocal where the resultLocal is null.
     */

    LocalItem newLocal
        = (resultLocal == null) ? sourceLocal : resultLocal;
    LocalItem associatedLocal = getLocalForNewReg(ssaSourceReg);

    /*
     * If we take the new local, will only one local have ever
     * been associated with this SSA reg?
     */
    boolean onlyOneAssociatedLocal
            = associatedLocal == null || newLocal == null
            || newLocal.equals(associatedLocal);

    /*
     * If we're going to copy-propogate, then the ssa register
     * spec that's going to go into the mapping is made up of
     * the source register number mapped from above, the type
     * of the result, and the name either from the result (if
     * specified) or inherited from the existing mapping.
     *
     * The move source has incomplete type information in null
     * object cases, so the result type is used.
     */
    RegisterSpec ssaReg
            = RegisterSpec.makeLocalOptional(
                ssaSourceReg, ropResult.getType(), newLocal);

    if (!Optimizer.getPreserveLocals() || (onlyOneAssociatedLocal
            && equalsHandlesNulls(newLocal, sourceLocal)) &&
            threshold == 0) {
        /*
         * We don't have to keep this move to preserve local
         * information. Either the name is the same, or the result
         * register spec is unnamed.
         */

        addMapping(ropResultReg, ssaReg);
    } else if (onlyOneAssociatedLocal && sourceLocal == null &&
            threshold == 0) {
        /*
         * The register was previously unnamed. This means that a
         * local starts after it's first assignment in SSA form
         */

        RegisterSpecList ssaSources = RegisterSpecList.make(
                RegisterSpec.make(ssaReg.getReg(),
                        ssaReg.getType(), newLocal));

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(ssaReg),
                    SourcePosition.NO_INFO, null, ssaSources),block);

        insnsToReplace.put(insn, newInsn);

        // Just map as above.
        addMapping(ropResultReg, ssaReg);
    } else {
        /*
         * Do not copy-propogate, since the two registers have
         * two different local-variable names.
         */
        processResultReg(insn);

        movesToKeep.add(insn);
    }
}
 
Example 19
Source File: SsaRenamer.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * Move insns are treated as a simple mapping operation, and
 * will later be removed unless they represent a local variable
 * assignment. If they represent a local variable assignement, they
 * are preserved.
 */
@Override
public void visitMoveInsn(NormalSsaInsn insn) {
    /*
     * For moves: copy propogate the move if we can, but don't
     * if we need to preserve local variable info and the
     * result has a different name than the source.
     */

    RegisterSpec ropResult = insn.getResult();
    int ropResultReg = ropResult.getReg();
    int ropSourceReg = insn.getSources().get(0).getReg();

    insn.mapSourceRegisters(mapper);
    int ssaSourceReg = insn.getSources().get(0).getReg();

    LocalItem sourceLocal
        = currentMapping[ropSourceReg].getLocalItem();
    LocalItem resultLocal = ropResult.getLocalItem();

    /*
     * A move from a register that's currently associated with a local
     * to one that will not be associated with a local does not need
     * to be preserved, but the local association should remain.
     * Hence, we inherit the sourceLocal where the resultLocal is null.
     */

    LocalItem newLocal
        = (resultLocal == null) ? sourceLocal : resultLocal;
    LocalItem associatedLocal = getLocalForNewReg(ssaSourceReg);

    /*
     * If we take the new local, will only one local have ever
     * been associated with this SSA reg?
     */
    boolean onlyOneAssociatedLocal
            = associatedLocal == null || newLocal == null
            || newLocal.equals(associatedLocal);

    /*
     * If we're going to copy-propogate, then the ssa register
     * spec that's going to go into the mapping is made up of
     * the source register number mapped from above, the type
     * of the result, and the name either from the result (if
     * specified) or inherited from the existing mapping.
     *
     * The move source has incomplete type information in null
     * object cases, so the result type is used.
     */
    RegisterSpec ssaReg
            = RegisterSpec.makeLocalOptional(
                ssaSourceReg, ropResult.getType(), newLocal);

    if (!Optimizer.getPreserveLocals() || (onlyOneAssociatedLocal
            && equalsHandlesNulls(newLocal, sourceLocal)) &&
            threshold == 0) {
        /*
         * We don't have to keep this move to preserve local
         * information. Either the name is the same, or the result
         * register spec is unnamed.
         */

        addMapping(ropResultReg, ssaReg);
    } else if (onlyOneAssociatedLocal && sourceLocal == null &&
            threshold == 0) {
        /*
         * The register was previously unnamed. This means that a
         * local starts after it's first assignment in SSA form
         */

        RegisterSpecList ssaSources = RegisterSpecList.make(
                RegisterSpec.make(ssaReg.getReg(),
                        ssaReg.getType(), newLocal));

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(ssaReg),
                    SourcePosition.NO_INFO, null, ssaSources),block);

        insnsToReplace.put(insn, newInsn);

        // Just map as above.
        addMapping(ropResultReg, ssaReg);
    } else {
        /*
         * Do not copy-propogate, since the two registers have
         * two different local-variable names.
         */
        processResultReg(insn);

        movesToKeep.add(insn);
    }
}
 
Example 20
Source File: SsaRenamer.java    From buck with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * Move insns are treated as a simple mapping operation, and
 * will later be removed unless they represent a local variable
 * assignment. If they represent a local variable assignement, they
 * are preserved.
 */
public void visitMoveInsn(NormalSsaInsn insn) {
    /*
     * For moves: copy propogate the move if we can, but don't
     * if we need to preserve local variable info and the
     * result has a different name than the source.
     */

    RegisterSpec ropResult = insn.getResult();
    int ropResultReg = ropResult.getReg();
    int ropSourceReg = insn.getSources().get(0).getReg();

    insn.mapSourceRegisters(mapper);
    int ssaSourceReg = insn.getSources().get(0).getReg();

    LocalItem sourceLocal
        = currentMapping[ropSourceReg].getLocalItem();
    LocalItem resultLocal = ropResult.getLocalItem();

    /*
     * A move from a register that's currently associated with a local
     * to one that will not be associated with a local does not need
     * to be preserved, but the local association should remain.
     * Hence, we inherit the sourceLocal where the resultLocal is null.
     */

    LocalItem newLocal
        = (resultLocal == null) ? sourceLocal : resultLocal;
    LocalItem associatedLocal = getLocalForNewReg(ssaSourceReg);

    /*
     * If we take the new local, will only one local have ever
     * been associated with this SSA reg?
     */
    boolean onlyOneAssociatedLocal
            = associatedLocal == null || newLocal == null
            || newLocal.equals(associatedLocal);

    /*
     * If we're going to copy-propogate, then the ssa register
     * spec that's going to go into the mapping is made up of
     * the source register number mapped from above, the type
     * of the result, and the name either from the result (if
     * specified) or inherited from the existing mapping.
     *
     * The move source has incomplete type information in null
     * object cases, so the result type is used.
     */
    RegisterSpec ssaReg
            = RegisterSpec.makeLocalOptional(
                ssaSourceReg, ropResult.getType(), newLocal);

    if (!Optimizer.getPreserveLocals() || (onlyOneAssociatedLocal
            && equalsHandlesNulls(newLocal, sourceLocal)) &&
            threshold == 0) {
        /*
         * We don't have to keep this move to preserve local
         * information. Either the name is the same, or the result
         * register spec is unnamed.
         */

        addMapping(ropResultReg, ssaReg);
    } else if (onlyOneAssociatedLocal && sourceLocal == null &&
            threshold == 0) {
        /*
         * The register was previously unnamed. This means that a
         * local starts after it's first assignment in SSA form
         */

        RegisterSpecList ssaSources = RegisterSpecList.make(
                RegisterSpec.make(ssaReg.getReg(),
                        ssaReg.getType(), newLocal));

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(ssaReg),
                    SourcePosition.NO_INFO, null, ssaSources),block);

        insnsToReplace.put(insn, newInsn);

        // Just map as above.
        addMapping(ropResultReg, ssaReg);
    } else {
        /*
         * Do not copy-propogate, since the two registers have
         * two different local-variable names.
         */
        processResultReg(insn);

        movesToKeep.add(insn);
    }
}