FileDocCategorySizeDatePackage
RegisterMapper.javaAPI DocAndroid 1.5 API2062Wed May 06 22:41:02 BST 2009com.android.dx.ssa

RegisterMapper

public abstract class RegisterMapper extends Object
Represents a mapping between two register numbering schemes. Subclasses of this may be mutable, and as such the mapping provided is only valid for the lifetime of the method call in which instances of this class are passed.

Fields Summary
Constructors Summary
Methods Summary
public abstract intgetNewRegisterCount()
Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.

return
>= 0 width of new namespace.

public abstract com.android.dx.rop.code.RegisterSpecmap(com.android.dx.rop.code.RegisterSpec registerSpec)

param
registerSpec old register
return
register in new space

public final com.android.dx.rop.code.RegisterSpecListmap(com.android.dx.rop.code.RegisterSpecList sources)

param
sources old register list
return
new mapped register list, or old if nothing has changed.

        RegisterSpecList newSources;

        newSources = new RegisterSpecList(sources.size());

        int sz = sources.size();
        for (int i = 0; i < sz; i++) {
            newSources.set(i, map(sources.get(i)));
        }

        newSources.setImmutable();
        // Return the old sources if nothing has changed
        return newSources.equals(sources)? sources: newSources;