private int getBranchOffset(Object to) {
        Integer label = labels.get(to);
        if(label == null) {
            label = 0; // should result in an infinite loop if it is not fixed up
            ArrayList<Integer> fix = fixup.get(to);
            if(fix == null) {
                fix = new ArrayList<Integer>();
                fixup.put(to, fix);
            }
            // this will be the index of the next instruction emited,
            // which should be our branch
            fix.add(code.size());
        }
        return label - code.size();
    }