@Override public void visitMaxs(int maxStack, int maxLocals) { visitLabel(end); if (sandboxVar == 0) visitVMVMLocalVariable(); while (newLVs.size() > 0) { LocalVariableNode lv = newLVs.pop(); if (lvDescs.get(lv.index) != null) lv.desc = lvDescs.get(lv.index); try { super.visitLocalVariable(lv.name, lv.desc, lv.signature, this.start, this.end, lv.index); if (lv.index == sandboxVar - 1) visitVMVMLocalVariable(); } catch (NullPointerException ex) { System.err.println( "Unable to visit local variable " + lv.name + " " + lv.desc + " (num " + lv.index + ")"); ex.printStackTrace(); } } super.visitMaxs(maxStack, maxLocals); }
@Override public void visitLocalVariable( String name, String desc, String signature, Label start, Label end, int index) { if (oldLVtoSandboxLV != null && oldLVtoSandboxLV.containsKey(index)) lvDescs.put(getSboxLVMap(index), desc); // if (sandboxVar == index && !sandboxVarVisited) { // sandboxVarVisited = true; // visitLabel(end); // super.visitLocalVariable("vmvmSandboxIndx", Type.getDescriptor(VMState.class), null, // this.start, this.end, sandboxVar); // } while (newLVs.size() > 0 && newLVs.peek().index < index) { LocalVariableNode lv = newLVs.pop(); if (lvDescs.get(lv.index) != null) lv.desc = lvDescs.get(lv.index); super.visitLocalVariable(lv.name, lv.desc, lv.signature, this.start, this.end, lv.index); } if (index >= firstLocal - 1 && !isMain() && !name.equals("<clinit>")) { super.visitLocalVariable(name, desc, signature, start, end, index + 1); } else { super.visitLocalVariable(name, desc, signature, start, end, index); if (index == sandboxVar - 1) visitVMVMLocalVariable(); } }