Mercurial > hg > graal-compiler
annotate src/share/vm/oops/constMethod.cpp @ 8712:3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
Summary: Zero metadata in constructors, not in allocation (and some in constructors)
Reviewed-by: jmasa, sspitsyn
author | coleenp |
---|---|
date | Fri, 08 Mar 2013 11:47:57 -0500 |
parents | 927a311d00f9 |
children | 5939f5953b45 |
rev | line source |
---|---|
0 | 1 /* |
7956 | 2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
26 #include "interpreter/interpreter.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
27 #include "memory/gcLocker.hpp" |
7956 | 28 #include "memory/heapInspection.hpp" |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
29 #include "memory/metadataFactory.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
30 #include "oops/constMethod.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
31 #include "oops/method.hpp" |
0 | 32 |
33 // Static initialization | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
34 const u2 ConstMethod::MAX_IDNUM = 0xFFFE; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
35 const u2 ConstMethod::UNSET_IDNUM = 0xFFFF; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
36 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
37 ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data, |
6934 | 38 int byte_code_size, |
8031 | 39 InlineTableSizes* sizes, |
6934 | 40 MethodType method_type, |
41 TRAPS) { | |
8031 | 42 int size = ConstMethod::size(byte_code_size, sizes); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
43 return new (loader_data, size, true, THREAD) ConstMethod( |
8031 | 44 byte_code_size, sizes, method_type, size); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
45 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
46 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
47 ConstMethod::ConstMethod(int byte_code_size, |
8031 | 48 InlineTableSizes* sizes, |
6934 | 49 MethodType method_type, |
50 int size) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
51 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
52 No_Safepoint_Verifier no_safepoint; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
53 init_fingerprint(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
54 set_constants(NULL); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
55 set_stackmap_data(NULL); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
56 set_code_size(byte_code_size); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
57 set_constMethod_size(size); |
8031 | 58 set_inlined_tables_length(sizes); |
6934 | 59 set_method_type(method_type); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
60 assert(this->size() == size, "wrong size for object"); |
8712
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
61 set_name_index(0); |
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
62 set_signature_index(0); |
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
63 set_constants(NULL); |
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
64 set_max_stack(0); |
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
65 set_max_locals(0); |
3efdfd6ddbf2
8003553: NPG: metaspace objects should be zeroed in constructors
coleenp
parents:
8031
diff
changeset
|
66 set_method_idnum(0); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
67 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
68 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
69 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
70 // Deallocate metadata fields associated with ConstMethod* |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
71 void ConstMethod::deallocate_contents(ClassLoaderData* loader_data) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
72 if (stackmap_data() != NULL) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
73 MetadataFactory::free_array<u1>(loader_data, stackmap_data()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
74 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
75 set_stackmap_data(NULL); |
8031 | 76 |
77 // deallocate annotation arrays | |
78 if (has_method_annotations()) | |
79 MetadataFactory::free_array<u1>(loader_data, method_annotations()); | |
80 if (has_parameter_annotations()) | |
81 MetadataFactory::free_array<u1>(loader_data, parameter_annotations()); | |
82 if (has_type_annotations()) | |
83 MetadataFactory::free_array<u1>(loader_data, type_annotations()); | |
84 if (has_default_annotations()) | |
85 MetadataFactory::free_array<u1>(loader_data, default_annotations()); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
86 } |
0 | 87 |
88 // How big must this constMethodObject be? | |
89 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
90 int ConstMethod::size(int code_size, |
8031 | 91 InlineTableSizes* sizes) { |
0 | 92 int extra_bytes = code_size; |
8031 | 93 if (sizes->compressed_linenumber_size() > 0) { |
94 extra_bytes += sizes->compressed_linenumber_size(); | |
0 | 95 } |
8031 | 96 if (sizes->checked_exceptions_length() > 0) { |
0 | 97 extra_bytes += sizeof(u2); |
8031 | 98 extra_bytes += sizes->checked_exceptions_length() * sizeof(CheckedExceptionElement); |
0 | 99 } |
8031 | 100 if (sizes->localvariable_table_length() > 0) { |
0 | 101 extra_bytes += sizeof(u2); |
102 extra_bytes += | |
8031 | 103 sizes->localvariable_table_length() * sizeof(LocalVariableTableElement); |
0 | 104 } |
8031 | 105 if (sizes->exception_table_length() > 0) { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
106 extra_bytes += sizeof(u2); |
8031 | 107 extra_bytes += sizes->exception_table_length() * sizeof(ExceptionTableElement); |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
108 } |
8031 | 109 if (sizes->generic_signature_index() != 0) { |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
110 extra_bytes += sizeof(u2); |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
111 } |
8031 | 112 if (sizes->method_parameters_length() > 0) { |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
113 extra_bytes += sizeof(u2); |
8031 | 114 extra_bytes += sizes->method_parameters_length() * sizeof(MethodParametersElement); |
115 } | |
116 | |
117 // Align sizes up to a word. | |
118 extra_bytes = align_size_up(extra_bytes, BytesPerWord); | |
119 | |
120 // One pointer per annotation array | |
121 if (sizes->method_annotations_length() > 0) { | |
122 extra_bytes += sizeof(AnnotationArray*); | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
123 } |
8031 | 124 if (sizes->parameter_annotations_length() > 0) { |
125 extra_bytes += sizeof(AnnotationArray*); | |
126 } | |
127 if (sizes->type_annotations_length() > 0) { | |
128 extra_bytes += sizeof(AnnotationArray*); | |
129 } | |
130 if (sizes->default_annotations_length() > 0) { | |
131 extra_bytes += sizeof(AnnotationArray*); | |
132 } | |
133 | |
0 | 134 int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord; |
8031 | 135 assert(extra_words == extra_bytes/BytesPerWord, "should already be aligned"); |
0 | 136 return align_object_size(header_size() + extra_words); |
137 } | |
138 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
139 Method* ConstMethod::method() const { |
6940
18fb7da42534
8000725: NPG: method_holder() and pool_holder() and pool_holder field should be InstanceKlass
coleenp
parents:
6934
diff
changeset
|
140 return _constants->pool_holder()->method_with_idnum(_method_idnum); |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
1972
diff
changeset
|
141 } |
0 | 142 |
143 // linenumber table - note that length is unknown until decompression, | |
144 // see class CompressedLineNumberReadStream. | |
145 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
146 u_char* ConstMethod::compressed_linenumber_table() const { |
0 | 147 // Located immediately following the bytecodes. |
148 assert(has_linenumber_table(), "called only if table is present"); | |
149 return code_end(); | |
150 } | |
151 | |
8031 | 152 // Last short in ConstMethod* before annotations |
153 u2* ConstMethod::last_u2_element() const { | |
154 int offset = 0; | |
155 if (has_method_annotations()) offset++; | |
156 if (has_parameter_annotations()) offset++; | |
157 if (has_type_annotations()) offset++; | |
158 if (has_default_annotations()) offset++; | |
159 return (u2*)((AnnotationArray**)constMethod_end() - offset) - 1; | |
160 } | |
161 | |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
162 u2* ConstMethod::generic_signature_index_addr() const { |
0 | 163 // Located at the end of the constMethod. |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
164 assert(has_generic_signature(), "called only if generic signature exists"); |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
165 return last_u2_element(); |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
166 } |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
167 |
8031 | 168 u2* ConstMethod::method_parameters_length_addr() const { |
169 assert(has_method_parameters(), "called only if table is present"); | |
170 return has_generic_signature() ? (last_u2_element() - 1) : | |
171 last_u2_element(); | |
172 } | |
173 | |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
174 u2* ConstMethod::checked_exceptions_length_addr() const { |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
175 // Located immediately before the generic signature index. |
0 | 176 assert(has_checked_exceptions(), "called only if table is present"); |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
177 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
178 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
179 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
180 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
181 // Else, the exception table is at the end of the constMethod. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
182 return has_generic_signature() ? (last_u2_element() - 1) : |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
183 last_u2_element(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
184 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
185 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
186 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
187 u2* ConstMethod::exception_table_length_addr() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
188 assert(has_exception_handler(), "called only if table is present"); |
0 | 189 if (has_checked_exceptions()) { |
190 // If checked_exception present, locate immediately before them. | |
191 return (u2*) checked_exceptions_start() - 1; | |
192 } else { | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
193 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
194 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
195 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
196 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
197 // Else, the exception table is at the end of the constMethod. |
8031 | 198 return has_generic_signature() ? (last_u2_element() - 1) : |
199 last_u2_element(); | |
200 } | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
201 } |
0 | 202 } |
203 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
204 u2* ConstMethod::localvariable_table_length_addr() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
205 assert(has_localvariable_table(), "called only if table is present"); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
206 if (has_exception_handler()) { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
207 // If exception_table present, locate immediately before them. |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
208 return (u2*) exception_table_start() - 1; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
209 } else { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
210 if (has_checked_exceptions()) { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
211 // If checked_exception present, locate immediately before them. |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
212 return (u2*) checked_exceptions_start() - 1; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
213 } else { |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
214 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
215 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
216 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
217 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
218 // Else, the exception table is at the end of the constMethod. |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
219 return has_generic_signature() ? (last_u2_element() - 1) : |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
220 last_u2_element(); |
8031 | 221 } |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
222 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
223 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
224 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
225 |
0 | 226 // Update the flags to indicate the presence of these optional fields. |
8031 | 227 void ConstMethod::set_inlined_tables_length(InlineTableSizes* sizes) { |
228 _flags = 0; | |
229 if (sizes->compressed_linenumber_size() > 0) | |
0 | 230 _flags |= _has_linenumber_table; |
8031 | 231 if (sizes->generic_signature_index() != 0) |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
232 _flags |= _has_generic_signature; |
8031 | 233 if (sizes->method_parameters_length() > 0) |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
234 _flags |= _has_method_parameters; |
8031 | 235 if (sizes->checked_exceptions_length() > 0) |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
236 _flags |= _has_checked_exceptions; |
8031 | 237 if (sizes->exception_table_length() > 0) |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
238 _flags |= _has_exception_table; |
8031 | 239 if (sizes->localvariable_table_length() > 0) |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
240 _flags |= _has_localvariable_table; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
241 |
8031 | 242 // annotations, they are all pointer sized embedded objects so don't have |
243 // a length embedded also. | |
244 if (sizes->method_annotations_length() > 0) | |
245 _flags |= _has_method_annotations; | |
246 if (sizes->parameter_annotations_length() > 0) | |
247 _flags |= _has_parameter_annotations; | |
248 if (sizes->type_annotations_length() > 0) | |
249 _flags |= _has_type_annotations; | |
250 if (sizes->default_annotations_length() > 0) | |
251 _flags |= _has_default_annotations; | |
252 | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
253 // This code is extremely brittle and should possibly be revised. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
254 // The *_length_addr functions walk backwards through the |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
255 // constMethod data, using each of the length indexes ahead of them, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
256 // as well as the flags variable. Therefore, the indexes must be |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
257 // initialized in reverse order, or else they will compute the wrong |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
258 // offsets. Moving the initialization of _flags into a separate |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
259 // block solves *half* of the problem, but the following part will |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
260 // still break if the order is not exactly right. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
261 // |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
262 // Also, the servicability agent needs to be informed anytime |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
263 // anything is added here. It might be advisable to have some sort |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
264 // of indication of this inline. |
8031 | 265 if (sizes->generic_signature_index() != 0) |
266 *(generic_signature_index_addr()) = sizes->generic_signature_index(); | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
267 // New data should probably go here. |
8031 | 268 if (sizes->method_parameters_length() > 0) |
269 *(method_parameters_length_addr()) = sizes->method_parameters_length(); | |
270 if (sizes->checked_exceptions_length() > 0) | |
271 *(checked_exceptions_length_addr()) = sizes->checked_exceptions_length(); | |
272 if (sizes->exception_table_length() > 0) | |
273 *(exception_table_length_addr()) = sizes->exception_table_length(); | |
274 if (sizes->localvariable_table_length() > 0) | |
275 *(localvariable_table_length_addr()) = sizes->localvariable_table_length(); | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
276 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
277 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
278 int ConstMethod::method_parameters_length() const { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
279 return has_method_parameters() ? *(method_parameters_length_addr()) : 0; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
280 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
281 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
282 MethodParametersElement* ConstMethod::method_parameters_start() const { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
283 u2* addr = method_parameters_length_addr(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
284 u2 length = *addr; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
285 assert(length > 0, "should only be called if table is present"); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
286 addr -= length * sizeof(MethodParametersElement) / sizeof(u2); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
287 return (MethodParametersElement*) addr; |
0 | 288 } |
289 | |
290 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
291 int ConstMethod::checked_exceptions_length() const { |
0 | 292 return has_checked_exceptions() ? *(checked_exceptions_length_addr()) : 0; |
293 } | |
294 | |
295 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
296 CheckedExceptionElement* ConstMethod::checked_exceptions_start() const { |
0 | 297 u2* addr = checked_exceptions_length_addr(); |
298 u2 length = *addr; | |
299 assert(length > 0, "should only be called if table is present"); | |
300 addr -= length * sizeof(CheckedExceptionElement) / sizeof(u2); | |
301 return (CheckedExceptionElement*) addr; | |
302 } | |
303 | |
304 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
305 int ConstMethod::localvariable_table_length() const { |
0 | 306 return has_localvariable_table() ? *(localvariable_table_length_addr()) : 0; |
307 } | |
308 | |
309 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
310 LocalVariableTableElement* ConstMethod::localvariable_table_start() const { |
0 | 311 u2* addr = localvariable_table_length_addr(); |
312 u2 length = *addr; | |
313 assert(length > 0, "should only be called if table is present"); | |
314 addr -= length * sizeof(LocalVariableTableElement) / sizeof(u2); | |
315 return (LocalVariableTableElement*) addr; | |
316 } | |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
317 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
318 int ConstMethod::exception_table_length() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
319 return has_exception_handler() ? *(exception_table_length_addr()) : 0; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
320 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
321 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
322 ExceptionTableElement* ConstMethod::exception_table_start() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
323 u2* addr = exception_table_length_addr(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
324 u2 length = *addr; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
325 assert(length > 0, "should only be called if table is present"); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
326 addr -= length * sizeof(ExceptionTableElement) / sizeof(u2); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
327 return (ExceptionTableElement*)addr; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
328 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
329 |
8031 | 330 AnnotationArray** ConstMethod::method_annotations_addr() const { |
331 assert(has_method_annotations(), "should only be called if method annotations are present"); | |
332 return (AnnotationArray**)constMethod_end() - 1; | |
333 } | |
334 | |
335 AnnotationArray** ConstMethod::parameter_annotations_addr() const { | |
336 assert(has_parameter_annotations(), "should only be called if method parameter annotations are present"); | |
337 int offset = 1; | |
338 if (has_method_annotations()) offset++; | |
339 return (AnnotationArray**)constMethod_end() - offset; | |
340 } | |
341 | |
342 AnnotationArray** ConstMethod::type_annotations_addr() const { | |
343 assert(has_type_annotations(), "should only be called if method type annotations are present"); | |
344 int offset = 1; | |
345 if (has_method_annotations()) offset++; | |
346 if (has_parameter_annotations()) offset++; | |
347 return (AnnotationArray**)constMethod_end() - offset; | |
348 } | |
349 | |
350 AnnotationArray** ConstMethod::default_annotations_addr() const { | |
351 assert(has_default_annotations(), "should only be called if method default annotations are present"); | |
352 int offset = 1; | |
353 if (has_method_annotations()) offset++; | |
354 if (has_parameter_annotations()) offset++; | |
355 if (has_type_annotations()) offset++; | |
356 return (AnnotationArray**)constMethod_end() - offset; | |
357 } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
358 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
359 // Printing |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
360 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
361 void ConstMethod::print_on(outputStream* st) const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
362 ResourceMark rm; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
363 assert(is_constMethod(), "must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
364 st->print_cr(internal_name()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
365 st->print(" - method: " INTPTR_FORMAT " ", (address)method()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
366 method()->print_value_on(st); st->cr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
367 if (has_stackmap_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
368 st->print(" - stackmap data: "); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
369 stackmap_data()->print_value_on(st); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
370 st->cr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
371 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
372 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
373 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
374 // Short version of printing ConstMethod* - just print the name of the |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
375 // method it belongs to. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
376 void ConstMethod::print_value_on(outputStream* st) const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
377 assert(is_constMethod(), "must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
378 st->print(" const part of method " ); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
379 method()->print_value_on(st); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
380 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
381 |
7956 | 382 #if INCLUDE_SERVICES |
383 // Size Statistics | |
384 void ConstMethod::collect_statistics(KlassSizeStats *sz) const { | |
385 int n1, n2, n3; | |
386 sz->_const_method_bytes += (n1 = sz->count(this)); | |
387 sz->_bytecode_bytes += (n2 = code_size()); | |
388 sz->_stackmap_bytes += (n3 = sz->count_array(stackmap_data())); | |
389 | |
8031 | 390 // Count method annotations |
391 int a1 = 0, a2 = 0, a3 = 0, a4 = 0; | |
392 if (has_method_annotations()) { | |
393 sz->_methods_annotations_bytes += (a1 = sz->count_array(method_annotations())); | |
394 } | |
395 if (has_parameter_annotations()) { | |
396 sz->_methods_parameter_annotations_bytes += (a2 = sz->count_array(parameter_annotations())); | |
397 } | |
398 if (has_type_annotations()) { | |
399 sz->_methods_type_annotations_bytes += (a3 = sz->count_array(type_annotations())); | |
400 } | |
401 if (has_default_annotations()) { | |
402 sz->_methods_default_annotations_bytes += (a4 = sz->count_array(default_annotations())); | |
403 } | |
404 | |
405 int size_annotations = a1 + a2 + a3 + a4; | |
406 | |
407 sz->_method_all_bytes += n1 + n3 + size_annotations; // note: n2 is part of n3 | |
408 sz->_ro_bytes += n1 + n3 + size_annotations; | |
7956 | 409 } |
410 #endif // INCLUDE_SERVICES | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
411 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
412 // Verification |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
413 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
414 void ConstMethod::verify_on(outputStream* st) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
415 guarantee(is_constMethod(), "object must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
416 guarantee(is_metadata(), err_msg("Should be metadata " PTR_FORMAT, this)); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
417 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
418 // Verification can occur during oop construction before the method or |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
419 // other fields have been initialized. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
420 guarantee(method()->is_method(), "should be method"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
421 |
8031 | 422 address m_end = (address)((intptr_t) this + size()); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
423 address compressed_table_start = code_end(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
424 guarantee(compressed_table_start <= m_end, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
425 address compressed_table_end = compressed_table_start; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
426 // Verify line number table |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
427 if (has_linenumber_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
428 CompressedLineNumberReadStream stream(compressed_linenumber_table()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
429 while (stream.read_pair()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
430 guarantee(stream.bci() >= 0 && stream.bci() <= code_size(), "invalid bci in line number table"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
431 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
432 compressed_table_end += stream.position(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
433 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
434 guarantee(compressed_table_end <= m_end, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
435 // Verify checked exceptions, exception table and local variable tables |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
436 if (has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
437 u2* addr = method_parameters_length_addr(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
438 guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout"); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
439 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
440 if (has_checked_exceptions()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
441 u2* addr = checked_exceptions_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
442 guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
443 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
444 if (has_exception_handler()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
445 u2* addr = exception_table_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
446 guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
447 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
448 if (has_localvariable_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
449 u2* addr = localvariable_table_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
450 guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
451 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
452 // Check compressed_table_end relative to uncompressed_table_start |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
453 u2* uncompressed_table_start; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
454 if (has_localvariable_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
455 uncompressed_table_start = (u2*) localvariable_table_start(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
456 } else if (has_exception_handler()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
457 uncompressed_table_start = (u2*) exception_table_start(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
458 } else if (has_checked_exceptions()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
459 uncompressed_table_start = (u2*) checked_exceptions_start(); |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
460 } else if (has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
461 uncompressed_table_start = (u2*) method_parameters_start(); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
462 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
463 uncompressed_table_start = (u2*) m_end; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
464 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
465 int gap = (intptr_t) uncompressed_table_start - (intptr_t) compressed_table_end; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
466 int max_gap = align_object_size(1)*BytesPerWord; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
467 guarantee(gap >= 0 && gap < max_gap, "invalid method layout"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
468 } |