jboolean StepModifier::find_frame(address starting_fp, JavaFrame *frame)
{
  JavaFrame caller(*frame);
  caller.caller_is(caller);
  while (true) {
    if (caller.is_entry_frame()) {
      EntryFrame e = caller.as_EntryFrame();
      if (e.is_first_frame()) {
        // did not find the frame
        return false;
      }
      e.caller_is(caller);
    } else if (caller.is_java_frame()) {
      JavaFrame jf = caller.as_JavaFrame();
      if (starting_fp == jf.fp()) {
        // found the frame
        return true;
      }
      jf.caller_is(caller);
    }
  }
}
Esempio n. 2
0
void
LedgerDelta::modEntry(EntryFrame const& entry)
{
    modEntry(entry.copy());
}
Esempio n. 3
0
void
LedgerDelta::deleteEntry(EntryFrame const& entry)
{
    deleteEntry(entry.copy());
}
Esempio n. 4
0
void
VMEvent::clear_impossible_to_compile(LocationModifier *mod, VMEvent *ep)
{
  UsingFastOops fast_oops;

  // If we are using the compiler then we should reset the
  // impossible_to_compile flag for this method (and potentially one frame
  // up if it's a single step).
  // We also check the previous state of the method, if it was
  // "impossible_to_compile" we don't reset the flag.

  InstanceClass::Fast clazz;
  Method::Fast method, callerMethod;
  LocationModifier::Fast thisMod;

  Method::Fast m = mod->method();
  //  if (!m().has_compiled_code()) {
    // if method does not have compiled code then just return
  //    return;
  //  }
  if (m.is_null()) {
    // Method was removed.  Most likely it was a <clinit> method
    return;
  }
  VMEvent::Fast epm;
  VMEventStream es;
  bool found_one = false;
  while (!es.at_end()) {
    epm = es.next();
    if ((epm().event_kind() == JDWP_EventKind_BREAKPOINT ||
         epm().event_kind() == JDWP_EventKind_SINGLE_STEP) &&
        (ep == NULL || !epm.equals(ep))) {
      thisMod = get_modifier(&epm,
         JDWP_EventRequest_Set_Out_modifiers_Modifier_LocationOnly);
      if (thisMod.not_null()) {
        method = thisMod().method();
        if (method.equals(&m)) {
          // another breakpoint in this method, keep impossible_to_compile set
          found_one = true;
          break;
        }
      }
    }
  }
  if (!found_one) {
    // we must have looped through the whole list and not found another
    // breakpoint in this method so clear the impossible_to_compile flag
    if (mod->rom_debug_method() != NULL) {
      // This method is in ROM, let's check all method pointers on the java
      // stack to see if any of them point to this rom_debug_method.
      // We may be called as a result of JVM::cleanup(). Thread doesn't have
      // a stack in that case.
      Thread *thread = Thread::current();
      if (thread->last_java_fp() != NULL && thread->last_java_sp() != NULL) {
        Frame fr(Thread::current());
        while (true) {
          if (fr.is_entry_frame()) {
            EntryFrame e = fr.as_EntryFrame();
            if (e.is_first_frame()) {
              break;
            }
            e.caller_is(fr);
          } else if (fr.is_java_frame()) {
            JavaFrame jf = fr.as_JavaFrame();
            if (jf.method() == mod->rom_debug_method()) {
              MethodDesc *md = (MethodDesc *)mod->method();
              // fix up the stored bcp in this frame
              int bci = jf.bci_with_flags();
              jf.set_raw_method(md);
              Method::Raw m = jf.method();
              jf.set_raw_bcp((address)(bci + m().code_base()));
            }
            jf.caller_is(fr);
          }
        }
      }
    }
    // We also check the previous state of the method, if it was
    // "impossible_to_compile" we don't reset the flag.
    if (mod->compile_state() == true) {
      // Method was compilable so set entry to default
      m().set_default_entry(false);
    } else {
      if (ep->event_kind() == JDWP_EventKind_BREAKPOINT) {
        // May have been a special native method like String.charAt.
        // Just replace the entry with what we had saved earlier
        GUARANTEE(!ObjectHeap::contains((OopDesc*)mod->saved_method_entry()),
                  "ROM method entry is in heap");
        m().variable_part()->set_execution_entry(mod->saved_method_entry());
      }
    }
  }
}