VP
Size: a a a
VP
RI
VN
RI
VN
RI
RI
RI
VP
VN
VN
BV
VN
BV
BV
BV
VP
N
listOf(
a,
b,
*someList.flatMap { listOf(it.c, it.d) }
)
listOf(
a,
b,
*someList.flatMap { listOf(it.c, it.d) }.toTypedArray()
)
N
public void addSpread(Object container) {
if (container == null) return;
if (container instanceof Object[]) {
Object[] array = (Object[]) container;
if (array.length > 0) {
list.ensureCapacity(list.size() + array.length);
Collections.addAll(list, array);
}
}
else if (container instanceof Collection) {
list.addAll((Collection) container);
}
else if (container instanceof Iterable) {
for (Object element : (Iterable) container) {
list.add(element);
}
}
else if (container instanceof Iterator) {
for (Iterator iterator = (Iterator) container; iterator.hasNext(); ) {
list.add(iterator.next());
}
}
else {
throw new UnsupportedOperationException("Don't know how to spread " + container.getClass());
}
}
L41
LINENUMBER 154 L41
ALOAD 15
ICONST_0
ANEWARRAY pl/some/type
INVOKEINTERFACE java/util/Collection.toArray ([Ljava/lang/Object;)[Ljava/lang/Object; (itf)
L43
ASTORE 21
ALOAD 13
ALOAD 12
ALOAD 21
INVOKEVIRTUAL kotlin/jvm/internal/SpreadBuilder.addSpread (Ljava/lang/Object;)V
N