public void loadConstant(boolean value) { loadConstant(value ? 1 : 0); }
private void emit_double(double value) { b.loadConstant(value); }
private void emit_integer(int value) { b.loadConstant(value); }
private void emit_cond(String comp) { Label lbl1 = b.createLabel(); Label lbl2 = b.createLabel(); b.ifComparisonBranch(lbl1, comp, TypeDesc.DOUBLE); b.loadConstant(1); b.branch(lbl2); lbl1.setLocation(); b.loadConstant(0); lbl2.setLocation(); }
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 generateAddMatchResult(PatternNode node) { mBuilder.mapLineNumber(++mReferenceLine); mBuilder.loadLocal(mLimitLocal); mBuilder.loadLocal(mResultsLocal); mBuilder.loadConstant(node.mPattern); mBuilder.loadThis(); mBuilder.loadField("mValues", TypeDesc.OBJECT.toArrayType()); mBuilder.loadConstant(node.mOrder); mBuilder.loadFromArray(TypeDesc.OBJECT); mBuilder.loadLocal(mPositionsLocal); mBuilder.loadConstant(node.getWildcardCount() * 2); TypeDesc[] params = { mIntType, mListType, mStringType, mObjectType, mIntArrayType, mIntType }; mBuilder.invokeStatic(PatternMatcher.class.getName(), "addMatchResult", mBooleanType, params); mBuilder.ifZeroComparisonBranch(mReturnLabel, "=="); } }
mBuilder.loadConstant(posIndex - 1); mBuilder.loadLocal(mIndexLocal); if (depth > 0) { mBuilder.loadConstant(depth); mBuilder.math(Opcode.IADD); mBuilder.loadLocal(mIndexLocal); if (depth > 0) { mBuilder.loadConstant(depth); mBuilder.math(Opcode.IADD); mBuilder.loadConstant('\uffff'); mBuilder.ifComparisonBranch(loopEnd, "=="); } else { mBuilder.loadLocal(tempChar); mBuilder.loadConstant('\uffff'); mBuilder.ifComparisonBranch(loopEnd, "==");
mBuilder.loadConstant(posIndex); mBuilder.loadLocal(mIndexLocal); if (depth > 0) { mBuilder.loadConstant(depth); mBuilder.math(Opcode.IADD); mBuilder.loadLocal(mIndexLocal); if (depth > 0) { mBuilder.loadConstant(depth); mBuilder.math(Opcode.IADD); mBuilder.loadConstant((char)c); mBuilder.ifComparisonBranch(noMatch, "!=");
private void toBoolean(boolean box) { if (box && mTarget >= 0x00010004) { // Call the new valueOf method. invokeStatic("java.lang.Boolean", "valueOf", TypeDesc.BOOLEAN.toObjectType(), new TypeDesc[] {TypeDesc.BOOLEAN}); return; } Label nonZero = createLabel(); Label done = createLabel(); ifZeroComparisonBranch(nonZero, "!="); if (box) { TypeDesc newType = TypeDesc.BOOLEAN.toObjectType(); loadStaticField(newType.getRootName(), "FALSE", newType); branch(done); nonZero.setLocation(); loadStaticField(newType.getRootName(), "TRUE", newType); } else { loadConstant(false); branch(done); nonZero.setLocation(); loadConstant(true); } done.setLocation(); }
loadConstant(strlen); invokeConstructor(stringBufferDesc, new TypeDesc[] {intDesc});
Label notEqual = b.createLabel(); b.ifEqualBranch(notEqual, false); b.loadConstant(true); b.returnValue(TypeDesc.BOOLEAN); b.ifZeroComparisonBranch(isInstance, "!="); b.loadConstant(false); b.returnValue(TypeDesc.BOOLEAN);
mBuilder.loadConstant(mMaxWildPerKey * 2); mBuilder.newObject(mIntArrayType); mBuilder.storeLocal(mPositionsLocal); mBuilder.loadConstant(0); mBuilder.storeLocal(mIndexLocal); mTempLocals = new Stack();
b.loadConstant(true); b.returnValue(TypeDesc.BOOLEAN); b.loadConstant(false); b.returnValue(TypeDesc.BOOLEAN); b.loadConstant(true); b.returnValue(TypeDesc.BOOLEAN); b.loadConstant(false); b.returnValue(TypeDesc.BOOLEAN);
b.loadLocal(propertyVar); b.invokeVirtual(String.class.getName(), "hashCode", TypeDesc.INT, null); b.loadConstant(0x7fffffff); b.math(Opcode.IAND); b.loadConstant(caseCount); b.math(Opcode.IREM); b.loadConstant(bp.getName()); b.loadLocal(propertyVar); b.invokeVirtual(String.class.getName(), "equals", TypeDesc.BOOLEAN, params); b.returnVoid(); } else { b.loadConstant(true); b.returnValue(TypeDesc.BOOLEAN); b.loadConstant(true); b.returnValue(TypeDesc.BOOLEAN); break; b.loadConstant(false); b.returnValue(TypeDesc.BOOLEAN); } else if (methodType == TRY_READ_METHOD) { b.dup(); b.loadLocal(propertyVar); b.loadConstant(methodType == READ_METHOD);
builder.loadConstant(0); } else { builder.branch(nextLabel);
Label label = builder.createLabel(); builder.ifZeroComparisonBranch(label, ">="); builder.loadConstant(-1); builder.branch(done); label = builder.createLabel(); builder.ifZeroComparisonBranch(label, "<="); builder.loadConstant(1); builder.branch(done); Label label = builder.createLabel(); builder.ifZeroComparisonBranch(label, ">="); builder.loadConstant(-1); builder.branch(done); label = builder.createLabel(); builder.ifZeroComparisonBranch(label, "<="); builder.loadConstant(1); builder.branch(done);
builder.loadLocal(obj1); builder.ifNullBranch(label, false); builder.loadConstant(nullHigh ? 1 : -1); builder.returnValue(TypeDesc.INT); label.setLocation(); builder.loadLocal(obj2); builder.ifNullBranch(label, false); builder.loadConstant(nullHigh ? -1 : 1); builder.returnValue(TypeDesc.INT); label.setLocation(); builder.loadThis(); builder.loadField("mUsingComparators", comparatorArrayType); builder.loadConstant(0); builder.loadFromArray(TypeDesc.forClass(Comparator.class)); builder.loadLocal(obj1); builder.loadLocal(p1); builder.ifNullBranch(label, false); builder.loadConstant(nullHigh ? 1 : -1); builder.returnValue(TypeDesc.INT); label.setLocation(); builder.loadLocal(p2); builder.ifNullBranch(label, false); builder.loadConstant(nullHigh ? -1 : 1); builder.returnValue(TypeDesc.INT); label.setLocation();
void success(CodeBuilder b) { if (mSuccessLocation != null) { b.branch(mSuccessLocation); } else { b.loadConstant(true); b.returnValue(BOOLEAN); } }
loadConstant(0L); math(Opcode.LCMP); toBoolean(!toType.isPrimitive()); loadConstant(0.0f); math(Opcode.FCMPG); toBoolean(!toType.isPrimitive()); loadConstant(0.0d); math(Opcode.DCMPG); toBoolean(!toType.isPrimitive());
private void genFinished(CodeBuilder b, LocalVariable channelVar, boolean reset) { b.loadThis(); b.loadField(SUPPORT_FIELD_NAME, SKEL_SUPPORT_TYPE); b.loadLocal(channelVar); b.loadConstant(reset); b.invokeInterface(SKEL_SUPPORT_TYPE, "finished", TypeDesc.INT, new TypeDesc[] {INV_CHANNEL_TYPE, TypeDesc.BOOLEAN}); }