src/share/vm/opto/phaseX.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 class Compile;
  26 class ConINode;
  27 class ConLNode;
  28 class Node;
  29 class Type;
  30 class PhaseTransform;
  31 class   PhaseGVN;
  32 class     PhaseIterGVN;
  33 class       PhaseCCP;
  34 class   PhasePeephole;
  35 class   PhaseRegAlloc;
  36 
  37 
  38 //-----------------------------------------------------------------------------
  39 // Expandable closed hash-table of nodes, initialized to NULL.
  40 // Note that the constructor just zeros things
  41 // Storage is reclaimed when the Arena's lifetime is over.
  42 class NodeHash : public StackObj {
  43 protected:
  44   Arena *_a;                    // Arena to allocate in


 518   // Recursive traversal of program.  Pure function is unused in this phase
 519   virtual Node *transform( Node *n );
 520 
 521 public:
 522   PhasePeephole( PhaseRegAlloc *regalloc, PhaseCFG &cfg );
 523   NOT_PRODUCT( ~PhasePeephole(); )
 524 
 525   // Do any transformation after analysis
 526   void          do_transform();
 527 
 528 #ifndef PRODUCT
 529   static uint _total_peepholes;  // For profiling, count peephole rules applied
 530   uint   _count_peepholes;
 531   void    clear_peepholes()      { _count_peepholes = 0; }
 532   void    inc_peepholes()        { ++_count_peepholes; }
 533   uint    count_peepholes() const { return _count_peepholes; }
 534 
 535   static void print_statistics();
 536 #endif
 537 };


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 #ifndef SHARE_VM_OPTO_PHASEX_HPP
  26 #define SHARE_VM_OPTO_PHASEX_HPP
  27 
  28 #include "libadt/dict.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "opto/memnode.hpp"
  32 #include "opto/node.hpp"
  33 #include "opto/phase.hpp"
  34 #include "opto/type.hpp"
  35 
  36 class Compile;
  37 class ConINode;
  38 class ConLNode;
  39 class Node;
  40 class Type;
  41 class PhaseTransform;
  42 class   PhaseGVN;
  43 class     PhaseIterGVN;
  44 class       PhaseCCP;
  45 class   PhasePeephole;
  46 class   PhaseRegAlloc;
  47 
  48 
  49 //-----------------------------------------------------------------------------
  50 // Expandable closed hash-table of nodes, initialized to NULL.
  51 // Note that the constructor just zeros things
  52 // Storage is reclaimed when the Arena's lifetime is over.
  53 class NodeHash : public StackObj {
  54 protected:
  55   Arena *_a;                    // Arena to allocate in


 529   // Recursive traversal of program.  Pure function is unused in this phase
 530   virtual Node *transform( Node *n );
 531 
 532 public:
 533   PhasePeephole( PhaseRegAlloc *regalloc, PhaseCFG &cfg );
 534   NOT_PRODUCT( ~PhasePeephole(); )
 535 
 536   // Do any transformation after analysis
 537   void          do_transform();
 538 
 539 #ifndef PRODUCT
 540   static uint _total_peepholes;  // For profiling, count peephole rules applied
 541   uint   _count_peepholes;
 542   void    clear_peepholes()      { _count_peepholes = 0; }
 543   void    inc_peepholes()        { ++_count_peepholes; }
 544   uint    count_peepholes() const { return _count_peepholes; }
 545 
 546   static void print_statistics();
 547 #endif
 548 };
 549 
 550 #endif // SHARE_VM_OPTO_PHASEX_HPP