code: public int getInstanceSlot(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException {
          if (!isValid()) {
              throw new DataflowAnalysisException("Accessing invalid frame at " + ins);
          }
          int numConsumed = ins.consumeStack(cpg);
          if (numConsumed == Const.UNPREDICTABLE) {
              throw new DataflowAnalysisException("Unpredictable stack consumption in " + ins);
          }
          if (numConsumed > getStackDepth()) {
              throw new DataflowAnalysisException("Stack underflow " + ins);
          }
          return getNumSlots() - numConsumed;
      }
docs: Get the slot the object instance referred to by given instruction is
  located in.
  
  @param ins
  the Instruction
  @param cpg
  the ConstantPoolGen for the method
  @return stack slot the object instance is in
  @throws DataflowAnalysisException