public static StackEntry of(String descriptor, ConstPool pool) {
        if(!DescriptorUtils.isPrimitive(descriptor)) {
            return new StackEntry(StackEntryType.OBJECT, descriptor, pool);
        }else {
            char ret = descriptor.charAt(0);
            switch (ret) {
                case 'I':
                case 'Z':
                case 'S':
                case 'B':
                case 'C':
                    return new StackEntry(StackEntryType.INT, descriptor);
                case 'F':
                    return new StackEntry(StackEntryType.FLOAT, descriptor);
                case 'D':
                    return new StackEntry(StackEntryType.DOUBLE, descriptor);
                case 'J':
                    return new StackEntry(StackEntryType.LONG, descriptor);
            }
        }
        throw new RuntimeException("Unknown descriptor: " + descriptor);
    }