hotspot/src/share/vm/opto/callnode.hpp
changeset 236 9a04268c8eea
parent 212 cd4963e67949
child 238 803c80713999
equal deleted inserted replaced
219:ac2d788217ca 236:9a04268c8eea
   182   JVMState*         _caller;    // List pointer for forming scope chains
   182   JVMState*         _caller;    // List pointer for forming scope chains
   183   uint              _depth;     // One mroe than caller depth, or one.
   183   uint              _depth;     // One mroe than caller depth, or one.
   184   uint              _locoff;    // Offset to locals in input edge mapping
   184   uint              _locoff;    // Offset to locals in input edge mapping
   185   uint              _stkoff;    // Offset to stack in input edge mapping
   185   uint              _stkoff;    // Offset to stack in input edge mapping
   186   uint              _monoff;    // Offset to monitors in input edge mapping
   186   uint              _monoff;    // Offset to monitors in input edge mapping
       
   187   uint              _scloff;    // Offset to fields of scalar objs in input edge mapping
   187   uint              _endoff;    // Offset to end of input edge mapping
   188   uint              _endoff;    // Offset to end of input edge mapping
   188   uint              _sp;        // Jave Expression Stack Pointer for this state
   189   uint              _sp;        // Jave Expression Stack Pointer for this state
   189   int               _bci;       // Byte Code Index of this JVM point
   190   int               _bci;       // Byte Code Index of this JVM point
   190   ciMethod*         _method;    // Method Pointer
   191   ciMethod*         _method;    // Method Pointer
   191   SafePointNode*    _map;       // Map node associated with this scope
   192   SafePointNode*    _map;       // Map node associated with this scope
   205   // Access functions for the JVM
   206   // Access functions for the JVM
   206   uint              locoff() const { return _locoff; }
   207   uint              locoff() const { return _locoff; }
   207   uint              stkoff() const { return _stkoff; }
   208   uint              stkoff() const { return _stkoff; }
   208   uint              argoff() const { return _stkoff + _sp; }
   209   uint              argoff() const { return _stkoff + _sp; }
   209   uint              monoff() const { return _monoff; }
   210   uint              monoff() const { return _monoff; }
       
   211   uint              scloff() const { return _scloff; }
   210   uint              endoff() const { return _endoff; }
   212   uint              endoff() const { return _endoff; }
   211   uint              oopoff() const { return debug_end(); }
   213   uint              oopoff() const { return debug_end(); }
   212 
   214 
   213   int            loc_size() const { return _stkoff - _locoff; }
   215   int            loc_size() const { return _stkoff - _locoff; }
   214   int            stk_size() const { return _monoff - _stkoff; }
   216   int            stk_size() const { return _monoff - _stkoff; }
   215   int            mon_size() const { return _endoff - _monoff; }
   217   int            mon_size() const { return _scloff - _monoff; }
       
   218   int            scl_size() const { return _endoff - _scloff; }
   216 
   219 
   217   bool        is_loc(uint i) const { return i >= _locoff && i < _stkoff; }
   220   bool        is_loc(uint i) const { return i >= _locoff && i < _stkoff; }
   218   bool        is_stk(uint i) const { return i >= _stkoff && i < _monoff; }
   221   bool        is_stk(uint i) const { return i >= _stkoff && i < _monoff; }
   219   bool        is_mon(uint i) const { return i >= _monoff && i < _endoff; }
   222   bool        is_mon(uint i) const { return i >= _monoff && i < _scloff; }
       
   223   bool        is_scl(uint i) const { return i >= _scloff && i < _endoff; }
   220 
   224 
   221   uint              sp()     const { return _sp; }
   225   uint              sp()     const { return _sp; }
   222   int               bci()    const { return _bci; }
   226   int               bci()    const { return _bci; }
   223   bool          has_method() const { return _method != NULL; }
   227   bool          has_method() const { return _method != NULL; }
   224   ciMethod*         method() const { assert(has_method(), ""); return _method; }
   228   ciMethod*         method() const { assert(has_method(), ""); return _method; }
   225   JVMState*         caller() const { return _caller; }
   229   JVMState*         caller() const { return _caller; }
   226   SafePointNode*    map()    const { return _map; }
   230   SafePointNode*    map()    const { return _map; }
   227   uint              depth()  const { return _depth; }
   231   uint              depth()  const { return _depth; }
   228   uint        debug_start()  const; // returns locoff of root caller
   232   uint        debug_start()  const; // returns locoff of root caller
   229   uint        debug_end()    const; // returns endoff of self
   233   uint        debug_end()    const; // returns endoff of self
   230   uint        debug_size()   const { return loc_size() + sp() + mon_size(); }
   234   uint        debug_size()   const {
       
   235     return loc_size() + sp() + mon_size() + scl_size();
       
   236   }
   231   uint        debug_depth()  const; // returns sum of debug_size values at all depths
   237   uint        debug_depth()  const; // returns sum of debug_size values at all depths
   232 
   238 
   233   // Returns the JVM state at the desired depth (1 == root).
   239   // Returns the JVM state at the desired depth (1 == root).
   234   JVMState* of_depth(int d) const;
   240   JVMState* of_depth(int d) const;
   235 
   241 
   252 
   258 
   253   // Initialization functions for the JVM
   259   // Initialization functions for the JVM
   254   void              set_locoff(uint off) { _locoff = off; }
   260   void              set_locoff(uint off) { _locoff = off; }
   255   void              set_stkoff(uint off) { _stkoff = off; }
   261   void              set_stkoff(uint off) { _stkoff = off; }
   256   void              set_monoff(uint off) { _monoff = off; }
   262   void              set_monoff(uint off) { _monoff = off; }
       
   263   void              set_scloff(uint off) { _scloff = off; }
   257   void              set_endoff(uint off) { _endoff = off; }
   264   void              set_endoff(uint off) { _endoff = off; }
   258   void              set_offsets(uint off) { _locoff = _stkoff = _monoff = _endoff = off; }
   265   void              set_offsets(uint off) {
       
   266     _locoff = _stkoff = _monoff = _scloff = _endoff = off;
       
   267   }
   259   void              set_map(SafePointNode *map) { _map = map; }
   268   void              set_map(SafePointNode *map) { _map = map; }
   260   void              set_sp(uint sp) { _sp = sp; }
   269   void              set_sp(uint sp) { _sp = sp; }
   261   void              set_bci(int bci) { _bci = bci; }
   270   void              set_bci(int bci) { _bci = bci; }
   262 
   271 
   263   // Miscellaneous utility functions
   272   // Miscellaneous utility functions
   391   virtual const RegMask &in_RegMask(uint) const;
   400   virtual const RegMask &in_RegMask(uint) const;
   392   virtual const RegMask &out_RegMask() const;
   401   virtual const RegMask &out_RegMask() const;
   393   virtual uint           match_edge(uint idx) const;
   402   virtual uint           match_edge(uint idx) const;
   394 
   403 
   395   static  bool           needs_polling_address_input();
   404   static  bool           needs_polling_address_input();
       
   405 
       
   406 #ifndef PRODUCT
       
   407   virtual void              dump_spec(outputStream *st) const;
       
   408 #endif
       
   409 };
       
   410 
       
   411 //------------------------------SafePointScalarObjectNode----------------------
       
   412 // A SafePointScalarObjectNode represents the state of a scalarized object
       
   413 // at a safepoint.
       
   414 
       
   415 class SafePointScalarObjectNode: public TypeNode {
       
   416   uint _first_index; // First input edge index of a SafePoint node where
       
   417                      // states of the scalarized object fields are collected.
       
   418   uint _n_fields;    // Number of non-static fields of the scalarized object.
       
   419   DEBUG_ONLY(AllocateNode* _alloc);
       
   420 public:
       
   421   SafePointScalarObjectNode(const TypeOopPtr* tp,
       
   422 #ifdef ASSERT
       
   423                             AllocateNode* alloc,
       
   424 #endif
       
   425                             uint first_index, uint n_fields);
       
   426   virtual int Opcode() const;
       
   427   virtual uint           ideal_reg() const;
       
   428   virtual const RegMask &in_RegMask(uint) const;
       
   429   virtual const RegMask &out_RegMask() const;
       
   430   virtual uint           match_edge(uint idx) const;
       
   431 
       
   432   uint first_index() const { return _first_index; }
       
   433   uint n_fields()    const { return _n_fields; }
       
   434   DEBUG_ONLY(AllocateNode* alloc() const { return _alloc; })
       
   435 
       
   436   virtual uint size_of() const { return sizeof(*this); }
       
   437 
       
   438   // Assumes that "this" is an argument to a safepoint node "s", and that
       
   439   // "new_call" is being created to correspond to "s".  But the difference
       
   440   // between the start index of the jvmstates of "new_call" and "s" is
       
   441   // "jvms_adj".  Produce and return a SafePointScalarObjectNode that
       
   442   // corresponds appropriately to "this" in "new_call".  Assumes that
       
   443   // "sosn_map" is a map, specific to the translation of "s" to "new_call",
       
   444   // mapping old SafePointScalarObjectNodes to new, to avoid multiple copies.
       
   445   SafePointScalarObjectNode* clone(int jvms_adj, Dict* sosn_map) const;
   396 
   446 
   397 #ifndef PRODUCT
   447 #ifndef PRODUCT
   398   virtual void              dump_spec(outputStream *st) const;
   448   virtual void              dump_spec(outputStream *st) const;
   399 #endif
   449 #endif
   400 };
   450 };