< prev index next >

src/share/vm/opto/callnode.hpp

Print this page




  59 class StartNode;
  60 class MachCallNode;
  61 class FastLockNode;
  62 
  63 //------------------------------StartNode--------------------------------------
  64 // The method start node
  65 class StartNode : public MultiNode {
  66   virtual uint cmp( const Node &n ) const;
  67   virtual uint size_of() const; // Size is bigger
  68 public:
  69   const TypeTuple *_domain;
  70   StartNode( Node *root, const TypeTuple *domain ) : MultiNode(2), _domain(domain) {
  71     init_class_id(Class_Start);
  72     init_req(0,this);
  73     init_req(1,root);
  74   }
  75   virtual int Opcode() const;
  76   virtual bool pinned() const { return true; };
  77   virtual const Type *bottom_type() const;
  78   virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; }
  79   virtual const Type *Value( PhaseTransform *phase ) const;
  80   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  81   virtual void  calling_convention( BasicType* sig_bt, VMRegPair *parm_reg, uint length ) const;
  82   virtual const RegMask &in_RegMask(uint) const;
  83   virtual Node *match( const ProjNode *proj, const Matcher *m );
  84   virtual uint ideal_reg() const { return 0; }
  85 #ifndef PRODUCT
  86   virtual void  dump_spec(outputStream *st) const;
  87   virtual void  dump_compact_spec(outputStream *st) const;
  88 #endif
  89 };
  90 
  91 //------------------------------StartOSRNode-----------------------------------
  92 // The method start node for on stack replacement code
  93 class StartOSRNode : public StartNode {
  94 public:
  95   StartOSRNode( Node *root, const TypeTuple *domain ) : StartNode(root, domain) {}
  96   virtual int   Opcode() const;
  97   static  const TypeTuple *osr_domain();
  98 };
  99 


 110   virtual bool  is_CFG() const { return (_con == TypeFunc::Control); }
 111   virtual uint ideal_reg() const;
 112 #ifndef PRODUCT
 113   virtual void dump_spec(outputStream *st) const;
 114   virtual void dump_compact_spec(outputStream *st) const;
 115   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
 116 #endif
 117 };
 118 
 119 
 120 //------------------------------ReturnNode-------------------------------------
 121 // Return from subroutine node
 122 class ReturnNode : public Node {
 123 public:
 124   ReturnNode( uint edges, Node *cntrl, Node *i_o, Node *memory, Node *retadr, Node *frameptr );
 125   virtual int Opcode() const;
 126   virtual bool  is_CFG() const { return true; }
 127   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 128   virtual bool depends_only_on_test() const { return false; }
 129   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 130   virtual const Type *Value( PhaseTransform *phase ) const;
 131   virtual uint ideal_reg() const { return NotAMachineReg; }
 132   virtual uint match_edge(uint idx) const;
 133 #ifndef PRODUCT
 134   virtual void dump_req(outputStream *st = tty) const;
 135 #endif
 136 };
 137 
 138 
 139 //------------------------------RethrowNode------------------------------------
 140 // Rethrow of exception at call site.  Ends a procedure before rethrowing;
 141 // ends the current basic block like a ReturnNode.  Restores registers and
 142 // unwinds stack.  Rethrow happens in the caller's method.
 143 class RethrowNode : public Node {
 144  public:
 145   RethrowNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *ret_adr, Node *exception );
 146   virtual int Opcode() const;
 147   virtual bool  is_CFG() const { return true; }
 148   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 149   virtual bool depends_only_on_test() const { return false; }
 150   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 151   virtual const Type *Value( PhaseTransform *phase ) const;
 152   virtual uint match_edge(uint idx) const;
 153   virtual uint ideal_reg() const { return NotAMachineReg; }
 154 #ifndef PRODUCT
 155   virtual void dump_req(outputStream *st = tty) const;
 156 #endif
 157 };
 158 
 159 
 160 //------------------------------TailCallNode-----------------------------------
 161 // Pop stack frame and jump indirect
 162 class TailCallNode : public ReturnNode {
 163 public:
 164   TailCallNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *retadr, Node *target, Node *moop )
 165     : ReturnNode( TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, retadr ) {
 166     init_req(TypeFunc::Parms, target);
 167     init_req(TypeFunc::Parms+1, moop);
 168   }
 169 
 170   virtual int Opcode() const;
 171   virtual uint match_edge(uint idx) const;


 448   }
 449   void transfer_replaced_nodes_from(SafePointNode* sfpt, uint idx = 0) {
 450     _replaced_nodes.transfer_from(sfpt->_replaced_nodes, idx);
 451   }
 452   void delete_replaced_nodes() {
 453     _replaced_nodes.reset();
 454   }
 455   void apply_replaced_nodes() {
 456     _replaced_nodes.apply(this);
 457   }
 458   void merge_replaced_nodes_with(SafePointNode* sfpt) {
 459     _replaced_nodes.merge_with(sfpt->_replaced_nodes);
 460   }
 461   bool has_replaced_nodes() const {
 462     return !_replaced_nodes.is_empty();
 463   }
 464 
 465   // Standard Node stuff
 466   virtual int            Opcode() const;
 467   virtual bool           pinned() const { return true; }
 468   virtual const Type    *Value( PhaseTransform *phase ) const;
 469   virtual const Type    *bottom_type() const { return Type::CONTROL; }
 470   virtual const TypePtr *adr_type() const { return _adr_type; }
 471   virtual Node          *Ideal(PhaseGVN *phase, bool can_reshape);
 472   virtual Node          *Identity( PhaseTransform *phase );
 473   virtual uint           ideal_reg() const { return 0; }
 474   virtual const RegMask &in_RegMask(uint) const;
 475   virtual const RegMask &out_RegMask() const;
 476   virtual uint           match_edge(uint idx) const;
 477 
 478   static  bool           needs_polling_address_input();
 479 
 480 #ifndef PRODUCT
 481   virtual void           dump_spec(outputStream *st) const;
 482   virtual void           related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
 483 #endif
 484 };
 485 
 486 //------------------------------SafePointScalarObjectNode----------------------
 487 // A SafePointScalarObjectNode represents the state of a scalarized object
 488 // at a safepoint.
 489 
 490 class SafePointScalarObjectNode: public TypeNode {
 491   uint _first_index; // First input edge relative index of a SafePoint node where
 492                      // states of the scalarized object fields are collected.


 576       _tf(tf),
 577       _entry_point(addr),
 578       _cnt(COUNT_UNKNOWN),
 579       _generator(NULL),
 580       _name(NULL)
 581   {
 582     init_class_id(Class_Call);
 583   }
 584 
 585   const TypeFunc* tf()         const { return _tf; }
 586   const address  entry_point() const { return _entry_point; }
 587   const float    cnt()         const { return _cnt; }
 588   CallGenerator* generator()   const { return _generator; }
 589 
 590   void set_tf(const TypeFunc* tf)       { _tf = tf; }
 591   void set_entry_point(address p)       { _entry_point = p; }
 592   void set_cnt(float c)                 { _cnt = c; }
 593   void set_generator(CallGenerator* cg) { _generator = cg; }
 594 
 595   virtual const Type *bottom_type() const;
 596   virtual const Type *Value( PhaseTransform *phase ) const;
 597   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 598   virtual Node *Identity( PhaseTransform *phase ) { return this; }
 599   virtual uint        cmp( const Node &n ) const;
 600   virtual uint        size_of() const = 0;
 601   virtual void        calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const;
 602   virtual Node       *match( const ProjNode *proj, const Matcher *m );
 603   virtual uint        ideal_reg() const { return NotAMachineReg; }
 604   // Are we guaranteed that this node is a safepoint?  Not true for leaf calls and
 605   // for some macro nodes whose expansion does not have a safepoint on the fast path.
 606   virtual bool        guaranteed_safepoint()  { return true; }
 607   // For macro nodes, the JVMState gets modified during expansion. If calls
 608   // use MachConstantBase, it gets modified during matching. So when cloning
 609   // the node the JVMState must be cloned. Default is not to clone.
 610   virtual void clone_jvms(Compile* C) {
 611     if (C->needs_clone_jvms() && jvms() != NULL) {
 612       set_jvms(jvms()->clone_deep(C));
 613       jvms()->set_map_deep(this);
 614     }
 615   }
 616 
 617   // Returns true if the call may modify n
 618   virtual bool        may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase);




  59 class StartNode;
  60 class MachCallNode;
  61 class FastLockNode;
  62 
  63 //------------------------------StartNode--------------------------------------
  64 // The method start node
  65 class StartNode : public MultiNode {
  66   virtual uint cmp( const Node &n ) const;
  67   virtual uint size_of() const; // Size is bigger
  68 public:
  69   const TypeTuple *_domain;
  70   StartNode( Node *root, const TypeTuple *domain ) : MultiNode(2), _domain(domain) {
  71     init_class_id(Class_Start);
  72     init_req(0,this);
  73     init_req(1,root);
  74   }
  75   virtual int Opcode() const;
  76   virtual bool pinned() const { return true; };
  77   virtual const Type *bottom_type() const;
  78   virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; }
  79   virtual const Type* Value(PhaseGVN* phase) const;
  80   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  81   virtual void  calling_convention( BasicType* sig_bt, VMRegPair *parm_reg, uint length ) const;
  82   virtual const RegMask &in_RegMask(uint) const;
  83   virtual Node *match( const ProjNode *proj, const Matcher *m );
  84   virtual uint ideal_reg() const { return 0; }
  85 #ifndef PRODUCT
  86   virtual void  dump_spec(outputStream *st) const;
  87   virtual void  dump_compact_spec(outputStream *st) const;
  88 #endif
  89 };
  90 
  91 //------------------------------StartOSRNode-----------------------------------
  92 // The method start node for on stack replacement code
  93 class StartOSRNode : public StartNode {
  94 public:
  95   StartOSRNode( Node *root, const TypeTuple *domain ) : StartNode(root, domain) {}
  96   virtual int   Opcode() const;
  97   static  const TypeTuple *osr_domain();
  98 };
  99 


 110   virtual bool  is_CFG() const { return (_con == TypeFunc::Control); }
 111   virtual uint ideal_reg() const;
 112 #ifndef PRODUCT
 113   virtual void dump_spec(outputStream *st) const;
 114   virtual void dump_compact_spec(outputStream *st) const;
 115   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
 116 #endif
 117 };
 118 
 119 
 120 //------------------------------ReturnNode-------------------------------------
 121 // Return from subroutine node
 122 class ReturnNode : public Node {
 123 public:
 124   ReturnNode( uint edges, Node *cntrl, Node *i_o, Node *memory, Node *retadr, Node *frameptr );
 125   virtual int Opcode() const;
 126   virtual bool  is_CFG() const { return true; }
 127   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 128   virtual bool depends_only_on_test() const { return false; }
 129   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 130   virtual const Type* Value(PhaseGVN* phase) const;
 131   virtual uint ideal_reg() const { return NotAMachineReg; }
 132   virtual uint match_edge(uint idx) const;
 133 #ifndef PRODUCT
 134   virtual void dump_req(outputStream *st = tty) const;
 135 #endif
 136 };
 137 
 138 
 139 //------------------------------RethrowNode------------------------------------
 140 // Rethrow of exception at call site.  Ends a procedure before rethrowing;
 141 // ends the current basic block like a ReturnNode.  Restores registers and
 142 // unwinds stack.  Rethrow happens in the caller's method.
 143 class RethrowNode : public Node {
 144  public:
 145   RethrowNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *ret_adr, Node *exception );
 146   virtual int Opcode() const;
 147   virtual bool  is_CFG() const { return true; }
 148   virtual uint hash() const { return NO_HASH; }  // CFG nodes do not hash
 149   virtual bool depends_only_on_test() const { return false; }
 150   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 151   virtual const Type* Value(PhaseGVN* phase) const;
 152   virtual uint match_edge(uint idx) const;
 153   virtual uint ideal_reg() const { return NotAMachineReg; }
 154 #ifndef PRODUCT
 155   virtual void dump_req(outputStream *st = tty) const;
 156 #endif
 157 };
 158 
 159 
 160 //------------------------------TailCallNode-----------------------------------
 161 // Pop stack frame and jump indirect
 162 class TailCallNode : public ReturnNode {
 163 public:
 164   TailCallNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *retadr, Node *target, Node *moop )
 165     : ReturnNode( TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, retadr ) {
 166     init_req(TypeFunc::Parms, target);
 167     init_req(TypeFunc::Parms+1, moop);
 168   }
 169 
 170   virtual int Opcode() const;
 171   virtual uint match_edge(uint idx) const;


 448   }
 449   void transfer_replaced_nodes_from(SafePointNode* sfpt, uint idx = 0) {
 450     _replaced_nodes.transfer_from(sfpt->_replaced_nodes, idx);
 451   }
 452   void delete_replaced_nodes() {
 453     _replaced_nodes.reset();
 454   }
 455   void apply_replaced_nodes() {
 456     _replaced_nodes.apply(this);
 457   }
 458   void merge_replaced_nodes_with(SafePointNode* sfpt) {
 459     _replaced_nodes.merge_with(sfpt->_replaced_nodes);
 460   }
 461   bool has_replaced_nodes() const {
 462     return !_replaced_nodes.is_empty();
 463   }
 464 
 465   // Standard Node stuff
 466   virtual int            Opcode() const;
 467   virtual bool           pinned() const { return true; }
 468   virtual const Type*    Value(PhaseGVN* phase) const;
 469   virtual const Type    *bottom_type() const { return Type::CONTROL; }
 470   virtual const TypePtr *adr_type() const { return _adr_type; }
 471   virtual Node          *Ideal(PhaseGVN *phase, bool can_reshape);
 472   virtual Node*          Identity(PhaseGVN* phase);
 473   virtual uint           ideal_reg() const { return 0; }
 474   virtual const RegMask &in_RegMask(uint) const;
 475   virtual const RegMask &out_RegMask() const;
 476   virtual uint           match_edge(uint idx) const;
 477 
 478   static  bool           needs_polling_address_input();
 479 
 480 #ifndef PRODUCT
 481   virtual void           dump_spec(outputStream *st) const;
 482   virtual void           related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
 483 #endif
 484 };
 485 
 486 //------------------------------SafePointScalarObjectNode----------------------
 487 // A SafePointScalarObjectNode represents the state of a scalarized object
 488 // at a safepoint.
 489 
 490 class SafePointScalarObjectNode: public TypeNode {
 491   uint _first_index; // First input edge relative index of a SafePoint node where
 492                      // states of the scalarized object fields are collected.


 576       _tf(tf),
 577       _entry_point(addr),
 578       _cnt(COUNT_UNKNOWN),
 579       _generator(NULL),
 580       _name(NULL)
 581   {
 582     init_class_id(Class_Call);
 583   }
 584 
 585   const TypeFunc* tf()         const { return _tf; }
 586   const address  entry_point() const { return _entry_point; }
 587   const float    cnt()         const { return _cnt; }
 588   CallGenerator* generator()   const { return _generator; }
 589 
 590   void set_tf(const TypeFunc* tf)       { _tf = tf; }
 591   void set_entry_point(address p)       { _entry_point = p; }
 592   void set_cnt(float c)                 { _cnt = c; }
 593   void set_generator(CallGenerator* cg) { _generator = cg; }
 594 
 595   virtual const Type *bottom_type() const;
 596   virtual const Type* Value(PhaseGVN* phase) const;
 597   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 598   virtual Node* Identity(PhaseGVN* phase) { return this; }
 599   virtual uint        cmp( const Node &n ) const;
 600   virtual uint        size_of() const = 0;
 601   virtual void        calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const;
 602   virtual Node       *match( const ProjNode *proj, const Matcher *m );
 603   virtual uint        ideal_reg() const { return NotAMachineReg; }
 604   // Are we guaranteed that this node is a safepoint?  Not true for leaf calls and
 605   // for some macro nodes whose expansion does not have a safepoint on the fast path.
 606   virtual bool        guaranteed_safepoint()  { return true; }
 607   // For macro nodes, the JVMState gets modified during expansion. If calls
 608   // use MachConstantBase, it gets modified during matching. So when cloning
 609   // the node the JVMState must be cloned. Default is not to clone.
 610   virtual void clone_jvms(Compile* C) {
 611     if (C->needs_clone_jvms() && jvms() != NULL) {
 612       set_jvms(jvms()->clone_deep(C));
 613       jvms()->set_map_deep(this);
 614     }
 615   }
 616 
 617   // Returns true if the call may modify n
 618   virtual bool        may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase);


< prev index next >