src/share/vm/oops/methodOop.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 // A methodOop represents a Java method.
  26 //
  27 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
  28 // so keeping the size of this structure small has a big impact on footprint.
  29 //
  30 // We put all oops and method_size first for better gc cache locality.
  31 //
  32 // The actual bytecodes are inlined after the end of the methodOopDesc struct.
  33 //
  34 // There are bits in the access_flags telling whether inlined tables are present.
  35 // Note that accessing the line number and local variable tables is not performance critical at all.
  36 // Accessing the checked exceptions table is used by reflection, so we put that last to make access
  37 // to it fast.
  38 //
  39 // The line number table is compressed and inlined following the byte codes. It is found as the first
  40 // byte following the byte codes. The checked exceptions table and the local variable table are inlined
  41 // after the line number table, and indexed from the end of the method. We do not compress the checked
  42 // exceptions table since the average length is less than 2, and do not bother to compress the local
  43 // variable table either since it is mostly absent.
  44 //


 763   Bytecodes::Code orig_bytecode()                     { return _orig_bytecode; }
 764   void        set_orig_bytecode(Bytecodes::Code code) { _orig_bytecode = code; }
 765   int         bci()                                   { return _bci; }
 766 
 767   BreakpointInfo*          next() const               { return _next; }
 768   void                 set_next(BreakpointInfo* n)    { _next = n; }
 769 
 770   // helps for searchers
 771   bool match(methodOop m, int bci) {
 772     return bci == _bci && match(m);
 773   }
 774 
 775   bool match(methodOop m) {
 776     return _name_index == m->name_index() &&
 777       _signature_index == m->signature_index();
 778   }
 779 
 780   void set(methodOop method);
 781   void clear(methodOop method);
 782 };




   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_OOPS_METHODOOP_HPP
  26 #define SHARE_VM_OOPS_METHODOOP_HPP
  27 
  28 #include "classfile/vmSymbols.hpp"
  29 #include "code/compressedStream.hpp"
  30 #include "compiler/oopMap.hpp"
  31 #include "interpreter/invocationCounter.hpp"
  32 #include "oops/constMethodOop.hpp"
  33 #include "oops/constantPoolOop.hpp"
  34 #include "oops/instanceKlass.hpp"
  35 #include "oops/oop.hpp"
  36 #include "oops/typeArrayOop.hpp"
  37 #include "utilities/accessFlags.hpp"
  38 #include "utilities/growableArray.hpp"
  39 
  40 // A methodOop represents a Java method.
  41 //
  42 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
  43 // so keeping the size of this structure small has a big impact on footprint.
  44 //
  45 // We put all oops and method_size first for better gc cache locality.
  46 //
  47 // The actual bytecodes are inlined after the end of the methodOopDesc struct.
  48 //
  49 // There are bits in the access_flags telling whether inlined tables are present.
  50 // Note that accessing the line number and local variable tables is not performance critical at all.
  51 // Accessing the checked exceptions table is used by reflection, so we put that last to make access
  52 // to it fast.
  53 //
  54 // The line number table is compressed and inlined following the byte codes. It is found as the first
  55 // byte following the byte codes. The checked exceptions table and the local variable table are inlined
  56 // after the line number table, and indexed from the end of the method. We do not compress the checked
  57 // exceptions table since the average length is less than 2, and do not bother to compress the local
  58 // variable table either since it is mostly absent.
  59 //


 778   Bytecodes::Code orig_bytecode()                     { return _orig_bytecode; }
 779   void        set_orig_bytecode(Bytecodes::Code code) { _orig_bytecode = code; }
 780   int         bci()                                   { return _bci; }
 781 
 782   BreakpointInfo*          next() const               { return _next; }
 783   void                 set_next(BreakpointInfo* n)    { _next = n; }
 784 
 785   // helps for searchers
 786   bool match(methodOop m, int bci) {
 787     return bci == _bci && match(m);
 788   }
 789 
 790   bool match(methodOop m) {
 791     return _name_index == m->name_index() &&
 792       _signature_index == m->signature_index();
 793   }
 794 
 795   void set(methodOop method);
 796   void clear(methodOop method);
 797 };
 798 
 799 #endif // SHARE_VM_OOPS_METHODOOP_HPP