src/share/vm/c1/c1_Canonicalizer.hpp

Print this page




   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 Canonicalizer: InstructionVisitor {
  26  private:
  27   Compilation *_compilation;
  28   Instruction* _canonical;
  29   int _bci;
  30 
  31   Compilation *compilation()                     { return _compilation; }
  32   void set_canonical(Value x);
  33   void set_bci(int bci)                          { _bci = bci; }
  34   void set_constant(jint x)                      { set_canonical(new Constant(new IntConstant(x))); }
  35   void set_constant(jlong x)                     { set_canonical(new Constant(new LongConstant(x))); }
  36   void set_constant(jfloat x)                    { set_canonical(new Constant(new FloatConstant(x))); }
  37   void set_constant(jdouble x)                   { set_canonical(new Constant(new DoubleConstant(x))); }
  38   void move_const_to_right(Op2* x);
  39   void do_Op2(Op2* x);
  40   void do_UnsafeRawOp(UnsafeRawOp* x);
  41 
  42   void unsafe_raw_match(UnsafeRawOp* x,
  43                         Instruction** base,
  44                         Instruction** index,


  81   virtual void do_BlockBegin     (BlockBegin*      x);
  82   virtual void do_Goto           (Goto*            x);
  83   virtual void do_If             (If*              x);
  84   virtual void do_TableSwitch    (TableSwitch*     x);
  85   virtual void do_LookupSwitch   (LookupSwitch*    x);
  86   virtual void do_Return         (Return*          x);
  87   virtual void do_Throw          (Throw*           x);
  88   virtual void do_Base           (Base*            x);
  89   virtual void do_OsrEntry       (OsrEntry*        x);
  90   virtual void do_ExceptionObject(ExceptionObject* x);
  91   virtual void do_RoundFP        (RoundFP*         x);
  92   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x);
  93   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x);
  94   virtual void do_UnsafeGetObject(UnsafeGetObject* x);
  95   virtual void do_UnsafePutObject(UnsafePutObject* x);
  96   virtual void do_UnsafePrefetchRead (UnsafePrefetchRead*  x);
  97   virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
  98   virtual void do_ProfileCall    (ProfileCall*     x);
  99   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
 100 };




   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_C1_C1_CANONICALIZER_HPP
  26 #define SHARE_VM_C1_C1_CANONICALIZER_HPP
  27 
  28 #include "c1/c1_Instruction.hpp"
  29 
  30 class Canonicalizer: InstructionVisitor {
  31  private:
  32   Compilation *_compilation;
  33   Instruction* _canonical;
  34   int _bci;
  35 
  36   Compilation *compilation()                     { return _compilation; }
  37   void set_canonical(Value x);
  38   void set_bci(int bci)                          { _bci = bci; }
  39   void set_constant(jint x)                      { set_canonical(new Constant(new IntConstant(x))); }
  40   void set_constant(jlong x)                     { set_canonical(new Constant(new LongConstant(x))); }
  41   void set_constant(jfloat x)                    { set_canonical(new Constant(new FloatConstant(x))); }
  42   void set_constant(jdouble x)                   { set_canonical(new Constant(new DoubleConstant(x))); }
  43   void move_const_to_right(Op2* x);
  44   void do_Op2(Op2* x);
  45   void do_UnsafeRawOp(UnsafeRawOp* x);
  46 
  47   void unsafe_raw_match(UnsafeRawOp* x,
  48                         Instruction** base,
  49                         Instruction** index,


  86   virtual void do_BlockBegin     (BlockBegin*      x);
  87   virtual void do_Goto           (Goto*            x);
  88   virtual void do_If             (If*              x);
  89   virtual void do_TableSwitch    (TableSwitch*     x);
  90   virtual void do_LookupSwitch   (LookupSwitch*    x);
  91   virtual void do_Return         (Return*          x);
  92   virtual void do_Throw          (Throw*           x);
  93   virtual void do_Base           (Base*            x);
  94   virtual void do_OsrEntry       (OsrEntry*        x);
  95   virtual void do_ExceptionObject(ExceptionObject* x);
  96   virtual void do_RoundFP        (RoundFP*         x);
  97   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x);
  98   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x);
  99   virtual void do_UnsafeGetObject(UnsafeGetObject* x);
 100   virtual void do_UnsafePutObject(UnsafePutObject* x);
 101   virtual void do_UnsafePrefetchRead (UnsafePrefetchRead*  x);
 102   virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
 103   virtual void do_ProfileCall    (ProfileCall*     x);
 104   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
 105 };
 106 
 107 #endif // SHARE_VM_C1_C1_CANONICALIZER_HPP