thread.onStackReplacementEvent.suspendedThread = thread; thread.onStackReplacementEvent.whereFrom = whereFrom; thread.onStackReplacementEvent.CMID = ypTakenInCMID; thread.onStackReplacementEvent.tsFromFPoff = tsFromFPoff; thread.onStackReplacementEvent.ypTakenFPoff = ypTakenFPoff;
OSR_OnStackReplacementEvent event = (OSR_OnStackReplacementEvent)thread.onStackReplacementEvent; event.suspendedThread = thread; event.whereFrom = whereFrom; event.CMID = ypTakenInCMID; event.tsFromFPoff = tsFromFPoff; event.ypTakenFPoff = ypTakenFPoff;
  public static void trigger(int ypTakenInCMID,                             Offset tsFromFPoff,                             Offset ypTakenFPoff,                             int whereFrom) {     VM_Thread thread = VM_Thread.getCurrentThread();        VM_CompiledMethod ypTakenInCM = VM_CompiledMethods.getCompiledMethod(ypTakenInCMID);    VM_Method ypTakenInMethod = ypTakenInCM.getMethod();     boolean isInBootImage = ypTakenInMethod.getDeclaringClass().isInBootImage();    if (isInBootImage) return;        thread.onStackReplacementEvent.suspendedThread = thread;    thread.onStackReplacementEvent.whereFrom = whereFrom;    thread.onStackReplacementEvent.CMID = ypTakenInCMID;    thread.onStackReplacementEvent.tsFromFPoff = tsFromFPoff;    thread.onStackReplacementEvent.ypTakenFPoff = ypTakenFPoff;    // consumer:    thread.requesting_osr = true;            // osr organizer must be initialized already    if (VM_Controller.osrOrganizer.osr_flag == false) {      VM_Controller.osrOrganizer.osr_flag = true;      VM_Controller.osrOrganizer.activate();    }    thread.osrSuspend();  }