src/share/vm/c1/c1_ValueType.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/c1

src/share/vm/c1/c1_ValueType.hpp

Print this page




  28 #include "c1/c1_Compilation.hpp"
  29 #include "ci/ciConstant.hpp"
  30 #include "ci/ciMethodData.hpp"
  31 
  32 // type hierarchy
  33 class ValueType;
  34 class   VoidType;
  35 class   IntType;
  36 class     IntConstant;
  37 class     IntInterval;
  38 class   LongType;
  39 class     LongConstant;
  40 class   FloatType;
  41 class     FloatConstant;
  42 class   DoubleType;
  43 class     DoubleConstant;
  44 class   ObjectType;
  45 class     ObjectConstant;
  46 class     ArrayType;
  47 class       ArrayConstant;

  48 class     InstanceType;
  49 class       InstanceConstant;
  50 class   MetadataType;
  51 class     ClassType;
  52 class       ClassConstant;
  53 class     MethodType;
  54 class       MethodConstant;
  55 class     MethodDataType;
  56 class       MethodDataConstant;
  57 class   AddressType;
  58 class     AddressConstant;
  59 class   IllegalType;
  60 
  61 
  62 // predefined types
  63 extern VoidType*       voidType;
  64 extern IntType*        intType;
  65 extern LongType*       longType;
  66 extern FloatType*      floatType;
  67 extern DoubleType*     doubleType;


 151   virtual ObjectType*       as_ObjectType()      { return NULL; }
 152   virtual ArrayType*        as_ArrayType()       { return NULL; }
 153   virtual InstanceType*     as_InstanceType()    { return NULL; }
 154   virtual ClassType*        as_ClassType()       { return NULL; }
 155   virtual MetadataType*     as_MetadataType()    { return NULL; }
 156   virtual MethodType*       as_MethodType()      { return NULL; }
 157   virtual MethodDataType*   as_MethodDataType()  { return NULL; }
 158   virtual AddressType*      as_AddressType()     { return NULL; }
 159   virtual IllegalType*      as_IllegalType()     { return NULL; }
 160 
 161   virtual IntConstant*      as_IntConstant()     { return NULL; }
 162   virtual LongConstant*     as_LongConstant()    { return NULL; }
 163   virtual FloatConstant*    as_FloatConstant()   { return NULL; }
 164   virtual DoubleConstant*   as_DoubleConstant()  { return NULL; }
 165   virtual ObjectConstant*   as_ObjectConstant()  { return NULL; }
 166   virtual InstanceConstant* as_InstanceConstant(){ return NULL; }
 167   virtual ClassConstant*    as_ClassConstant()   { return NULL; }
 168   virtual MethodConstant*   as_MethodConstant()  { return NULL; }
 169   virtual MethodDataConstant* as_MethodDataConstant() { return NULL; }
 170   virtual ArrayConstant*    as_ArrayConstant()   { return NULL; }

 171   virtual AddressConstant*  as_AddressConstant() { return NULL; }
 172 
 173   // type operations
 174   ValueType* meet(ValueType* y) const;
 175   ValueType* join(ValueType* y) const;
 176 
 177   // debugging
 178   void print(outputStream* s = tty)              { s->print("%s", name()); }
 179 };
 180 
 181 
 182 class VoidType: public ValueType {
 183  public:
 184   VoidType(): ValueType(voidTag, 0) {}
 185   virtual ValueType* base() const                { return voidType; }
 186   virtual const char tchar() const               { return 'v'; }
 187   virtual const char* name() const               { return "void"; }
 188   virtual VoidType* as_VoidType()                { return this; }
 189 };
 190 


 338  public:
 339   virtual ArrayType* as_ArrayType()              { return this; }
 340 };
 341 
 342 
 343 class ArrayConstant: public ArrayType {
 344  private:
 345   ciArray* _value;
 346 
 347  public:
 348   ArrayConstant(ciArray* value)                  { _value = value; }
 349 
 350   ciArray* value() const                         { return _value; }
 351 
 352   virtual bool is_constant() const               { return true; }
 353   virtual ArrayConstant* as_ArrayConstant()      { return this; }
 354   virtual ciObject* constant_value() const;
 355   virtual ciType* exact_type() const;
 356 };
 357 














 358 
 359 class InstanceType: public ObjectType {
 360  public:
 361   virtual InstanceType* as_InstanceType()        { return this; }
 362 };
 363 
 364 
 365 class InstanceConstant: public InstanceType {
 366  private:
 367   ciInstance* _value;
 368 
 369  public:
 370   InstanceConstant(ciInstance* value)            { _value = value; }
 371 
 372   ciInstance* value() const                      { return _value; }
 373 
 374   virtual bool is_constant() const               { return true; }
 375   virtual InstanceConstant* as_InstanceConstant(){ return this; }
 376   virtual ciObject* constant_value() const;
 377   virtual ciType* exact_type() const;




  28 #include "c1/c1_Compilation.hpp"
  29 #include "ci/ciConstant.hpp"
  30 #include "ci/ciMethodData.hpp"
  31 
  32 // type hierarchy
  33 class ValueType;
  34 class   VoidType;
  35 class   IntType;
  36 class     IntConstant;
  37 class     IntInterval;
  38 class   LongType;
  39 class     LongConstant;
  40 class   FloatType;
  41 class     FloatConstant;
  42 class   DoubleType;
  43 class     DoubleConstant;
  44 class   ObjectType;
  45 class     ObjectConstant;
  46 class     ArrayType;
  47 class       ArrayConstant;
  48 class         StableArrayConstant;
  49 class     InstanceType;
  50 class       InstanceConstant;
  51 class   MetadataType;
  52 class     ClassType;
  53 class       ClassConstant;
  54 class     MethodType;
  55 class       MethodConstant;
  56 class     MethodDataType;
  57 class       MethodDataConstant;
  58 class   AddressType;
  59 class     AddressConstant;
  60 class   IllegalType;
  61 
  62 
  63 // predefined types
  64 extern VoidType*       voidType;
  65 extern IntType*        intType;
  66 extern LongType*       longType;
  67 extern FloatType*      floatType;
  68 extern DoubleType*     doubleType;


 152   virtual ObjectType*       as_ObjectType()      { return NULL; }
 153   virtual ArrayType*        as_ArrayType()       { return NULL; }
 154   virtual InstanceType*     as_InstanceType()    { return NULL; }
 155   virtual ClassType*        as_ClassType()       { return NULL; }
 156   virtual MetadataType*     as_MetadataType()    { return NULL; }
 157   virtual MethodType*       as_MethodType()      { return NULL; }
 158   virtual MethodDataType*   as_MethodDataType()  { return NULL; }
 159   virtual AddressType*      as_AddressType()     { return NULL; }
 160   virtual IllegalType*      as_IllegalType()     { return NULL; }
 161 
 162   virtual IntConstant*      as_IntConstant()     { return NULL; }
 163   virtual LongConstant*     as_LongConstant()    { return NULL; }
 164   virtual FloatConstant*    as_FloatConstant()   { return NULL; }
 165   virtual DoubleConstant*   as_DoubleConstant()  { return NULL; }
 166   virtual ObjectConstant*   as_ObjectConstant()  { return NULL; }
 167   virtual InstanceConstant* as_InstanceConstant(){ return NULL; }
 168   virtual ClassConstant*    as_ClassConstant()   { return NULL; }
 169   virtual MethodConstant*   as_MethodConstant()  { return NULL; }
 170   virtual MethodDataConstant* as_MethodDataConstant() { return NULL; }
 171   virtual ArrayConstant*    as_ArrayConstant()   { return NULL; }
 172   virtual StableArrayConstant* as_StableArrayConstant()   { return NULL; }
 173   virtual AddressConstant*  as_AddressConstant() { return NULL; }
 174 
 175   // type operations
 176   ValueType* meet(ValueType* y) const;
 177   ValueType* join(ValueType* y) const;
 178 
 179   // debugging
 180   void print(outputStream* s = tty)              { s->print("%s", name()); }
 181 };
 182 
 183 
 184 class VoidType: public ValueType {
 185  public:
 186   VoidType(): ValueType(voidTag, 0) {}
 187   virtual ValueType* base() const                { return voidType; }
 188   virtual const char tchar() const               { return 'v'; }
 189   virtual const char* name() const               { return "void"; }
 190   virtual VoidType* as_VoidType()                { return this; }
 191 };
 192 


 340  public:
 341   virtual ArrayType* as_ArrayType()              { return this; }
 342 };
 343 
 344 
 345 class ArrayConstant: public ArrayType {
 346  private:
 347   ciArray* _value;
 348 
 349  public:
 350   ArrayConstant(ciArray* value)                  { _value = value; }
 351 
 352   ciArray* value() const                         { return _value; }
 353 
 354   virtual bool is_constant() const               { return true; }
 355   virtual ArrayConstant* as_ArrayConstant()      { return this; }
 356   virtual ciObject* constant_value() const;
 357   virtual ciType* exact_type() const;
 358 };
 359 
 360 class StableArrayConstant: public ArrayConstant {
 361  private:
 362   jint _dimension;
 363 
 364  public:
 365   StableArrayConstant(ciArray* value, jint dimension) : ArrayConstant(value) {
 366     assert(dimension > 0, "not a stable array");
 367     _dimension = dimension;
 368   }
 369 
 370   jint dimension() const                              { return _dimension; }
 371 
 372   virtual StableArrayConstant* as_StableArrayConstant() { return this; }
 373 };
 374 
 375 class InstanceType: public ObjectType {
 376  public:
 377   virtual InstanceType* as_InstanceType()        { return this; }
 378 };
 379 
 380 
 381 class InstanceConstant: public InstanceType {
 382  private:
 383   ciInstance* _value;
 384 
 385  public:
 386   InstanceConstant(ciInstance* value)            { _value = value; }
 387 
 388   ciInstance* value() const                      { return _value; }
 389 
 390   virtual bool is_constant() const               { return true; }
 391   virtual InstanceConstant* as_InstanceConstant(){ return this; }
 392   virtual ciObject* constant_value() const;
 393   virtual ciType* exact_type() const;


src/share/vm/c1/c1_ValueType.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File