src/share/vm/ci/ciMethodBlocks.hpp

Print this page


   1 /*
   2  * Copyright (c) 2006, 2008, 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 
  26 class ciBlock;
  27 
  28 typedef short ciBlockIndex;
  29 
  30 class ciMethodBlocks : public ResourceObj {
  31 private:
  32   ciMethod *_method;
  33   Arena *_arena;
  34   GrowableArray<ciBlock *>  *_blocks;
  35   ciBlock  **_bci_to_block;
  36   int _num_blocks;
  37   int _code_size;
  38 
  39   void do_analysis();
  40 public:
  41   ciMethodBlocks(Arena *arena, ciMethod *meth);
  42 
  43   ciBlock *block_containing(int bci);
  44   ciBlock *block(int index)  { return _blocks->at(index); }


 104   bool  does_ret() const            { return (_flags & DoesRet) != 0; }
 105   bool  has_handler() const         { return (_flags & HasHandler) != 0; }
 106   bool  is_ret_target() const       { return (_flags & RetTarget) != 0; }
 107   void  set_processed()             { _flags |= Processed; }
 108   void  clear_processed()           { _flags &= ~Processed; }
 109   void  set_handler()               { _flags |= Handler; }
 110   void  set_may_throw()             { _flags |= MayThrow; }
 111   void  set_does_jsr()              { _flags |= DoesJsr; }
 112   void  clear_does_jsr()            { _flags &= ~DoesJsr; }
 113   void  set_does_ret()              { _flags |= DoesRet; }
 114   void  clear_does_ret()            { _flags &= ~DoesRet; }
 115   void  set_is_ret_target()         { _flags |= RetTarget; }
 116   void  set_has_handler()           { _flags |= HasHandler; }
 117   void  clear_exception_handler()   { _flags &= ~Handler; _ex_start_bci = -1; _ex_limit_bci = -1; }
 118 #ifndef PRODUCT
 119   ciMethod *method() const          { return _method; }
 120   void dump();
 121   void print_on(outputStream* st) const  PRODUCT_RETURN;
 122 #endif
 123 };


   1 /*
   2  * Copyright (c) 2006, 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_CI_CIMETHODBLOCKS_HPP
  26 #define SHARE_VM_CI_CIMETHODBLOCKS_HPP
  27 
  28 #include "ci/ciMethod.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "utilities/growableArray.hpp"
  31 
  32 
  33 class ciBlock;
  34 
  35 typedef short ciBlockIndex;
  36 
  37 class ciMethodBlocks : public ResourceObj {
  38 private:
  39   ciMethod *_method;
  40   Arena *_arena;
  41   GrowableArray<ciBlock *>  *_blocks;
  42   ciBlock  **_bci_to_block;
  43   int _num_blocks;
  44   int _code_size;
  45 
  46   void do_analysis();
  47 public:
  48   ciMethodBlocks(Arena *arena, ciMethod *meth);
  49 
  50   ciBlock *block_containing(int bci);
  51   ciBlock *block(int index)  { return _blocks->at(index); }


 111   bool  does_ret() const            { return (_flags & DoesRet) != 0; }
 112   bool  has_handler() const         { return (_flags & HasHandler) != 0; }
 113   bool  is_ret_target() const       { return (_flags & RetTarget) != 0; }
 114   void  set_processed()             { _flags |= Processed; }
 115   void  clear_processed()           { _flags &= ~Processed; }
 116   void  set_handler()               { _flags |= Handler; }
 117   void  set_may_throw()             { _flags |= MayThrow; }
 118   void  set_does_jsr()              { _flags |= DoesJsr; }
 119   void  clear_does_jsr()            { _flags &= ~DoesJsr; }
 120   void  set_does_ret()              { _flags |= DoesRet; }
 121   void  clear_does_ret()            { _flags &= ~DoesRet; }
 122   void  set_is_ret_target()         { _flags |= RetTarget; }
 123   void  set_has_handler()           { _flags |= HasHandler; }
 124   void  clear_exception_handler()   { _flags &= ~Handler; _ex_start_bci = -1; _ex_limit_bci = -1; }
 125 #ifndef PRODUCT
 126   ciMethod *method() const          { return _method; }
 127   void dump();
 128   void print_on(outputStream* st) const  PRODUCT_RETURN;
 129 #endif
 130 };
 131 
 132 #endif // SHARE_VM_CI_CIMETHODBLOCKS_HPP