org.jikesrvm.compilers.opt
Class Simplifier

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.IRTools
      extended by org.jikesrvm.compilers.opt.Simplifier

public abstract class Simplifier
extends IRTools

A constant folder, strength reducer and axiomatic simplifier.

This module performs no analysis, it simply attempts to simplify the instruction as is. The intent is that analysis modules can call this transformation engine, allowing us to share the tedious simplification code among multiple analysis modules.

NOTE: For maintainability purposes, I've intentionally avoided being clever about combining 'similar' operators together into a combined case of the main switch switch statement. Also, operators are in sorted ordered within each major grouping. Please maintain this coding style. I'd rather have this module be 2000 lines of obviously correct code than 500 lines of clever code.


Nested Class Summary
static class Simplifier.DefUseEffect
          Effect of the simplification on Def-Use chains
 
Constructor Summary
Simplifier()
           
 
Method Summary
private static Simplifier.DefUseEffect addr2Int(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect addr2Long(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect arrayLength(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect booleanCmpAddr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect booleanCmpInt(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect booleanNot(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect boundsCheck(Instruction s, OptOptions opts)
           
private static ConstantOperand boxConstantObjectAsOperand(Object x, TypeReference t)
          Package up an object as a constant operand
private static Object boxConstantOperand(ConstantOperand op, TypeReference t)
          Package up a constant operand as an object
private static Simplifier.DefUseEffect call(boolean HIR, AbstractRegisterPool regpool, Instruction s, OptOptions opts)
           
private static void canonicalizeCommutativeOperator(Instruction instr)
          To reduce the number of conditions to consider, we transform all commutative operators to a canoncial form.
private static Simplifier.DefUseEffect checkcast(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect checkcastNotNull(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect double2Float(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect double2Int(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect double2Long(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleAdd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleAsLongBits(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleCmpg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleCmpl(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleDiv(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleMul(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleNeg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleRem(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleSqrt(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect doubleSub(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect float2Double(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect float2Int(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect float2Long(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatAdd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatAsIntBits(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatCmpg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatCmpl(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatDiv(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatMul(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatNeg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatRem(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatSqrt(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect floatSub(Instruction s, OptOptions opts)
           
private static Address getAddressValue(Operand op)
          Turn the given operand encoding an address constant into an Address
private static Simplifier.DefUseEffect getArrayElementTibFromTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getClassTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getDoesImplementFromTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getField(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getObjTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getSuperclassIdsFromTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect getTypeFromTib(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect guardCombine(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect guardCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect instanceOf(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect instanceOfNotNull(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2AddrSigExt(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2AddrZerExt(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2Byte(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2Double(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2Float(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2Long(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2Short(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect int2UShort(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intAdd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intAnd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intBitsAsFloat(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intDiv(AbstractRegisterPool regpool, Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intMul(AbstractRegisterPool regpool, Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intNeg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intNot(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intOr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intRem(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intShl(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intShr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intSub(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intUshr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intXor(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect intZeroCheck(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect long2Addr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect long2Double(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect long2Float(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect long2Int(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longAdd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longAnd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longBitsAsDouble(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longCmp(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longDiv(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longMul(AbstractRegisterPool regpool, Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longNeg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longNot(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longOr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longRem(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longShl(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longShr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longSub(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longUshr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longXor(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect longZeroCheck(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect multiplyByConstant(AbstractRegisterPool regpool, Instruction s, Operand op1, Operand op2, OptOptions opts)
           
private static Simplifier.DefUseEffect mustImplementInterface(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect nullCheck(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect objarrayStoreCheck(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect objarrayStoreCheckNotNull(Instruction s, OptOptions opts)
           
private static int PowerOf2(int v)
          Compute 2 raised to the power v, 0 <= v <= 31
private static Simplifier.DefUseEffect refAdd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refAnd(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refCondMove(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refLoad(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refNeg(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refNot(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refOr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refShl(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refShr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refSub(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refUshr(Instruction s, OptOptions opts)
           
private static Simplifier.DefUseEffect refXor(Instruction s, OptOptions opts)
           
static Simplifier.DefUseEffect simplify(boolean hir, AbstractRegisterPool regpool, OptOptions opts, Instruction s)
          Given an instruction, attempt to simplify it.
private static Simplifier.DefUseEffect trapIf(Instruction s, OptOptions opts)
           
 
Methods inherited from class org.jikesrvm.compilers.opt.ir.IRTools
A, AC, AC, CPOS, CR, D, DC, defDoublesAsUse, definedIn, F, FC, getCondMoveOp, getDefaultOperand, getLoadOp, getLoadOp, getMoveOp, getStoreOp, getStoreOp, I, IC, insertInstructionsAfter, L, LC, makeBlockOnEdge, mayBeVolatileFieldLoad, moveInstruction, moveIntoRegister, moveIntoRegister, nonPEIGC, TG, usedIn, useDoublesAsDef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simplifier

public Simplifier()
Method Detail

simplify

public static Simplifier.DefUseEffect simplify(boolean hir,
                                               AbstractRegisterPool regpool,
                                               OptOptions opts,
                                               Instruction s)
Given an instruction, attempt to simplify it. The instruction will be mutated in place.

We don't deal with branching operations here -- doing peephole optimizations of branches is the job of a separate module.

Parameters:
hir - is this the HIR phase?
regpool - register pool in case simplification requires a temporary register
opts - options for this compilation
s - the instruction to simplify
Returns:
one of UNCHANGED, MOVE_FOLDED, MOVE_REDUCED, TRAP_REDUCED, REDUCED

guardCombine

private static Simplifier.DefUseEffect guardCombine(Instruction s,
                                                    OptOptions opts)

trapIf

private static Simplifier.DefUseEffect trapIf(Instruction s,
                                              OptOptions opts)

nullCheck

private static Simplifier.DefUseEffect nullCheck(Instruction s,
                                                 OptOptions opts)

intZeroCheck

private static Simplifier.DefUseEffect intZeroCheck(Instruction s,
                                                    OptOptions opts)

longZeroCheck

private static Simplifier.DefUseEffect longZeroCheck(Instruction s,
                                                     OptOptions opts)

checkcast

private static Simplifier.DefUseEffect checkcast(Instruction s,
                                                 OptOptions opts)

checkcastNotNull

private static Simplifier.DefUseEffect checkcastNotNull(Instruction s,
                                                        OptOptions opts)

instanceOf

private static Simplifier.DefUseEffect instanceOf(Instruction s,
                                                  OptOptions opts)

instanceOfNotNull

private static Simplifier.DefUseEffect instanceOfNotNull(Instruction s,
                                                         OptOptions opts)

objarrayStoreCheck

private static Simplifier.DefUseEffect objarrayStoreCheck(Instruction s,
                                                          OptOptions opts)

objarrayStoreCheckNotNull

private static Simplifier.DefUseEffect objarrayStoreCheckNotNull(Instruction s,
                                                                 OptOptions opts)

mustImplementInterface

private static Simplifier.DefUseEffect mustImplementInterface(Instruction s,
                                                              OptOptions opts)

intCondMove

private static Simplifier.DefUseEffect intCondMove(Instruction s,
                                                   OptOptions opts)

longCondMove

private static Simplifier.DefUseEffect longCondMove(Instruction s,
                                                    OptOptions opts)

floatCondMove

private static Simplifier.DefUseEffect floatCondMove(Instruction s,
                                                     OptOptions opts)

doubleCondMove

private static Simplifier.DefUseEffect doubleCondMove(Instruction s,
                                                      OptOptions opts)

refCondMove

private static Simplifier.DefUseEffect refCondMove(Instruction s,
                                                   OptOptions opts)

guardCondMove

private static Simplifier.DefUseEffect guardCondMove(Instruction s,
                                                     OptOptions opts)

booleanNot

private static Simplifier.DefUseEffect booleanNot(Instruction s,
                                                  OptOptions opts)

booleanCmpInt

private static Simplifier.DefUseEffect booleanCmpInt(Instruction s,
                                                     OptOptions opts)

booleanCmpAddr

private static Simplifier.DefUseEffect booleanCmpAddr(Instruction s,
                                                      OptOptions opts)

intAdd

private static Simplifier.DefUseEffect intAdd(Instruction s,
                                              OptOptions opts)

intAnd

private static Simplifier.DefUseEffect intAnd(Instruction s,
                                              OptOptions opts)

intDiv

private static Simplifier.DefUseEffect intDiv(AbstractRegisterPool regpool,
                                              Instruction s,
                                              OptOptions opts)

intMul

private static Simplifier.DefUseEffect intMul(AbstractRegisterPool regpool,
                                              Instruction s,
                                              OptOptions opts)

multiplyByConstant

private static Simplifier.DefUseEffect multiplyByConstant(AbstractRegisterPool regpool,
                                                          Instruction s,
                                                          Operand op1,
                                                          Operand op2,
                                                          OptOptions opts)

intNeg

private static Simplifier.DefUseEffect intNeg(Instruction s,
                                              OptOptions opts)

intNot

private static Simplifier.DefUseEffect intNot(Instruction s,
                                              OptOptions opts)

intOr

private static Simplifier.DefUseEffect intOr(Instruction s,
                                             OptOptions opts)

intRem

private static Simplifier.DefUseEffect intRem(Instruction s,
                                              OptOptions opts)

intShl

private static Simplifier.DefUseEffect intShl(Instruction s,
                                              OptOptions opts)

intShr

private static Simplifier.DefUseEffect intShr(Instruction s,
                                              OptOptions opts)

intSub

private static Simplifier.DefUseEffect intSub(Instruction s,
                                              OptOptions opts)

intUshr

private static Simplifier.DefUseEffect intUshr(Instruction s,
                                               OptOptions opts)

intXor

private static Simplifier.DefUseEffect intXor(Instruction s,
                                              OptOptions opts)

refAdd

private static Simplifier.DefUseEffect refAdd(Instruction s,
                                              OptOptions opts)

refAnd

private static Simplifier.DefUseEffect refAnd(Instruction s,
                                              OptOptions opts)

refShl

private static Simplifier.DefUseEffect refShl(Instruction s,
                                              OptOptions opts)

refShr

private static Simplifier.DefUseEffect refShr(Instruction s,
                                              OptOptions opts)

refNeg

private static Simplifier.DefUseEffect refNeg(Instruction s,
                                              OptOptions opts)

refNot

private static Simplifier.DefUseEffect refNot(Instruction s,
                                              OptOptions opts)

refOr

private static Simplifier.DefUseEffect refOr(Instruction s,
                                             OptOptions opts)

refSub

private static Simplifier.DefUseEffect refSub(Instruction s,
                                              OptOptions opts)

refUshr

private static Simplifier.DefUseEffect refUshr(Instruction s,
                                               OptOptions opts)

refXor

private static Simplifier.DefUseEffect refXor(Instruction s,
                                              OptOptions opts)

longAdd

private static Simplifier.DefUseEffect longAdd(Instruction s,
                                               OptOptions opts)

longAnd

private static Simplifier.DefUseEffect longAnd(Instruction s,
                                               OptOptions opts)

longCmp

private static Simplifier.DefUseEffect longCmp(Instruction s,
                                               OptOptions opts)

longDiv

private static Simplifier.DefUseEffect longDiv(Instruction s,
                                               OptOptions opts)

longMul

private static Simplifier.DefUseEffect longMul(AbstractRegisterPool regpool,
                                               Instruction s,
                                               OptOptions opts)

longNeg

private static Simplifier.DefUseEffect longNeg(Instruction s,
                                               OptOptions opts)

longNot

private static Simplifier.DefUseEffect longNot(Instruction s,
                                               OptOptions opts)

longOr

private static Simplifier.DefUseEffect longOr(Instruction s,
                                              OptOptions opts)

longRem

private static Simplifier.DefUseEffect longRem(Instruction s,
                                               OptOptions opts)

longShl

private static Simplifier.DefUseEffect longShl(Instruction s,
                                               OptOptions opts)

longShr

private static Simplifier.DefUseEffect longShr(Instruction s,
                                               OptOptions opts)

longSub

private static Simplifier.DefUseEffect longSub(Instruction s,
                                               OptOptions opts)

longUshr

private static Simplifier.DefUseEffect longUshr(Instruction s,
                                                OptOptions opts)

longXor

private static Simplifier.DefUseEffect longXor(Instruction s,
                                               OptOptions opts)

floatAdd

private static Simplifier.DefUseEffect floatAdd(Instruction s,
                                                OptOptions opts)

floatCmpg

private static Simplifier.DefUseEffect floatCmpg(Instruction s,
                                                 OptOptions opts)

floatCmpl

private static Simplifier.DefUseEffect floatCmpl(Instruction s,
                                                 OptOptions opts)

floatDiv

private static Simplifier.DefUseEffect floatDiv(Instruction s,
                                                OptOptions opts)

floatMul

private static Simplifier.DefUseEffect floatMul(Instruction s,
                                                OptOptions opts)

floatNeg

private static Simplifier.DefUseEffect floatNeg(Instruction s,
                                                OptOptions opts)

floatRem

private static Simplifier.DefUseEffect floatRem(Instruction s,
                                                OptOptions opts)

floatSub

private static Simplifier.DefUseEffect floatSub(Instruction s,
                                                OptOptions opts)

floatSqrt

private static Simplifier.DefUseEffect floatSqrt(Instruction s,
                                                 OptOptions opts)

doubleAdd

private static Simplifier.DefUseEffect doubleAdd(Instruction s,
                                                 OptOptions opts)

doubleCmpg

private static Simplifier.DefUseEffect doubleCmpg(Instruction s,
                                                  OptOptions opts)

doubleCmpl

private static Simplifier.DefUseEffect doubleCmpl(Instruction s,
                                                  OptOptions opts)

doubleDiv

private static Simplifier.DefUseEffect doubleDiv(Instruction s,
                                                 OptOptions opts)

doubleMul

private static Simplifier.DefUseEffect doubleMul(Instruction s,
                                                 OptOptions opts)

doubleNeg

private static Simplifier.DefUseEffect doubleNeg(Instruction s,
                                                 OptOptions opts)

doubleRem

private static Simplifier.DefUseEffect doubleRem(Instruction s,
                                                 OptOptions opts)

doubleSub

private static Simplifier.DefUseEffect doubleSub(Instruction s,
                                                 OptOptions opts)

doubleSqrt

private static Simplifier.DefUseEffect doubleSqrt(Instruction s,
                                                  OptOptions opts)

double2Float

private static Simplifier.DefUseEffect double2Float(Instruction s,
                                                    OptOptions opts)

double2Int

private static Simplifier.DefUseEffect double2Int(Instruction s,
                                                  OptOptions opts)

double2Long

private static Simplifier.DefUseEffect double2Long(Instruction s,
                                                   OptOptions opts)

doubleAsLongBits

private static Simplifier.DefUseEffect doubleAsLongBits(Instruction s,
                                                        OptOptions opts)

int2Double

private static Simplifier.DefUseEffect int2Double(Instruction s,
                                                  OptOptions opts)

int2Byte

private static Simplifier.DefUseEffect int2Byte(Instruction s,
                                                OptOptions opts)

int2UShort

private static Simplifier.DefUseEffect int2UShort(Instruction s,
                                                  OptOptions opts)

int2Float

private static Simplifier.DefUseEffect int2Float(Instruction s,
                                                 OptOptions opts)

int2Long

private static Simplifier.DefUseEffect int2Long(Instruction s,
                                                OptOptions opts)

int2AddrSigExt

private static Simplifier.DefUseEffect int2AddrSigExt(Instruction s,
                                                      OptOptions opts)

int2AddrZerExt

private static Simplifier.DefUseEffect int2AddrZerExt(Instruction s,
                                                      OptOptions opts)

long2Addr

private static Simplifier.DefUseEffect long2Addr(Instruction s,
                                                 OptOptions opts)

int2Short

private static Simplifier.DefUseEffect int2Short(Instruction s,
                                                 OptOptions opts)

intBitsAsFloat

private static Simplifier.DefUseEffect intBitsAsFloat(Instruction s,
                                                      OptOptions opts)

addr2Int

private static Simplifier.DefUseEffect addr2Int(Instruction s,
                                                OptOptions opts)

addr2Long

private static Simplifier.DefUseEffect addr2Long(Instruction s,
                                                 OptOptions opts)

float2Double

private static Simplifier.DefUseEffect float2Double(Instruction s,
                                                    OptOptions opts)

float2Int

private static Simplifier.DefUseEffect float2Int(Instruction s,
                                                 OptOptions opts)

float2Long

private static Simplifier.DefUseEffect float2Long(Instruction s,
                                                  OptOptions opts)

floatAsIntBits

private static Simplifier.DefUseEffect floatAsIntBits(Instruction s,
                                                      OptOptions opts)

long2Float

private static Simplifier.DefUseEffect long2Float(Instruction s,
                                                  OptOptions opts)

long2Int

private static Simplifier.DefUseEffect long2Int(Instruction s,
                                                OptOptions opts)

long2Double

private static Simplifier.DefUseEffect long2Double(Instruction s,
                                                   OptOptions opts)

longBitsAsDouble

private static Simplifier.DefUseEffect longBitsAsDouble(Instruction s,
                                                        OptOptions opts)

arrayLength

private static Simplifier.DefUseEffect arrayLength(Instruction s,
                                                   OptOptions opts)

boundsCheck

private static Simplifier.DefUseEffect boundsCheck(Instruction s,
                                                   OptOptions opts)

call

private static Simplifier.DefUseEffect call(boolean HIR,
                                            AbstractRegisterPool regpool,
                                            Instruction s,
                                            OptOptions opts)

boxConstantOperand

private static Object boxConstantOperand(ConstantOperand op,
                                         TypeReference t)
Package up a constant operand as an object

Parameters:
op - the constant operand to package
t - the type of the object (needed to differentiate primitive from numeric types..)
Returns:
the object

boxConstantObjectAsOperand

private static ConstantOperand boxConstantObjectAsOperand(Object x,
                                                          TypeReference t)
Package up an object as a constant operand

Parameters:
x - the object to package
t - the type of the object (needed to differentiate primitive from numeric types..)
Returns:
the constant operand

getField

private static Simplifier.DefUseEffect getField(Instruction s,
                                                OptOptions opts)

getObjTib

private static Simplifier.DefUseEffect getObjTib(Instruction s,
                                                 OptOptions opts)

getClassTib

private static Simplifier.DefUseEffect getClassTib(Instruction s,
                                                   OptOptions opts)

getTypeFromTib

private static Simplifier.DefUseEffect getTypeFromTib(Instruction s,
                                                      OptOptions opts)

getArrayElementTibFromTib

private static Simplifier.DefUseEffect getArrayElementTibFromTib(Instruction s,
                                                                 OptOptions opts)

getSuperclassIdsFromTib

private static Simplifier.DefUseEffect getSuperclassIdsFromTib(Instruction s,
                                                               OptOptions opts)

getDoesImplementFromTib

private static Simplifier.DefUseEffect getDoesImplementFromTib(Instruction s,
                                                               OptOptions opts)

refLoad

private static Simplifier.DefUseEffect refLoad(Instruction s,
                                               OptOptions opts)

canonicalizeCommutativeOperator

private static void canonicalizeCommutativeOperator(Instruction instr)
To reduce the number of conditions to consider, we transform all commutative operators to a canoncial form. The following forms are considered canonical:


PowerOf2

private static int PowerOf2(int v)
Compute 2 raised to the power v, 0 <= v <= 31


getAddressValue

private static Address getAddressValue(Operand op)
Turn the given operand encoding an address constant into an Address