< prev index next >

src/share/vm/opto/addnode.cpp

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/addnode.hpp"
  28 #include "opto/cfgnode.hpp"
  29 #include "opto/connode.hpp"
  30 #include "opto/machnode.hpp"
  31 #include "opto/mulnode.hpp"
  32 #include "opto/phaseX.hpp"
  33 #include "opto/subnode.hpp"



  34 
  35 // Portions of code courtesy of Clifford Click
  36 
  37 // Classic Add functionality.  This covers all the usual 'add' behaviors for
  38 // an algebraic ring.  Add-integer, add-float, add-double, and binary-or are
  39 // all inherited from this class.  The various identity values are supplied
  40 // by virtual functions.
  41 
  42 
  43 //=============================================================================
  44 //------------------------------hash-------------------------------------------
  45 // Hash function over AddNodes.  Needs to be commutative; i.e., I swap
  46 // (commute) inputs to AddNodes willy-nilly so the hash function must return
  47 // the same value in the presence of edge swapping.
  48 uint AddNode::hash() const {
  49   return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode();
  50 }
  51 
  52 //------------------------------Identity---------------------------------------
  53 // If either input is a constant 0, return the other input.




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/addnode.hpp"
  28 #include "opto/cfgnode.hpp"
  29 #include "opto/connode.hpp"
  30 #include "opto/machnode.hpp"
  31 #include "opto/mulnode.hpp"
  32 #include "opto/phaseX.hpp"
  33 #include "opto/subnode.hpp"
  34 #if INCLUDE_ALL_GCS
  35 #include "gc_implementation/shenandoah/c2/shenandoahSupport.hpp"
  36 #endif
  37 
  38 // Portions of code courtesy of Clifford Click
  39 
  40 // Classic Add functionality.  This covers all the usual 'add' behaviors for
  41 // an algebraic ring.  Add-integer, add-float, add-double, and binary-or are
  42 // all inherited from this class.  The various identity values are supplied
  43 // by virtual functions.
  44 
  45 
  46 //=============================================================================
  47 //------------------------------hash-------------------------------------------
  48 // Hash function over AddNodes.  Needs to be commutative; i.e., I swap
  49 // (commute) inputs to AddNodes willy-nilly so the hash function must return
  50 // the same value in the presence of edge swapping.
  51 uint AddNode::hash() const {
  52   return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode();
  53 }
  54 
  55 //------------------------------Identity---------------------------------------
  56 // If either input is a constant 0, return the other input.


< prev index next >