src/share/vm/opto/connode.hpp

changeset 4159
8e47bac5643a
parent 4115
e626685e9f6c
child 4164
d804e148cff8
     1.1 --- a/src/share/vm/opto/connode.hpp	Mon Oct 08 17:04:00 2012 -0700
     1.2 +++ b/src/share/vm/opto/connode.hpp	Tue Oct 09 10:11:38 2012 +0200
     1.3 @@ -88,6 +88,14 @@
     1.4    virtual int Opcode() const;
     1.5  };
     1.6  
     1.7 +//------------------------------ConNKlassNode---------------------------------
     1.8 +// Simple narrow klass constants
     1.9 +class ConNKlassNode : public ConNode {
    1.10 +public:
    1.11 +  ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}
    1.12 +  virtual int Opcode() const;
    1.13 +};
    1.14 +
    1.15  
    1.16  //------------------------------ConLNode---------------------------------------
    1.17  // Simple long constants
    1.18 @@ -270,42 +278,91 @@
    1.19  };
    1.20  
    1.21  
    1.22 +//------------------------------EncodeNarrowPtr--------------------------------
    1.23 +class EncodeNarrowPtrNode : public TypeNode {
    1.24 + protected:
    1.25 +  EncodeNarrowPtrNode(Node* value, const Type* type):
    1.26 +    TypeNode(type, 2) {
    1.27 +    init_class_id(Class_EncodeNarrowPtr);
    1.28 +    init_req(0, NULL);
    1.29 +    init_req(1, value);
    1.30 +  }
    1.31 + public:
    1.32 +  virtual uint  ideal_reg() const { return Op_RegN; }
    1.33 +  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
    1.34 +};
    1.35 +
    1.36  //------------------------------EncodeP--------------------------------
    1.37  // Encodes an oop pointers into its compressed form
    1.38  // Takes an extra argument which is the real heap base as a long which
    1.39  // may be useful for code generation in the backend.
    1.40 -class EncodePNode : public TypeNode {
    1.41 +class EncodePNode : public EncodeNarrowPtrNode {
    1.42   public:
    1.43    EncodePNode(Node* value, const Type* type):
    1.44 -    TypeNode(type, 2) {
    1.45 +    EncodeNarrowPtrNode(value, type) {
    1.46      init_class_id(Class_EncodeP);
    1.47 -    init_req(0, NULL);
    1.48 -    init_req(1, value);
    1.49    }
    1.50    virtual int Opcode() const;
    1.51    virtual Node *Identity( PhaseTransform *phase );
    1.52    virtual const Type *Value( PhaseTransform *phase ) const;
    1.53 -  virtual uint  ideal_reg() const { return Op_RegN; }
    1.54 +};
    1.55  
    1.56 -  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
    1.57 +//------------------------------EncodePKlass--------------------------------
    1.58 +// Encodes a klass pointer into its compressed form
    1.59 +// Takes an extra argument which is the real heap base as a long which
    1.60 +// may be useful for code generation in the backend.
    1.61 +class EncodePKlassNode : public EncodeNarrowPtrNode {
    1.62 + public:
    1.63 +  EncodePKlassNode(Node* value, const Type* type):
    1.64 +    EncodeNarrowPtrNode(value, type) {
    1.65 +    init_class_id(Class_EncodePKlass);
    1.66 +  }
    1.67 +  virtual int Opcode() const;
    1.68 +  virtual Node *Identity( PhaseTransform *phase );
    1.69 +  virtual const Type *Value( PhaseTransform *phase ) const;
    1.70 +};
    1.71 +
    1.72 +//------------------------------DecodeNarrowPtr--------------------------------
    1.73 +class DecodeNarrowPtrNode : public TypeNode {
    1.74 + protected:
    1.75 +  DecodeNarrowPtrNode(Node* value, const Type* type):
    1.76 +    TypeNode(type, 2) {
    1.77 +    init_class_id(Class_DecodeNarrowPtr);
    1.78 +    init_req(0, NULL);
    1.79 +    init_req(1, value);
    1.80 +  }
    1.81 + public:
    1.82 +  virtual uint  ideal_reg() const { return Op_RegP; }
    1.83  };
    1.84  
    1.85  //------------------------------DecodeN--------------------------------
    1.86  // Converts a narrow oop into a real oop ptr.
    1.87  // Takes an extra argument which is the real heap base as a long which
    1.88  // may be useful for code generation in the backend.
    1.89 -class DecodeNNode : public TypeNode {
    1.90 +class DecodeNNode : public DecodeNarrowPtrNode {
    1.91   public:
    1.92    DecodeNNode(Node* value, const Type* type):
    1.93 -    TypeNode(type, 2) {
    1.94 +    DecodeNarrowPtrNode(value, type) {
    1.95      init_class_id(Class_DecodeN);
    1.96 -    init_req(0, NULL);
    1.97 -    init_req(1, value);
    1.98    }
    1.99    virtual int Opcode() const;
   1.100 +  virtual const Type *Value( PhaseTransform *phase ) const;
   1.101    virtual Node *Identity( PhaseTransform *phase );
   1.102 +};
   1.103 +
   1.104 +//------------------------------DecodeNKlass--------------------------------
   1.105 +// Converts a narrow klass pointer into a real klass ptr.
   1.106 +// Takes an extra argument which is the real heap base as a long which
   1.107 +// may be useful for code generation in the backend.
   1.108 +class DecodeNKlassNode : public DecodeNarrowPtrNode {
   1.109 + public:
   1.110 +  DecodeNKlassNode(Node* value, const Type* type):
   1.111 +    DecodeNarrowPtrNode(value, type) {
   1.112 +    init_class_id(Class_DecodeNKlass);
   1.113 +  }
   1.114 +  virtual int Opcode() const;
   1.115    virtual const Type *Value( PhaseTransform *phase ) const;
   1.116 -  virtual uint  ideal_reg() const { return Op_RegP; }
   1.117 +  virtual Node *Identity( PhaseTransform *phase );
   1.118  };
   1.119  
   1.120  //------------------------------Conv2BNode-------------------------------------

mercurial