}
return null;
}
private void emitStoreState(MethodVisitor mv, int idx, FrameInfo fi) {
Frame f = frames[fi.endInstruction];
if (verifyVarInfoss != null) {
VerifyVarInfo[] vis = verifyVarInfoss[idx-1] = new VerifyVarInfo[fi.numSlots*2];
for(int i=f.getStackSize() ; i-->0 ;) {
BasicValue v = (BasicValue) f.getStack(i);
if (!isOmitted(v) && !isNullType(v)) {
VerifyVarInfo vi = new VerifyVarInfo();
int slotIdx = fi.stackSlotIndices[i];
vi.idx = i;
vi.name = "_NGX_STACK_VAL_";
vi.dataIdx = slotIdx;
vi.value = v;
if (v.isReference()) {
vis[slotIdx] = vi;
}else {
vis[fi.numSlots + slotIdx] = vi;
}
}
}
for(int i=firstLocal ; i<f.getLocals() ; i++) {
BasicValue v = (BasicValue) f.getLocal(i);
if(!isNullType(v)) {
VerifyVarInfo vi = new VerifyVarInfo();
int slotIdx = fi.localSlotIndices[i];
LocalVariableNode lvn = findVarNode(i);
if (lvn != null) {
vi.name = lvn.name;
vi.idx = i;
}
vi.dataIdx = slotIdx;
vi.value = v;
if (v.isReference()) {
vis[slotIdx] = vi;
}else {
vis[fi.numSlots + slotIdx] = vi;
}
}
}
}
if(fi.lBefore != null) {
fi.lBefore.accept(mv);
}
mv.visitVarInsn(Opcodes.ALOAD,lvarStack);
emitConst(mv, idx);
emitConst(mv, fi.numSlots);
if (verifyVarInfoss != null) {
mv.visitLdcInsn(classAndMethod);
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, STACK_NAME, "pushMethodAndReserveSpaceV", "(IILjava/lang/String;)V");
}else {
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, STACK_NAME, "pushMethodAndReserveSpace", "(II)V");
}
for(int i=f.getStackSize() ; i-->0 ;) {
BasicValue v = (BasicValue) f.getStack(i);
if(!isOmitted(v)) {
if(!isNullType(v)) {
int slotIdx = fi.stackSlotIndices[i];
assert slotIdx >= 0 && slotIdx < fi.numSlots;
emitStoreValue(mv, v, lvarStack, slotIdx);
} else {
db.trace("NULL stack entry: type=%s size=%d", v.getType(), v.getSize());
mv.visitInsn(Opcodes.POP);
}
}
}
for(int i=firstLocal ; i<f.getLocals() ; i++) {
BasicValue v = (BasicValue) f.getLocal(i);
if(!isNullType(v)) {
mv.visitVarInsn(v.getType().getOpcode(Opcodes.ILOAD), i);
int slotIdx = fi.localSlotIndices[i];
assert slotIdx >= 0 && slotIdx < fi.numSlots;
emitStoreValue(mv, v, lvarStack, slotIdx);