Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146947

Remove PrintOopAddress rather than converting to UL

XMLWordPrintable

    • b115


      The PrintOopAddress code guards printing the address of an oop in printing code. When moving metadata out of permgen, we made print_address_on() not conditional on the PrintOopAddress flag. So the only thing left is printing the address of the oop in various places. So this shouldn't be a flag, I think it should be default.

      Except this function in objArrayOop:

      void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
        assert(obj->is_objArray(), "must be objArray");
        st->print("a ");
        element_klass()->print_value_on(st);
        int len = objArrayOop(obj)->length();
        st->print("[%d] ", len);
        obj->print_address_on(st);
        if (NOT_PRODUCT(PrintOopAddress ||) PrintMiscellaneous && (WizardMode || Verbose)) {
          st->print("{");
          for (int i = 0; i < len; i++) {
            if (i > max_objArray_print_length) {
              st->print("..."); break;
            }
            st->print(" " INTPTR_FORMAT, (intptr_t)(void*)objArrayOop(obj)->obj_at(i));
          }
          st->print(" }");
        }
      }

      philli% grep -r max_objArray_print_length
      share/vm/oops/objArrayKlass.cpp:static int max_objArray_print_length = 4;
      share/vm/oops/objArrayKlass.cpp: if (i > max_objArray_print_length) {

      It's got all the unregulated printing flags. I think this should just be removed. Once you have the ObjArrayOop address, you can get the elements because presumably you're in the debugger.

            rprotacio Rachel Protacio (Inactive)
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: