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); } } }
loc = getLabel(mAddress + readShort()); assembler.branch(loc); break; case Opcode.JSR: loc = getLabel(mAddress + readShort()); assembler.jsr(loc); break; case Opcode.GOTO_W: loc = getLabel(mAddress + readInt()); assembler.branch(loc); break; case Opcode.JSR_W: loc = getLabel(mAddress + readInt()); assembler.jsr(loc); break; loc = getLabel(mAddress + readShort()); assembler.ifNullBranch(loc, true); break; case Opcode.IFNONNULL: loc = getLabel(mAddress + readShort()); assembler.ifNullBranch(loc, false); break; loc = getLabel(mAddress + readShort()); assembler.ifEqualBranch(loc, true); break; case Opcode.IF_ACMPNE: loc = getLabel(mAddress + readShort());
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); } } }
loc = getLabel(mAddress + readShort()); assembler.branch(loc); break; case Opcode.JSR: loc = getLabel(mAddress + readShort()); assembler.jsr(loc); break; case Opcode.GOTO_W: loc = getLabel(mAddress + readInt()); assembler.branch(loc); break; case Opcode.JSR_W: loc = getLabel(mAddress + readInt()); assembler.jsr(loc); break; loc = getLabel(mAddress + readShort()); assembler.ifNullBranch(loc, true); break; case Opcode.IFNONNULL: loc = getLabel(mAddress + readShort()); assembler.ifNullBranch(loc, false); break; loc = getLabel(mAddress + readShort()); assembler.ifEqualBranch(loc, true); break; case Opcode.IF_ACMPNE: loc = getLabel(mAddress + readShort());