src/share/vm/oops/constMethod.hpp

Print this page




  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_CONSTMETHODOOP_HPP
  26 #define SHARE_VM_OOPS_CONSTMETHODOOP_HPP
  27 
  28 #include "oops/oop.hpp"
  29 
  30 // An ConstMethod represents portions of a Java method which are not written to after
  31 // the classfile is parsed(*see below).  This part of the method can be shared across
  32 // processes in a read-only section with Class Data Sharing (CDS).  It's important
  33 // that this class doesn't have virtual functions because the vptr cannot be shared
  34 // with CDS.
  35 //   (*)RewriteByteCodes and RewriteFrequentPairs is an exception but turned off in CDS
  36 //
  37 // Note that most applications load thousands of methods, so keeping the size of this
  38 // structure small has a big impact on footprint.
  39 
  40 // The actual bytecodes are inlined after the end of the ConstMethod struct.
  41 //
  42 // The line number table is compressed and inlined following the byte codes. It is
  43 // found as the first byte following the byte codes.  Note that accessing the line
  44 // number and local variable tables is not performance critical at all.
  45 //
  46 // The checked exceptions table and the local variable table are inlined after the
  47 // line number table, and indexed from the end of the method. We do not compress the
  48 // checked exceptions table since the average length is less than 2, and it is used
  49 // by reflection so access should be fast.  We do not bother to compress the local
  50 // variable table either since it is mostly absent.
  51 //
  52 //
  53 //  ConstMethod embedded field layout (after declared fields):
  54 //    [EMBEDDED byte codes]
  55 //    [EMBEDDED compressed linenumber table]




  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_CONSTMETHODOOP_HPP
  26 #define SHARE_VM_OOPS_CONSTMETHODOOP_HPP
  27 
  28 #include "oops/oop.hpp"
  29 
  30 // An ConstMethod represents portions of a Java method which are not written to after
  31 // the classfile is parsed(*see below).  This part of the method can be shared across
  32 // processes in a read-only section with Class Data Sharing (CDS).  It's important
  33 // that this class doesn't have virtual functions because the vptr cannot be shared
  34 // with CDS.

  35 //
  36 // Note that most applications load thousands of methods, so keeping the size of this
  37 // structure small has a big impact on footprint.
  38 
  39 // The actual bytecodes are inlined after the end of the ConstMethod struct.
  40 //
  41 // The line number table is compressed and inlined following the byte codes. It is
  42 // found as the first byte following the byte codes.  Note that accessing the line
  43 // number and local variable tables is not performance critical at all.
  44 //
  45 // The checked exceptions table and the local variable table are inlined after the
  46 // line number table, and indexed from the end of the method. We do not compress the
  47 // checked exceptions table since the average length is less than 2, and it is used
  48 // by reflection so access should be fast.  We do not bother to compress the local
  49 // variable table either since it is mostly absent.
  50 //
  51 //
  52 //  ConstMethod embedded field layout (after declared fields):
  53 //    [EMBEDDED byte codes]
  54 //    [EMBEDDED compressed linenumber table]