< prev index next >

src/share/vm/opto/type.hpp

Print this page
rev 10512 : 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;


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







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

1557   const TypeTuple* range()  const { return _range; }
1558 
1559   static const TypeFunc *make(ciMethod* method);
1560   static const TypeFunc *make(ciSignature signature, const Type* extra);

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




 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 vt_fields_as_args = 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;


1515   }
1516 
1517   virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
1518     return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons());
1519   }
1520 
1521 public:
1522   static const TypeNarrowKlass *make( const TypePtr* type);
1523 
1524   // static const TypeNarrowKlass *BOTTOM;
1525   static const TypeNarrowKlass *NULL_PTR;
1526 
1527 #ifndef PRODUCT
1528   virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
1529 #endif
1530 };
1531 
1532 //------------------------------TypeFunc---------------------------------------
1533 // Class of Array Types
1534 class TypeFunc : public Type {
1535   TypeFunc(const TypeTuple *domain_sig, const TypeTuple *domain_cc, const TypeTuple *range) : Type(Function), _domain_sig(domain_sig), _domain_cc(domain_cc), _range(range) {}
1536   virtual bool eq( const Type *t ) const;
1537   virtual int  hash() const;             // Type specific hashing
1538   virtual bool singleton(void) const;    // TRUE if type is a singleton
1539   virtual bool empty(void) const;        // TRUE if type is vacuous
1540 
1541   // Domains of inputs: value type arguments are not passed by
1542   // reference, instead each field of the value type is passed as an
1543   // argument. We maintain 2 views of the argument list here: one
1544   // based on the signature (with a value type argument as a single
1545   // slot), one based on the actual calling convention (with a value
1546   // type argument as a list of its fields).
1547   const TypeTuple* const _domain_sig;
1548   const TypeTuple* const _domain_cc;
1549   const TypeTuple* const _range;      // Range of results
1550 
1551 public:
1552   // Constants are shared among ADLC and VM
1553   enum { Control    = AdlcVMDeps::Control,
1554          I_O        = AdlcVMDeps::I_O,
1555          Memory     = AdlcVMDeps::Memory,
1556          FramePtr   = AdlcVMDeps::FramePtr,
1557          ReturnAdr  = AdlcVMDeps::ReturnAdr,
1558          Parms      = AdlcVMDeps::Parms
1559   };
1560 
1561 
1562   // Accessors:
1563   const TypeTuple* domain_sig() const { return _domain_sig; }
1564   const TypeTuple* domain_cc() const { return _domain_cc; }
1565   const TypeTuple* range()  const { return _range; }
1566 
1567   static const TypeFunc *make(ciMethod* method);
1568   static const TypeFunc *make(ciSignature signature, const Type* extra);
1569   static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* domain_cc, const TypeTuple* range);
1570   static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range);
1571 
1572   virtual const Type *xmeet( const Type *t ) const;
1573   virtual const Type *xdual() const;    // Compute dual right now.
1574 
1575   BasicType return_type() const;
1576 
1577 #ifndef PRODUCT
1578   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1579 #endif
1580   // Convenience common pre-built types.
1581 };
1582 
1583 //------------------------------accessors--------------------------------------
1584 inline bool Type::is_ptr_to_narrowoop() const {
1585 #ifdef _LP64
1586   return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv());
1587 #else
1588   return false;
1589 #endif


< prev index next >