private void invokeRecordAllocation(String typeName) {
    Matcher matcher = namePattern.matcher(typeName);
    if (matcher.find()) {
      typeName = matcher.group(1);
    }
    // stack: ... count newobj
    super.visitInsn(Opcodes.DUP_X1);
    // -> stack: ... newobj count newobj
    super.visitLdcInsn(typeName);
    // -> stack: ... newobj count newobj typename
    super.visitInsn(Opcodes.SWAP);
    // -> stack: ... newobj count typename newobj
    super.visitMethodInsn(
        Opcodes.INVOKESTATIC, recorderClass, recorderMethod, RECORDER_SIGNATURE, false);
    // -> stack: ... newobj
  }
Called by the ASM framework once the class is done being visited to compute stack & local
variable count maximums.
src/main/java/com/google/monitoring/runtime/instrumentation/AllocationMethodAdapter.java