public Label createLabel() { return mAssembler.createLabel(); }
private Label getLabel(int address) { int labelKey = address; Object labelValue = mLabels.get(labelKey); // labelValue will never be null unless gatherLabels is broken. if (!(labelValue instanceof Label)) { labelValue = mAssembler.createLabel(); mLabels.put(labelKey, labelValue); } return (Label)labelValue; } }
public Label createLabel() { return mAssembler.createLabel(); }
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 Label getLabel(int address) { int labelKey = address; Object labelValue = mLabels.get(labelKey); // labelValue will never be null unless gatherLabels is broken. if (!(labelValue instanceof Label)) { labelValue = mAssembler.createLabel(); mLabels.put(labelKey, labelValue); } return (Label)labelValue; } }
/** * @param partialStartVar must not be null */ private Label[] jumpToPartialEntryPoints(CodeAssembler a, LocalVariable partialStartVar, int propertyCount) { // Create all the entry points for offset var, whose locations will be // set later. int[] cases = new int[propertyCount]; Label[] entryPoints = new Label[propertyCount]; for (int i=0; i<propertyCount; i++) { cases[i] = i; entryPoints[i] = a.createLabel(); } // Now jump in! Label errorLoc = a.createLabel(); a.loadLocal(partialStartVar); a.switchBranch(cases, entryPoints, errorLoc); errorLoc.setLocation(); TypeDesc errorType = TypeDesc.forClass(IllegalArgumentException.class); a.newObject(errorType); a.dup(); a.loadConstant("Illegal partial start offset"); a.invokeConstructor(errorType, new TypeDesc[] {TypeDesc.STRING}); a.throwObject(); return entryPoints; }
/** * @param partialStartVar must not be null */ private Label[] jumpToPartialEntryPoints(CodeAssembler a, LocalVariable partialStartVar, int propertyCount) { // Create all the entry points for offset var, whose locations will be // set later. int[] cases = new int[propertyCount]; Label[] entryPoints = new Label[propertyCount]; for (int i=0; i<propertyCount; i++) { cases[i] = i; entryPoints[i] = a.createLabel(); } // Now jump in! Label errorLoc = a.createLabel(); a.loadLocal(partialStartVar); a.switchBranch(cases, entryPoints, errorLoc); errorLoc.setLocation(); TypeDesc errorType = TypeDesc.forClass(IllegalArgumentException.class); a.newObject(errorType); a.dup(); a.loadConstant("Illegal partial start offset"); a.invokeConstructor(errorType, new TypeDesc[] {TypeDesc.STRING}); a.throwObject(); return entryPoints; }
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); } } }
a.storeLocal(actualGeneration); a.loadLocal(actualGeneration); Label compareGeneration = a.createLabel(); a.ifZeroComparisonBranch(compareGeneration, ">="); Label generationMatches = a.createLabel(); a.ifComparisonBranch(generationMatches, "==");
a.storeLocal(actualGeneration); a.loadLocal(actualGeneration); Label compareGeneration = a.createLabel(); a.ifZeroComparisonBranch(compareGeneration, ">="); Label generationMatches = a.createLabel(); a.ifComparisonBranch(generationMatches, "==");
StorablePropertyInfo info = infos[i]; Label storePropertyLocation = a.createLabel(); Label nextPropertyLocation = a.createLabel(); a.loadConstant(PROPERTY_STATE_MASK << ((property.getNumber() & 0xf) * 2)); a.math(Opcode.IAND); Label isInitialized = a.createLabel(); a.ifZeroComparisonBranch(isInitialized, "!="); Label notNull = a.createLabel(); a.ifNullBranch(notNull, false); a.loadConstant(1 + (offsetVar == null ? constantOffset : 0)); Label cont = a.createLabel(); a.branch(cont); notNull.setLocation();
StorablePropertyInfo info = infos[i]; Label storePropertyLocation = a.createLabel(); Label nextPropertyLocation = a.createLabel(); a.loadConstant(PROPERTY_STATE_MASK << ((property.getNumber() & 0xf) * 2)); a.math(Opcode.IAND); Label isInitialized = a.createLabel(); a.ifZeroComparisonBranch(isInitialized, "!="); Label notNull = a.createLabel(); a.ifNullBranch(notNull, false); a.loadConstant(1 + (offsetVar == null ? constantOffset : 0)); Label cont = a.createLabel(); a.branch(cont); notNull.setLocation();
Label exitPoint = a.createLabel(); nextProperty = a.createLabel(); Label isNull = a.createLabel(); a.ifNullBranch(isNull, true); Label notNull = a.createLabel(); a.branch(notNull); isNull.setLocation(); Label noPrefix = a.createLabel(); a.ifZeroComparisonBranch(noPrefix, "!="); a.loadConstant(prefix + generationPrefix); Label noSuffix = a.createLabel(); a.loadConstant(properties.length); a.ifComparisonBranch(noSuffix, "!="); Label noPrefix = a.createLabel(); a.ifZeroComparisonBranch(noPrefix, "!="); a.loadConstant(prefix + generationPrefix); Label exitPoint = a.createLabel(); Label nextProperty = a.createLabel(); Label notNull = a.createLabel(); a.ifNullBranch(notNull, false);
Label exitPoint = a.createLabel(); nextProperty = a.createLabel(); Label isNull = a.createLabel(); a.ifNullBranch(isNull, true); Label notNull = a.createLabel(); a.branch(notNull); isNull.setLocation(); Label noPrefix = a.createLabel(); a.ifZeroComparisonBranch(noPrefix, "!="); a.loadConstant(prefix + generationPrefix); Label noSuffix = a.createLabel(); a.loadConstant(properties.length); a.ifComparisonBranch(noSuffix, "!="); Label noPrefix = a.createLabel(); a.ifZeroComparisonBranch(noPrefix, "!="); a.loadConstant(prefix + generationPrefix); Label exitPoint = a.createLabel(); Label nextProperty = a.createLabel(); Label notNull = a.createLabel(); a.ifNullBranch(notNull, false);
Label convertLabel = a.createLabel(); Label convertedLabel = a.createLabel();
Label convertLabel = a.createLabel(); Label convertedLabel = a.createLabel();