public void integerIncrement(LocalVariable local, int amount) { if (local == null) { throw new IllegalArgumentException("No local variable specified"); } if (-32768 <= amount && amount <= 32767) { mInstructions.new ShortIncrementInstruction(local, (short)amount); } else { // Amount can't possibly fit in a 16-bit value, so use regular // instructions instead. loadLocal(local); loadConstant(amount); math(Opcode.IADD); storeLocal(local); } }
private void emit_if() { LocalVariable var1 = b.createLocalVariable("var1", TypeDesc.DOUBLE); LocalVariable var2 = b.createLocalVariable("var2", TypeDesc.DOUBLE); b.storeLocal(var2); b.storeLocal(var1); Label lbl1 = b.createLabel(); Label lbl2 = b.createLabel(); b.ifZeroComparisonBranch(lbl1, "!="); b.loadLocal(var1); b.branch(lbl2); lbl1.setLocation(); b.loadLocal(var2); lbl2.setLocation(); }
private void nullConvert(Label end) { LocalVariable temp = createLocalVariable("temp", TypeDesc.OBJECT); storeLocal(temp); loadLocal(temp); Label notNull = createLabel(); ifNullBranch(notNull, false); loadNull(); branch(end); notNull.setLocation(); loadLocal(temp); }
mBuilder.storeLocal(savedIndex); depth, posIndex + 2); mBuilder.loadLocal(savedIndex); mBuilder.storeLocal(mIndexLocal);
mBuilder.storeLocal(mPositionsLocal); mBuilder.storeLocal(mIndexLocal); mTempLocals = new Stack(); mReturnLabel = mBuilder.createLabel();
tempChar = (LocalVariable)mTempLocals.pop(); mBuilder.storeLocal(tempChar); mBuilder.loadLocal(tempChar);
builder.loadLocal(obj2); builder.invoke(compareMethod); builder.storeLocal(result); builder.loadLocal(result); label = builder.createLabel(); builder.loadLocal(obj1); builder.checkCast(type); builder.storeLocal(obj1); builder.loadLocal(obj2); builder.checkCast(type); builder.storeLocal(obj2); builder.storeLocal(p1); builder.loadLocal(obj2); builder.invoke(prop.getReadMethod()); builder.storeLocal(p2); builder.storeLocal(result); builder.loadLocal(result); builder.ifZeroComparisonBranch(nextLabel, "==");
b.loadLocal(beanVar); b.checkCast(TypeDesc.forClass(beanType)); b.storeLocal(beanVar);
b.loadLocal(beanVar); b.checkCast(TypeDesc.forClass(beanType)); b.storeLocal(beanVar);
/** * Generates code to get the JDBCSupport instance and store it in a local * variable. */ private LocalVariable getJDBCSupport(CodeBuilder b) { pushJDBCSupport(b); LocalVariable supportVar = b.createLocalVariable("support", TypeDesc.forClass(JDBCSupport.class)); b.storeLocal(supportVar); return supportVar; }
/** * Generates code to get the JDBCSupport instance and store it in a local * variable. */ private LocalVariable getJDBCSupport(CodeBuilder b) { pushJDBCSupport(b); LocalVariable supportVar = b.createLocalVariable("support", TypeDesc.forClass(JDBCSupport.class)); b.storeLocal(supportVar); return supportVar; }
/** * Creates local variable to hold invocation input stream, unless already * created. Assumes that */ private static LocalVariable invInVar(CodeBuilder b, LocalVariable channelVar, LocalVariable invInVar) { if (invInVar == null) { b.loadLocal(channelVar); b.invokeInterface(INV_CHANNEL_TYPE, "getInputStream", INV_IN_TYPE, null); invInVar = b.createLocalVariable(null, INV_IN_TYPE); b.storeLocal(invInVar); } return invInVar; }
public void integerIncrement(LocalVariable local, int amount) { if (local == null) { throw new IllegalArgumentException("No local variable specified"); } if (-32768 <= amount && amount <= 32767) { mInstructions.new ShortIncrementInstruction(local, (short)amount); } else { // Amount can't possibly fit in a 16-bit value, so use regular // instructions instead. loadLocal(local); loadConstant(amount); math(Opcode.IADD); storeLocal(local); } }
void makeCopy(CodeBuilder b) { b.loadThis(); b.loadField(property.getName(), copyVar.getType()); b.storeLocal(copyVar); }
void makeCopy(CodeBuilder b) { b.loadThis(); b.loadField(property.getName(), copyVar.getType()); b.storeLocal(copyVar); }
/** * Generate code to create a local variable containing the specified parameter coerced * to the specified type. This is useful for re-interpreting erased generics into * the more specific genericized type. * * @param b CodeBuilder into which to append the code * @param paramType the more specific type which was erased during compilation * @param paramIndex index of the parameter to unerase * @return a local variable referencing the type-cast parameter */ public static LocalVariable uneraseGenericParameter( CodeBuilder b, TypeDesc paramType, final int paramIndex) { b.loadLocal(b.getParameter(paramIndex)); b.checkCast(paramType); LocalVariable result = b.createLocalVariable(null, paramType); b.storeLocal(result); return result; }
/** * Generate code to create a local variable containing the specified parameter coerced * to the specified type. This is useful for re-interpreting erased generics into * the more specific genericized type. * * @param b CodeBuilder into which to append the code * @param paramType the more specific type which was erased during compilation * @param paramIndex index of the parameter to unerase * @return a local variable referencing the type-cast parameter */ public static LocalVariable uneraseGenericParameter( CodeBuilder b, TypeDesc paramType, final int paramIndex) { b.loadLocal(b.getParameter(paramIndex)); b.checkCast(paramType); LocalVariable result = b.createLocalVariable(null, paramType); b.storeLocal(result); return result; }
/** * Generates code to get connection from JDBCConnectionCapability and store * it in a local variable. * * @param capVar reference to JDBCConnectionCapability */ private LocalVariable getConnection(CodeBuilder b, LocalVariable capVar) { b.loadLocal(capVar); b.invokeInterface(TypeDesc.forClass(JDBCConnectionCapability.class), "getConnection", TypeDesc.forClass(Connection.class), null); LocalVariable conVar = b.createLocalVariable("con", TypeDesc.forClass(Connection.class)); b.storeLocal(conVar); return conVar; }
/** * Generates code to get connection from JDBCConnectionCapability and store * it in a local variable. * * @param capVar reference to JDBCConnectionCapability */ private LocalVariable getConnection(CodeBuilder b, LocalVariable capVar) { b.loadLocal(capVar); b.invokeInterface(TypeDesc.forClass(JDBCConnectionCapability.class), "getConnection", TypeDesc.forClass(Connection.class), null); LocalVariable conVar = b.createLocalVariable("con", TypeDesc.forClass(Connection.class)); b.storeLocal(conVar); return conVar; }
private void nullConvert(Label end) { LocalVariable temp = createLocalVariable("temp", TypeDesc.OBJECT); storeLocal(temp); loadLocal(temp); Label notNull = createLabel(); ifNullBranch(notNull, false); loadNull(); branch(end); notNull.setLocation(); loadLocal(temp); }