ExceptionMarker exceptionMarker = null;
if (hasExceptionMarkers) {
exceptionMarker = exceptionMarkers[0];
}
StackMapFrame frame = new StackMapFrame(maxLocals);
if (!isClinit) {
initializeDefaultLocals(frame, methodBinding, maxLocals, codeLength);
}
frame.pc = -1;
frames.add(frame.duplicate());
while (true) {
int currentPC = pc - codeOffset;
if (hasStackMarkers && stackMarker.pc == currentPC) {
VerificationTypeInfo[] infos = frame.stackItems;
VerificationTypeInfo[] tempInfos = new VerificationTypeInfo[frame.numberOfStackItems];
System.arraycopy(infos, 0, tempInfos, 0, frame.numberOfStackItems);
stackMarker.setInfos(tempInfos);
} else if (hasStackMarkers && stackMarker.destinationPC == currentPC) {
VerificationTypeInfo[] infos = stackMarker.infos;
frame.stackItems = infos;
frame.numberOfStackItems = infos.length;
indexInStackMarkers++;
if (indexInStackMarkers < stackMarkersLength) {
stackMarker = stackMarkers[indexInStackMarkers];
} else {
hasStackMarkers = false;
}
}
if (hasStackDepthMarkers && stackDepthMarker.pc == currentPC) {
TypeBinding typeBinding = stackDepthMarker.typeBinding;
if (typeBinding != null) {
if (stackDepthMarker.delta > 0) {
frame.addStackItem(new VerificationTypeInfo(typeBinding));
} else {
frame.stackItems[frame.numberOfStackItems - 1] = new VerificationTypeInfo(typeBinding);
}
} else {
frame.numberOfStackItems--;
}
indexInStackDepthMarkers++;
if (indexInStackDepthMarkers < stackDepthMarkersLength) {
stackDepthMarker = stackDepthMarkers[indexInStackDepthMarkers];
} else {
hasStackDepthMarkers = false;
}
}
if (hasExceptionMarkers && exceptionMarker.pc == currentPC) {
frame.numberOfStackItems = 0;
frame.addStackItem(new VerificationTypeInfo(0, VerificationTypeInfo.ITEM_OBJECT, exceptionMarker.constantPoolName));
indexInExceptionMarkers++;
if (indexInExceptionMarkers < exceptionsMarkersLength) {
exceptionMarker = exceptionMarkers[indexInExceptionMarkers];
} else {
hasExceptionMarkers = false;
}
}
if (currentFramePosition < currentPC) {
do {
indexInFramePositions++;
if (indexInFramePositions < framePositionsLength) {
currentFramePosition = framePositions[indexInFramePositions];
} else {
// no more frame to generate
return;
}
} while (currentFramePosition < currentPC);
}
if (currentFramePosition == currentPC) {
// need to build a new frame and create a stack map attribute entry
StackMapFrame currentFrame = frame.duplicate();
currentFrame.pc = currentPC;
// initialize locals
initializeLocals(isClinit ? true : methodBinding.isStatic(), currentPC, currentFrame);
// insert a new frame
frames.add(currentFrame);