< prev index next >

src/share/vm/ci/ciMetadata.hpp

Print this page




  43   Metadata* _metadata;
  44 
  45   ciMetadata(): _metadata(NULL) {}
  46   ciMetadata(Metadata* o): _metadata(o) {}
  47 
  48   virtual bool is_classless() const         { return false; }
  49  public:
  50   bool is_loaded() const { return _metadata != NULL || is_classless(); }
  51 
  52   virtual bool is_metadata() const          { return true; }
  53 
  54   virtual bool is_type() const              { return false; }
  55   virtual bool is_cpcache() const           { return false; }
  56   virtual bool is_return_address() const    { return false; }
  57   virtual bool is_method() const            { return false; }
  58   virtual bool is_method_data() const       { return false; }
  59   virtual bool is_klass() const             { return false; }
  60   virtual bool is_instance_klass() const    { return false; }
  61   virtual bool is_valuetype() const         { return false; }
  62   virtual bool is_array_klass() const       { return false; }

  63   virtual bool is_obj_array_klass() const   { return false; }
  64   virtual bool is_type_array_klass() const  { return false; }
  65   virtual void dump_replay_data(outputStream* st) { /* do nothing */ }
  66 
  67   ciMethod*                as_method() {
  68     assert(is_method(), "bad cast");
  69     return (ciMethod*)this;
  70   }
  71   ciMethodData*            as_method_data() {
  72     assert(is_method_data(), "bad cast");
  73     return (ciMethodData*)this;
  74   }
  75   ciSymbol*                as_symbol() {
  76     assert(is_symbol(), "bad cast");
  77     return (ciSymbol*)this;
  78   }
  79   ciType*                  as_type() {
  80     assert(is_type(), "bad cast");
  81     return (ciType*)this;
  82   }
  83   ciReturnAddress*         as_return_address() {
  84     assert(is_return_address(), "bad cast");
  85     return (ciReturnAddress*)this;
  86   }
  87   ciKlass*                 as_klass() {
  88     assert(is_klass(), "bad cast");
  89     return (ciKlass*)this;
  90   }
  91   ciInstanceKlass*         as_instance_klass() {
  92     assert(is_instance_klass(), "bad cast");
  93     return (ciInstanceKlass*)this;
  94   }
  95   ciArrayKlass*            as_array_klass() {
  96     assert(is_array_klass(), "bad cast");
  97     return (ciArrayKlass*)this;




  98   }
  99   ciObjArrayKlass*         as_obj_array_klass() {
 100     assert(is_obj_array_klass(), "bad cast");
 101     return (ciObjArrayKlass*)this;
 102   }
 103   ciTypeArrayKlass*        as_type_array_klass() {
 104     assert(is_type_array_klass(), "bad cast");
 105     return (ciTypeArrayKlass*)this;
 106   }
 107   ciValueKlass*            as_value_klass() {
 108     assert(is_valuetype(), "bad cast");
 109     return (ciValueKlass*)this;
 110   }
 111 
 112   Metadata* constant_encoding() { return _metadata; }
 113 
 114   bool equals(ciMetadata* obj) const { return (this == obj); }
 115 
 116   int hash() { return ident() * 31; } // ???
 117 


  43   Metadata* _metadata;
  44 
  45   ciMetadata(): _metadata(NULL) {}
  46   ciMetadata(Metadata* o): _metadata(o) {}
  47 
  48   virtual bool is_classless() const         { return false; }
  49  public:
  50   bool is_loaded() const { return _metadata != NULL || is_classless(); }
  51 
  52   virtual bool is_metadata() const          { return true; }
  53 
  54   virtual bool is_type() const              { return false; }
  55   virtual bool is_cpcache() const           { return false; }
  56   virtual bool is_return_address() const    { return false; }
  57   virtual bool is_method() const            { return false; }
  58   virtual bool is_method_data() const       { return false; }
  59   virtual bool is_klass() const             { return false; }
  60   virtual bool is_instance_klass() const    { return false; }
  61   virtual bool is_valuetype() const         { return false; }
  62   virtual bool is_array_klass() const       { return false; }
  63   virtual bool is_value_array_klass() const { return false; }
  64   virtual bool is_obj_array_klass() const   { return false; }
  65   virtual bool is_type_array_klass() const  { return false; }
  66   virtual void dump_replay_data(outputStream* st) { /* do nothing */ }
  67 
  68   ciMethod*                as_method() {
  69     assert(is_method(), "bad cast");
  70     return (ciMethod*)this;
  71   }
  72   ciMethodData*            as_method_data() {
  73     assert(is_method_data(), "bad cast");
  74     return (ciMethodData*)this;
  75   }
  76   ciSymbol*                as_symbol() {
  77     assert(is_symbol(), "bad cast");
  78     return (ciSymbol*)this;
  79   }
  80   ciType*                  as_type() {
  81     assert(is_type(), "bad cast");
  82     return (ciType*)this;
  83   }
  84   ciReturnAddress*         as_return_address() {
  85     assert(is_return_address(), "bad cast");
  86     return (ciReturnAddress*)this;
  87   }
  88   ciKlass*                 as_klass() {
  89     assert(is_klass(), "bad cast");
  90     return (ciKlass*)this;
  91   }
  92   ciInstanceKlass*         as_instance_klass() {
  93     assert(is_instance_klass(), "bad cast");
  94     return (ciInstanceKlass*)this;
  95   }
  96   ciArrayKlass*            as_array_klass() {
  97     assert(is_array_klass(), "bad cast");
  98     return (ciArrayKlass*)this;
  99   }
 100   ciValueArrayKlass*       as_value_array_klass() {
 101     assert(is_value_array_klass(), "bad cast");
 102     return (ciValueArrayKlass*)this;
 103   }
 104   ciObjArrayKlass*         as_obj_array_klass() {
 105     assert(is_obj_array_klass(), "bad cast");
 106     return (ciObjArrayKlass*)this;
 107   }
 108   ciTypeArrayKlass*        as_type_array_klass() {
 109     assert(is_type_array_klass(), "bad cast");
 110     return (ciTypeArrayKlass*)this;
 111   }
 112   ciValueKlass*            as_value_klass() {
 113     assert(is_valuetype(), "bad cast");
 114     return (ciValueKlass*)this;
 115   }
 116 
 117   Metadata* constant_encoding() { return _metadata; }
 118 
 119   bool equals(ciMetadata* obj) const { return (this == obj); }
 120 
 121   int hash() { return ident() * 31; } // ???
 122 
< prev index next >