public final void update(VM_Address sfp, int whereFrom) { if (DEBUG) { VM.sysWrite("VM_EdgeListener.update("+sfp.toInt()+","+whereFrom+ "): enter "+samplesTaken+"\n"); }
  public void setBuffer(int[] buffer) {    // ensure buffer is proper length    if (VM.VerifyAssertions) {      VM.assert(buffer.length%3 == 0);    }    if (DEBUG) {      VM.sysWrite("VM_EdgeListener.setBuffer("+buffer.length+"): enter\n");         }    this.buffer    = buffer;    desiredSamples = buffer.length / 3;    resetBuffer();  }  /**   * This method is called when a call stack edge needs to be    * sampled.  Expect the sfp argument to point to the stack frame that   * contains the target of the edge to be sampled.   *   * RESTRICTION: the execution time of this method is time critical    * (we don't want another thread switch to occur inside of it).     * Therefore, this method simple stuffs integers into buffer.   *   * RESTRICTION: while GC is disabled, do not preform any operation that can   * allocate space!   *   * @param sfp  a pointer to the stack frame that corresponds to the callee of   *             the call graph edge that is to be sampled.   * @param whereFrom Was this a yieldpoint in a PROLOGUE, BACKEDGE, or   *         EPILOGUE?   */  public final void update(VM_Address sfp, int whereFrom) {    if (DEBUG) {      VM.sysWrite("VM_EdgeListener.update("+sfp.toInt()+","+whereFrom+		  "): enter "+samplesTaken+"\n");         }