@Override public int allocateTempValue() { return getUnderlyingSymtab().newSymbol(); }
@Override public int allocateTempValue() { return getUnderlyingSymtab().newSymbol(); }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
private void doIndirectWrites(int[] locals, int rval) { for (int local : locals) { ShrikeLocalName name = new ShrikeLocalName(local); int idx = getCurrentInstructionIndex(); if (ssaIndirections.getDef(idx, name) == -1) { ssaIndirections.setDef(idx, name, rval==-1? symbolTable.newSymbol(): rval); } workingState.setLocal(local, ssaIndirections.getDef(idx, name)); } }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
private void doIndirectWrites(int[] locals, int rval) { for (int local : locals) { ShrikeLocalName name = new ShrikeLocalName(local); int idx = getCurrentInstructionIndex(); if (ssaIndirections.getDef(idx, name) == -1) { ssaIndirections.setDef(idx, name, rval==-1? symbolTable.newSymbol(): rval); } workingState.setLocal(local, ssaIndirections.getDef(idx, name)); } }
/** * If we've already created the current instruction, return the value number representing the exception the instruction may * throw. Else, create a new symbol */ private int reuseOrCreateException() { if (getCurrentInstruction() != null) { assert getCurrentInstruction() instanceof SSAInvokeInstruction; } if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { SSAInvokeInstruction s = (SSAInvokeInstruction) getCurrentInstruction(); return s.getException(); } }
/** * If we've already created the current instruction, return the value number representing the exception the instruction may * throw. Else, create a new symbol */ private int reuseOrCreateException() { if (getCurrentInstruction() != null) { assert getCurrentInstruction() instanceof SSAInvokeInstruction; } if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { SSAInvokeInstruction s = (SSAInvokeInstruction) getCurrentInstruction(); return s.getException(); } }
/** * If we've already created the current instruction, return the value number representing the exception the instruction may * throw. Else, create a new symbol */ private int reuseOrCreateException() { if (getCurrentInstruction() != null) { assert getCurrentInstruction() instanceof SSAInvokeInstruction; } if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { SSAInvokeInstruction s = (SSAInvokeInstruction) getCurrentInstruction(); return s.getException(); } }
/** * If we've already created the current instruction, return the value number representing the exception the instruction may * throw. Else, create a new symbol */ private int reuseOrCreateException() { if (getCurrentInstruction() != null) { assert getCurrentInstruction() instanceof SSAInvokeInstruction; } if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { SSAInvokeInstruction s = (SSAInvokeInstruction) getCurrentInstruction(); return s.getException(); } }
@Override public int meetStackAtCatchBlock(BasicBlock bb) { int bbNumber = shrikeCFG.getNumber(bb); SSACFG.ExceptionHandlerBasicBlock newBB = (SSACFG.ExceptionHandlerBasicBlock) cfg.getNode(bbNumber); SSAGetCaughtExceptionInstruction s = newBB.getCatchInstruction(); int exceptionValue; if (s == null) { exceptionValue = symbolTable.newSymbol(); s = insts.GetCaughtExceptionInstruction(SSAInstruction.NO_INDEX, bbNumber, exceptionValue); newBB.setCatchInstruction(s); } else { exceptionValue = s.getException(); } return exceptionValue; } }
@Override public int meetStackAtCatchBlock(BasicBlock bb) { int bbNumber = shrikeCFG.getNumber(bb); SSACFG.ExceptionHandlerBasicBlock newBB = (SSACFG.ExceptionHandlerBasicBlock) cfg.getNode(bbNumber); SSAGetCaughtExceptionInstruction s = newBB.getCatchInstruction(); int exceptionValue; if (s == null) { exceptionValue = symbolTable.newSymbol(); s = insts.GetCaughtExceptionInstruction(SSAInstruction.NO_INDEX, bbNumber, exceptionValue); newBB.setCatchInstruction(s); } else { exceptionValue = s.getException(); } return exceptionValue; } }
private void reuseOrCreatePi(SSAInstruction piCause, int ref) { int n = getCurrentInstructionIndex(); SSACFG.BasicBlock bb = cfg.getBlockForInstruction(n); BasicBlock path = getCurrentSuccessor(); int outNum = shrikeCFG.getNumber(path); SSAPiInstruction pi = bb.getPiForRefAndPath(ref, path); if (pi == null) { pi = insts.PiInstruction(SSAInstruction.NO_INDEX, symbolTable.newSymbol(), ref, bb.getNumber(), outNum, piCause); bb.addPiForRefAndPath(ref, path, pi); } workingState.replaceValue(ref, pi.getDef()); }
private void reuseOrCreatePi(SSAInstruction piCause, int ref) { int n = getCurrentInstructionIndex(); SSACFG.BasicBlock bb = cfg.getBlockForInstruction(n); BasicBlock path = getCurrentSuccessor(); int outNum = shrikeCFG.getNumber(path); SSAPiInstruction pi = bb.getPiForRefAndPath(ref, path); if (pi == null) { pi = insts.PiInstruction(SSAInstruction.NO_INDEX, symbolTable.newSymbol(), ref, bb.getNumber(), outNum, piCause); bb.addPiForRefAndPath(ref, path, pi); } workingState.replaceValue(ref, pi.getDef()); }
private void reuseOrCreatePi(SSAInstruction piCause, int ref) { int n = getCurrentInstructionIndex(); SSACFG.BasicBlock bb = cfg.getBlockForInstruction(n); BasicBlock path = getCurrentSuccessor(); int outNum = dexCFG.getNumber(path); SSAPiInstruction pi = bb.getPiForRefAndPath(ref, path); if (pi == null) { pi = insts.PiInstruction(getCurrentInstructionIndex(), symbolTable.newSymbol(), ref, bb.getNumber(), outNum, piCause); bb.addPiForRefAndPath(ref, path, pi); } workingState.replaceValue(ref, pi.getDef()); }
private void reuseOrCreatePi(SSAInstruction piCause, int ref) { int n = getCurrentInstructionIndex(); SSACFG.BasicBlock bb = cfg.getBlockForInstruction(n); BasicBlock path = getCurrentSuccessor(); int outNum = dexCFG.getNumber(path); SSAPiInstruction pi = bb.getPiForRefAndPath(ref, path); if (pi == null) { pi = insts.PiInstruction(getCurrentInstructionIndex(), symbolTable.newSymbol(), ref, bb.getNumber(), outNum, piCause); bb.addPiForRefAndPath(ref, path, pi); } workingState.replaceValue(ref, pi.getDef()); }
@Override protected void initializeVariables() { MachineState entryState = getEntryState(); int parameterNumber = 0; int local = -1; for (int i = 0; i < method.getNumberOfParameters(); i++) { local++; TypeReference t = method.getParameterType(i); if (t != null) { int symbol = symbolTable.getParameter(parameterNumber++); entryState.setLocal(local, symbol); if (t.equals(TypeReference.Double) || t.equals(TypeReference.Long)) { local++; } } } // This useless value ensures that the state cannot be empty, even // for a static method with no arguments in blocks with an empty stack // and no locals being used. This ensures that propagation of the // state thru the CFGSystem will always show changes the first time // it reaches a block, and thus no piece of the CFG will be skipped. // // (note that this bizarre state really happened, in java_cup) // entryState.push(symbolTable.newSymbol()); }
@Override protected void initializeVariables() { MachineState entryState = getEntryState(); int parameterNumber = 0; int local = -1; for (int i = 0; i < method.getNumberOfParameters(); i++) { local++; TypeReference t = method.getParameterType(i); if (t != null) { int symbol = symbolTable.getParameter(parameterNumber++); entryState.setLocal(local, symbol); if (t.equals(TypeReference.Double) || t.equals(TypeReference.Long)) { local++; } } } // This useless value ensures that the state cannot be empty, even // for a static method with no arguments in blocks with an empty stack // and no locals being used. This ensures that propagation of the // state thru the CFGSystem will always show changes the first time // it reaches a block, and thus no piece of the CFG will be skipped. // // (note that this bizarre state really happened, in java_cup) // entryState.push(symbolTable.newSymbol()); }