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/annotations.hpp"
33 #include "oops/constantPool.hpp"
34 #include "oops/methodCounters.hpp"
35 #include "oops/instanceKlass.hpp"
36 #include "oops/oop.hpp"
37 #include "oops/typeArrayOop.hpp"
38 #include "utilities/accessFlags.hpp"
39 #include "utilities/growableArray.hpp"
40
41 // A Method* represents a Java method.
42 //
43 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
44 // so keeping the size of this structure small has a big impact on footprint.
45 //
46 // We put all oops and method_size first for better gc cache locality.
47 //
48 // The actual bytecodes are inlined after the end of the Method struct.
49 //
50 // There are bits in the access_flags telling whether inlined tables are present.
51 // Note that accessing the line number and local variable tables is not performance critical at all.
52 // Accessing the checked exceptions table is used by reflection, so we put that last to make access
53 // to it fast.
54 //
55 // The line number table is compressed and inlined following the byte codes. It is found as the first
56 // byte following the byte codes. The checked exceptions table and the local variable table are inlined
57 // after the line number table, and indexed from the end of the method. We do not compress the checked
58 // exceptions table since the average length is less than 2, and do not bother to compress the local
59 // variable table either since it is mostly absent.
60 //
61 // Note that native_function and signature_handler has to be at fixed offsets (required by the interpreter)
62 //
63 // |------------------------------------------------------|
64 // | header |
65 // | klass |
66 // |------------------------------------------------------|
67 // | ConstMethod* (oop) |
68 // |------------------------------------------------------|
69 // | methodData (oop) |
70 // | methodCounters |
71 // |------------------------------------------------------|
72 // | access_flags |
73 // | vtable_index |
74 // |------------------------------------------------------|
75 // | result_index (C++ interpreter only) |
76 // |------------------------------------------------------|
77 // | method_size | intrinsic_id| flags |
78 // |------------------------------------------------------|
79 // | code (pointer) |
80 // | i2i (pointer) |
81 // | adapter (pointer) |
82 // | from_compiled_entry (pointer) |
83 // | from_interpreted_entry (pointer) |
84 // |------------------------------------------------------|
85 // | native_function (present only if native) |
86 // | signature_handler (present only if native) |
87 // |------------------------------------------------------|
88
89
90 class CheckedExceptionElement;
91 class LocalVariableTableElement;
92 class AdapterHandlerEntry;
93 class MethodData;
94 class MethodCounters;
95 class ConstMethod;
96 class InlineTableSizes;
97 class KlassSizeStats;
|
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/annotations.hpp"
33 #include "oops/constantPool.hpp"
34 #include "oops/methodCounters.hpp"
35 #include "oops/instanceKlass.hpp"
36 #include "oops/oop.hpp"
37 #include "oops/typeArrayOop.hpp"
38 #include "utilities/accessFlags.hpp"
39 #include "utilities/growableArray.hpp"
40
41 // A Method represents a Java method.
42 //
43 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
44 // so keeping the size of this structure small has a big impact on footprint.
45 //
46 // The actual bytecodes are inlined after the end of the Method struct.
47 //
48 // There are bits in the access_flags telling whether inlined tables are present.
49 // Note that accessing the line number and local variable tables is not performance critical at all.
50 // Accessing the checked exceptions table is used by reflection, so we put that last to make access
51 // to it fast.
52 //
53 // The line number table is compressed and inlined following the byte codes. It is found as the first
54 // byte following the byte codes. The checked exceptions table and the local variable table are inlined
55 // after the line number table, and indexed from the end of the method. We do not compress the checked
56 // exceptions table since the average length is less than 2, and do not bother to compress the local
57 // variable table either since it is mostly absent.
58 //
59 // Note that native_function and signature_handler has to be at fixed offsets (required by the interpreter)
60 //
61 // |------------------------------------------------------|
62 // | header |
63 // | klass |
64 // |------------------------------------------------------|
65 // | ConstMethod* (metadata) |
66 // |------------------------------------------------------|
67 // | MethodData* (metadata) |
68 // | MethodCounters |
69 // |------------------------------------------------------|
70 // | access_flags |
71 // | vtable_index |
72 // |------------------------------------------------------|
73 // | result_index (C++ interpreter only) |
74 // |------------------------------------------------------|
75 // | method_size | intrinsic_id | flags |
76 // |------------------------------------------------------|
77 // | code (pointer) |
78 // | i2i (pointer) |
79 // | adapter (pointer) |
80 // | from_compiled_entry (pointer) |
81 // | from_interpreted_entry (pointer) |
82 // |------------------------------------------------------|
83 // | native_function (present only if native) |
84 // | signature_handler (present only if native) |
85 // |------------------------------------------------------|
86
87
88 class CheckedExceptionElement;
89 class LocalVariableTableElement;
90 class AdapterHandlerEntry;
91 class MethodData;
92 class MethodCounters;
93 class ConstMethod;
94 class InlineTableSizes;
95 class KlassSizeStats;
|