< prev index next >

src/share/vm/oops/metadata.hpp

Print this page
rev 10015 : 8148470: Metadata print routines should not print to tty


  41 
  42   // Rehashing support for tables containing pointers to this
  43   unsigned int new_hash(juint seed)   { ShouldNotReachHere();  return 0; }
  44 
  45   virtual bool is_metadata()           const volatile { return true; }
  46   virtual bool is_klass()              const volatile { return false; }
  47   virtual bool is_method()             const volatile { return false; }
  48   virtual bool is_methodData()         const volatile { return false; }
  49   virtual bool is_constantPool()       const volatile { return false; }
  50 
  51   virtual const char* internal_name()  const = 0;
  52 
  53   void print()       const { print_on(tty); }
  54   void print_value() const { print_value_on(tty); }
  55 
  56   void print_maybe_null() const { print_on_maybe_null(tty); }
  57   void print_on_maybe_null(outputStream* st) const {
  58     if (this == NULL)
  59       st->print("NULL");
  60     else
  61       print_on(tty);
  62   }
  63   void print_value_on_maybe_null(outputStream* st) const {
  64     if (this == NULL)
  65       st->print("NULL");
  66     else
  67       print_value_on(tty);
  68   }
  69 
  70   virtual void print_on(outputStream* st) const;       // First level print
  71   virtual void print_value_on(outputStream* st) const = 0; // Second level print
  72 
  73   char* print_value_string() const;
  74 
  75   // Used to keep metadata alive during class redefinition
  76   // Can't assert because is called for delete functions (as an assert)
  77   virtual bool on_stack() const { return false; }
  78   virtual void set_on_stack(const bool value);
  79 
  80   // Set on_stack bit, so that the metadata is not cleared
  81   // during class redefinition.  This is a virtual call because only methods
  82   // and constant pools need to be set, but someday instanceKlasses might also.
  83   static void mark_on_stack(Metadata* m) { m->set_on_stack(true); }
  84 };
  85 
  86 #endif // SHARE_VM_OOPS_METADATA_HPP


  41 
  42   // Rehashing support for tables containing pointers to this
  43   unsigned int new_hash(juint seed)   { ShouldNotReachHere();  return 0; }
  44 
  45   virtual bool is_metadata()           const volatile { return true; }
  46   virtual bool is_klass()              const volatile { return false; }
  47   virtual bool is_method()             const volatile { return false; }
  48   virtual bool is_methodData()         const volatile { return false; }
  49   virtual bool is_constantPool()       const volatile { return false; }
  50 
  51   virtual const char* internal_name()  const = 0;
  52 
  53   void print()       const { print_on(tty); }
  54   void print_value() const { print_value_on(tty); }
  55 
  56   void print_maybe_null() const { print_on_maybe_null(tty); }
  57   void print_on_maybe_null(outputStream* st) const {
  58     if (this == NULL)
  59       st->print("NULL");
  60     else
  61       print_on(st);
  62   }
  63   void print_value_on_maybe_null(outputStream* st) const {
  64     if (this == NULL)
  65       st->print("NULL");
  66     else
  67       print_value_on(st);
  68   }
  69 
  70   virtual void print_on(outputStream* st) const;       // First level print
  71   virtual void print_value_on(outputStream* st) const = 0; // Second level print
  72 
  73   char* print_value_string() const;
  74 
  75   // Used to keep metadata alive during class redefinition
  76   // Can't assert because is called for delete functions (as an assert)
  77   virtual bool on_stack() const { return false; }
  78   virtual void set_on_stack(const bool value);
  79 
  80   // Set on_stack bit, so that the metadata is not cleared
  81   // during class redefinition.  This is a virtual call because only methods
  82   // and constant pools need to be set, but someday instanceKlasses might also.
  83   static void mark_on_stack(Metadata* m) { m->set_on_stack(true); }
  84 };
  85 
  86 #endif // SHARE_VM_OOPS_METADATA_HPP
< prev index next >