public void mapLineNumber(int lineNumber) { if (mSaveLineNumberInfo) { mCodeAttr.mapLineNumber(createLabel().setLocation(), lineNumber); } }
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 exceptionHandler(Location startLocation, Location endLocation, String catchClassName) { if (!(startLocation instanceof InstructionList.LabelInstruction)) { throw new IllegalArgumentException("Start location is not a label instruction"); } if (!(endLocation instanceof InstructionList.LabelInstruction)) { throw new IllegalArgumentException("End location is not a label instruction"); } Location catchLocation = createLabel().setLocation(); ConstantClassInfo catchClass; if (catchClassName == null) { catchClass = null; } else { catchClass = mCp.addConstantClass(catchClassName); } ExceptionHandler<InstructionList.LabelInstruction> handler = new ExceptionHandler<InstructionList.LabelInstruction> ((InstructionList.LabelInstruction)startLocation, (InstructionList.LabelInstruction)endLocation, (InstructionList.LabelInstruction)catchLocation, catchClass); mInstructions.addExceptionHandler(handler); }
CodeDisassembler cd = new CodeDisassembler(defineMethod); cd.disassemble(this, paramVars, returnLocation); returnLocation.setLocation();
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 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(); }
private void locateLabel() { int labelKey = mAddress; Object labelValue = mLabels.get(labelKey); if (labelValue != null) { if (labelValue instanceof Label) { ((Label)labelValue).setLocation(); } else { labelValue = mAssembler.createLabel().setLocation(); mLabels.put(labelKey, labelValue); } } List<ExceptionHandler> handlers = mCatchLocations.get(labelKey); if (handlers != null) { for (int i=0; i<handlers.size(); i++) { ExceptionHandler handler = handlers.get(i); Label start = getLabel(handler.getStartLocation().getLocation()); Label end = getLabel(handler.getEndLocation().getLocation()); String catchClassName; if (handler.getCatchType() == null) { catchClassName = null; } else { catchClassName = handler.getCatchType().getType().getFullName(); } mAssembler.exceptionHandler(start, end, catchClassName); } } }
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); }
Label tryStart = builder.createLabel().setLocation(); builder.loadLocal(a); builder.checkCast(comparableType); builder.loadLocal(b); builder.checkCast(comparableType); Label tryEnd = builder.createLabel().setLocation(); builder.invoke(compareToMethod); builder.branch(goodLabel); goodLabel.setLocation();
private void generateWildcard(PatternNode node, int depth, int posIndex) { Label loopStart = mBuilder.createLabel().setLocation(); Label loopEnd = mBuilder.createLabel(); Label loopContinue = mBuilder.createLabel(); loopContinue.setLocation(); mBuilder.integerIncrement(mIndexLocal, 1); mBuilder.branch(loopStart); loopEnd.setLocation();
b.returnValue(TypeDesc.BOOLEAN); notEqual.setLocation(); b.returnValue(TypeDesc.BOOLEAN); isInstance.setLocation();
noMatch.setLocation();
builder.branch(done); label.setLocation(); builder.loadLocal(a); builder.loadLocal(b); label.setLocation(); builder.loadLocal(a); builder.invoke(floatToIntBits); builder.math(Opcode.LCMP); done.setLocation(); } else if (type == double.class) { builder.branch(done); label.setLocation(); builder.loadLocal(a); builder.loadLocal(b); label.setLocation(); builder.loadLocal(a); builder.invoke(doubleToLongBits); done.setLocation(); } else if (type == long.class) { builder.loadLocal(a);
mReturnLabel.setLocation(); mBuilder.returnVoid();
b.returnValue(TypeDesc.BOOLEAN); noMatch.setLocation(); b.returnValue(TypeDesc.BOOLEAN); searchNotNull.setLocation(); b.returnValue(TypeDesc.BOOLEAN); noMatch.setLocation();
builder.loadConstant(nullHigh ? 1 : -1); builder.returnValue(TypeDesc.INT); label.setLocation(); label = builder.createLabel(); builder.loadLocal(obj2); builder.loadConstant(nullHigh ? -1 : 1); builder.returnValue(TypeDesc.INT); label.setLocation(); builder.loadLocal(result); builder.returnValue(TypeDesc.INT); label.setLocation(); builder.loadConstant(nullHigh ? 1 : -1); builder.returnValue(TypeDesc.INT); label.setLocation(); label = builder.createLabel(); builder.loadLocal(p2); builder.loadConstant(nullHigh ? -1 : 1); builder.returnValue(TypeDesc.INT); label.setLocation(); notString.setLocation(); generateComparableCompareTo (builder, propertyClass, compareToMethod, resultLabel, nextLabel, p1, p2);
switchLabels[i].setLocation(); notEqual.setLocation(); noMatch.setLocation();
public void mapLineNumber(int lineNumber) { if (mSaveLineNumberInfo) { mCodeAttr.mapLineNumber(createLabel().setLocation(), lineNumber); } }
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); }