Mercurial > hg > graal-compiler
diff src/share/vm/opto/connode.hpp @ 6848:8e47bac5643a
7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Tue, 09 Oct 2012 10:11:38 +0200 |
parents | e626685e9f6c |
children | d804e148cff8 |
line wrap: on
line diff
--- a/src/share/vm/opto/connode.hpp Mon Oct 08 17:04:00 2012 -0700 +++ b/src/share/vm/opto/connode.hpp Tue Oct 09 10:11:38 2012 +0200 @@ -88,6 +88,14 @@ virtual int Opcode() const; }; +//------------------------------ConNKlassNode--------------------------------- +// Simple narrow klass constants +class ConNKlassNode : public ConNode { +public: + ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {} + virtual int Opcode() const; +}; + //------------------------------ConLNode--------------------------------------- // Simple long constants @@ -270,42 +278,91 @@ }; +//------------------------------EncodeNarrowPtr-------------------------------- +class EncodeNarrowPtrNode : public TypeNode { + protected: + EncodeNarrowPtrNode(Node* value, const Type* type): + TypeNode(type, 2) { + init_class_id(Class_EncodeNarrowPtr); + init_req(0, NULL); + init_req(1, value); + } + public: + virtual uint ideal_reg() const { return Op_RegN; } + virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); +}; + //------------------------------EncodeP-------------------------------- // Encodes an oop pointers into its compressed form // Takes an extra argument which is the real heap base as a long which // may be useful for code generation in the backend. -class EncodePNode : public TypeNode { +class EncodePNode : public EncodeNarrowPtrNode { public: EncodePNode(Node* value, const Type* type): - TypeNode(type, 2) { + EncodeNarrowPtrNode(value, type) { init_class_id(Class_EncodeP); - init_req(0, NULL); - init_req(1, value); } virtual int Opcode() const; virtual Node *Identity( PhaseTransform *phase ); virtual const Type *Value( PhaseTransform *phase ) const; - virtual uint ideal_reg() const { return Op_RegN; } +}; - virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); +//------------------------------EncodePKlass-------------------------------- +// Encodes a klass pointer into its compressed form +// Takes an extra argument which is the real heap base as a long which +// may be useful for code generation in the backend. +class EncodePKlassNode : public EncodeNarrowPtrNode { + public: + EncodePKlassNode(Node* value, const Type* type): + EncodeNarrowPtrNode(value, type) { + init_class_id(Class_EncodePKlass); + } + virtual int Opcode() const; + virtual Node *Identity( PhaseTransform *phase ); + virtual const Type *Value( PhaseTransform *phase ) const; +}; + +//------------------------------DecodeNarrowPtr-------------------------------- +class DecodeNarrowPtrNode : public TypeNode { + protected: + DecodeNarrowPtrNode(Node* value, const Type* type): + TypeNode(type, 2) { + init_class_id(Class_DecodeNarrowPtr); + init_req(0, NULL); + init_req(1, value); + } + public: + virtual uint ideal_reg() const { return Op_RegP; } }; //------------------------------DecodeN-------------------------------- // Converts a narrow oop into a real oop ptr. // Takes an extra argument which is the real heap base as a long which // may be useful for code generation in the backend. -class DecodeNNode : public TypeNode { +class DecodeNNode : public DecodeNarrowPtrNode { public: DecodeNNode(Node* value, const Type* type): - TypeNode(type, 2) { + DecodeNarrowPtrNode(value, type) { init_class_id(Class_DecodeN); - init_req(0, NULL); - init_req(1, value); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); virtual const Type *Value( PhaseTransform *phase ) const; - virtual uint ideal_reg() const { return Op_RegP; } + virtual Node *Identity( PhaseTransform *phase ); +}; + +//------------------------------DecodeNKlass-------------------------------- +// Converts a narrow klass pointer into a real klass ptr. +// Takes an extra argument which is the real heap base as a long which +// may be useful for code generation in the backend. +class DecodeNKlassNode : public DecodeNarrowPtrNode { + public: + DecodeNKlassNode(Node* value, const Type* type): + DecodeNarrowPtrNode(value, type) { + init_class_id(Class_DecodeNKlass); + } + virtual int Opcode() const; + virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node *Identity( PhaseTransform *phase ); }; //------------------------------Conv2BNode-------------------------------------