Exemplo n.º 1
0
void
ClassObjectReferenceImpl::class_object_reflected_type(PacketInputStream *in, 
                     PacketOutputStream *out)
{
  UsingFastOops fast_oops;

  JavaClassObj::Fast mirror = in->read_object();
  JavaClass::Fast ref_class;

#ifdef AZZERT
  if (TraceDebugger) {
    tty->print_cr("Class Object Reflected Type: ObjectID=%ld, Object=0x%lx", 
                   JavaDebugger::get_object_id_by_ref_nocreate(&mirror), 
                   mirror.obj());
  }
#endif 
  if (mirror.not_null()) {
    ref_class = mirror().java_class();
    out->write_byte(JavaDebugger::get_jdwp_tagtype(&ref_class));
    out->write_class(&ref_class);
#ifdef AZZERT
    if (TraceDebugger) { 
      tty->print_cr("    Type is 0x%x ID = %ld", ref_class.obj(),
                    JavaDebugger::get_object_id_by_ref_nocreate(&ref_class));
    }
#endif
  } else {
    out->set_error(JDWP_Error_INVALID_OBJECT);
  }
  out->send_packet();
}
Exemplo n.º 2
0
//
// Object operations
//
KNIEXPORT void KNI_GetObjectClass(jobject objectHandle, jclass classHandle) {
  OopDesc* object = kni_read_handle(objectHandle);
  SETUP_ERROR_CHECKER_ARG;

  if (object == 0) {
    kni_clear_handle(classHandle);
  } else {
    UsingFastOops fast_oops;
    JavaClass::Fast blueprint = (OopDesc*)object->blueprint();
    JavaClassObj::Fast m = blueprint().get_or_allocate_java_mirror(JVM_SINGLE_ARG_NO_CHECK);
    kni_set_handle(classHandle, m.obj());
  }
}