< prev index next >

src/share/vm/opto/type.hpp

Print this page
rev 10504 : value type calling convention


 632 
 633 public:
 634   virtual bool eq( const Type *t ) const;
 635   virtual int  hash() const;             // Type specific hashing
 636   virtual bool singleton(void) const;    // TRUE if type is a singleton
 637   virtual bool empty(void) const;        // TRUE if type is vacuous
 638 
 639   // Accessors:
 640   uint cnt() const { return _cnt; }
 641   const Type* field_at(uint i) const {
 642     assert(i < _cnt, "oob");
 643     return _fields[i];
 644   }
 645   void set_field_at(uint i, const Type* t) {
 646     assert(i < _cnt, "oob");
 647     _fields[i] = t;
 648   }
 649 
 650   static const TypeTuple *make( uint cnt, const Type **fields );
 651   static const TypeTuple *make_range(ciSignature *sig);
 652   static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig);
 653 
 654   // Subroutine call type with space allocated for argument types
 655   // Memory for Control, I_O, Memory, FramePtr, and ReturnAdr is allocated implicitly
 656   static const Type **fields( uint arg_cnt );
 657 
 658   virtual const Type *xmeet( const Type *t ) const;
 659   virtual const Type *xdual() const;    // Compute dual right now.
 660   // Convenience common pre-built types.
 661   static const TypeTuple *IFBOTH;
 662   static const TypeTuple *IFFALSE;
 663   static const TypeTuple *IFTRUE;
 664   static const TypeTuple *IFNEITHER;
 665   static const TypeTuple *LOOPBODY;
 666   static const TypeTuple *MEMBAR;
 667   static const TypeTuple *STORECONDITIONAL;
 668   static const TypeTuple *START_I2C;
 669   static const TypeTuple *INT_PAIR;
 670   static const TypeTuple *LONG_PAIR;
 671   static const TypeTuple *INT_CC_PAIR;
 672   static const TypeTuple *LONG_CC_PAIR;


1510   }
1511 
1512   virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
1513     return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons());
1514   }
1515 
1516 public:
1517   static const TypeNarrowKlass *make( const TypePtr* type);
1518 
1519   // static const TypeNarrowKlass *BOTTOM;
1520   static const TypeNarrowKlass *NULL_PTR;
1521 
1522 #ifndef PRODUCT
1523   virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
1524 #endif
1525 };
1526 
1527 //------------------------------TypeFunc---------------------------------------
1528 // Class of Array Types
1529 class TypeFunc : public Type {
1530   TypeFunc( const TypeTuple *domain, const TypeTuple *range ) : Type(Function),  _domain(domain), _range(range) {}
1531   virtual bool eq( const Type *t ) const;
1532   virtual int  hash() const;             // Type specific hashing
1533   virtual bool singleton(void) const;    // TRUE if type is a singleton
1534   virtual bool empty(void) const;        // TRUE if type is vacuous
1535 
1536   const TypeTuple* const _domain;     // Domain of inputs

1537   const TypeTuple* const _range;      // Range of results
1538 
1539 public:
1540   // Constants are shared among ADLC and VM
1541   enum { Control    = AdlcVMDeps::Control,
1542          I_O        = AdlcVMDeps::I_O,
1543          Memory     = AdlcVMDeps::Memory,
1544          FramePtr   = AdlcVMDeps::FramePtr,
1545          ReturnAdr  = AdlcVMDeps::ReturnAdr,
1546          Parms      = AdlcVMDeps::Parms
1547   };
1548 
1549 
1550   // Accessors:
1551   const TypeTuple* domain() const { return _domain; }

1552   const TypeTuple* range()  const { return _range; }
1553 
1554   static const TypeFunc *make(ciMethod* method);
1555   static const TypeFunc *make(ciSignature signature, const Type* extra);
1556   static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range);
1557 
1558   virtual const Type *xmeet( const Type *t ) const;
1559   virtual const Type *xdual() const;    // Compute dual right now.
1560 
1561   BasicType return_type() const;
1562 
1563 #ifndef PRODUCT
1564   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1565 #endif
1566   // Convenience common pre-built types.
1567 };
1568 
1569 //------------------------------accessors--------------------------------------
1570 inline bool Type::is_ptr_to_narrowoop() const {
1571 #ifdef _LP64
1572   return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv());
1573 #else
1574   return false;
1575 #endif
1576 }




 632 
 633 public:
 634   virtual bool eq( const Type *t ) const;
 635   virtual int  hash() const;             // Type specific hashing
 636   virtual bool singleton(void) const;    // TRUE if type is a singleton
 637   virtual bool empty(void) const;        // TRUE if type is vacuous
 638 
 639   // Accessors:
 640   uint cnt() const { return _cnt; }
 641   const Type* field_at(uint i) const {
 642     assert(i < _cnt, "oob");
 643     return _fields[i];
 644   }
 645   void set_field_at(uint i, const Type* t) {
 646     assert(i < _cnt, "oob");
 647     _fields[i] = t;
 648   }
 649 
 650   static const TypeTuple *make( uint cnt, const Type **fields );
 651   static const TypeTuple *make_range(ciSignature *sig);
 652   static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig, bool is_cc = false);
 653 
 654   // Subroutine call type with space allocated for argument types
 655   // Memory for Control, I_O, Memory, FramePtr, and ReturnAdr is allocated implicitly
 656   static const Type **fields( uint arg_cnt );
 657 
 658   virtual const Type *xmeet( const Type *t ) const;
 659   virtual const Type *xdual() const;    // Compute dual right now.
 660   // Convenience common pre-built types.
 661   static const TypeTuple *IFBOTH;
 662   static const TypeTuple *IFFALSE;
 663   static const TypeTuple *IFTRUE;
 664   static const TypeTuple *IFNEITHER;
 665   static const TypeTuple *LOOPBODY;
 666   static const TypeTuple *MEMBAR;
 667   static const TypeTuple *STORECONDITIONAL;
 668   static const TypeTuple *START_I2C;
 669   static const TypeTuple *INT_PAIR;
 670   static const TypeTuple *LONG_PAIR;
 671   static const TypeTuple *INT_CC_PAIR;
 672   static const TypeTuple *LONG_CC_PAIR;


1510   }
1511 
1512   virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
1513     return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons());
1514   }
1515 
1516 public:
1517   static const TypeNarrowKlass *make( const TypePtr* type);
1518 
1519   // static const TypeNarrowKlass *BOTTOM;
1520   static const TypeNarrowKlass *NULL_PTR;
1521 
1522 #ifndef PRODUCT
1523   virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
1524 #endif
1525 };
1526 
1527 //------------------------------TypeFunc---------------------------------------
1528 // Class of Array Types
1529 class TypeFunc : public Type {
1530   TypeFunc(const TypeTuple *domain_sig, const TypeTuple *domain_cc, const TypeTuple *range) : Type(Function), _domain_sig(domain_sig), _domain_cc(domain_cc), _range(range) {}
1531   virtual bool eq( const Type *t ) const;
1532   virtual int  hash() const;             // Type specific hashing
1533   virtual bool singleton(void) const;    // TRUE if type is a singleton
1534   virtual bool empty(void) const;        // TRUE if type is vacuous
1535 
1536   const TypeTuple* const _domain_sig;     // Domain of inputs
1537   const TypeTuple* const _domain_cc;  // Domain of inputs
1538   const TypeTuple* const _range;      // Range of results
1539 
1540 public:
1541   // Constants are shared among ADLC and VM
1542   enum { Control    = AdlcVMDeps::Control,
1543          I_O        = AdlcVMDeps::I_O,
1544          Memory     = AdlcVMDeps::Memory,
1545          FramePtr   = AdlcVMDeps::FramePtr,
1546          ReturnAdr  = AdlcVMDeps::ReturnAdr,
1547          Parms      = AdlcVMDeps::Parms
1548   };
1549 
1550 
1551   // Accessors:
1552   const TypeTuple* domain_sig() const { return _domain_sig; }
1553   const TypeTuple* domain_cc() const { return _domain_cc; }
1554   const TypeTuple* range()  const { return _range; }
1555 
1556   static const TypeFunc *make(ciMethod* method);
1557   static const TypeFunc *make(ciSignature signature, const Type* extra);
1558   static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* domain_cc, const TypeTuple* range);
1559 
1560   virtual const Type *xmeet( const Type *t ) const;
1561   virtual const Type *xdual() const;    // Compute dual right now.
1562 
1563   BasicType return_type() const;
1564 
1565 #ifndef PRODUCT
1566   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1567 #endif
1568   // Convenience common pre-built types.
1569 };
1570 
1571 //------------------------------accessors--------------------------------------
1572 inline bool Type::is_ptr_to_narrowoop() const {
1573 #ifdef _LP64
1574   return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv());
1575 #else
1576   return false;
1577 #endif
1578 }


< prev index next >