What's a difference between "FRAME FULL" and "FRAME APPEND"? I check 2 ways to use iterators:
int size = 0;
Iterator<String> it = l.iterator();
while (it.hasNext()) {
String s = it.next();
int length = s.length();
size += length;
}
int size = 0;
for (String s : l) {
int length = s.length();
size += length;
}
they both use iterators, but bytecode is a bit different.
The frame type append_frame is used when the operand stack is empty and the current locals are the same as the locals in the previous frame, except that k additional locals are defined. Frame type full_frame is used when all other types are not applicably, it is also less compact one.
The first version has an explicit iterator name, i.e. one more local variable. The frames show the start and end of groups of local variables. I assume full means it is describing all local variables, append means it is adding additional local variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With