Mercurial > hg > truffle
annotate src/share/vm/oops/constMethod.cpp @ 7555:9c6602e65423
Updated .hgignore file to also ignore IntelliJ project files.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 25 Jan 2013 11:11:32 +0100 |
parents | ade95d680b42 |
children | 16fb9f942703 |
rev | line source |
---|---|
0 | 1 /* |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
1972
diff
changeset
|
2 * Copyright (c) 2003, 2012, 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" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
28 #include "memory/metadataFactory.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
29 #include "oops/constMethod.hpp" |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
30 #include "oops/method.hpp" |
0 | 31 |
32 // Static initialization | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
33 const u2 ConstMethod::MAX_IDNUM = 0xFFFE; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
34 const u2 ConstMethod::UNSET_IDNUM = 0xFFFF; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
35 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
36 ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data, |
6934 | 37 int byte_code_size, |
38 int compressed_line_number_size, | |
39 int localvariable_table_length, | |
40 int exception_table_length, | |
41 int checked_exceptions_length, | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
42 int method_parameters_length, |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
43 u2 generic_signature_index, |
6934 | 44 MethodType method_type, |
45 TRAPS) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
46 int size = ConstMethod::size(byte_code_size, |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
47 compressed_line_number_size, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
48 localvariable_table_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
49 exception_table_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
50 checked_exceptions_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
51 method_parameters_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
52 generic_signature_index); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
53 return new (loader_data, size, true, THREAD) ConstMethod( |
6934 | 54 byte_code_size, compressed_line_number_size, localvariable_table_length, |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
55 exception_table_length, checked_exceptions_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
56 method_parameters_length, generic_signature_index, |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
57 method_type, size); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
58 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
59 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
60 ConstMethod::ConstMethod(int byte_code_size, |
6934 | 61 int compressed_line_number_size, |
62 int localvariable_table_length, | |
63 int exception_table_length, | |
64 int checked_exceptions_length, | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
65 int method_parameters_length, |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
66 u2 generic_signature_index, |
6934 | 67 MethodType method_type, |
68 int size) { | |
6725
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 No_Safepoint_Verifier no_safepoint; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
71 set_interpreter_kind(Interpreter::invalid); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
72 init_fingerprint(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
73 set_constants(NULL); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
74 set_stackmap_data(NULL); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
75 set_code_size(byte_code_size); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
76 set_constMethod_size(size); |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
77 set_inlined_tables_length(generic_signature_index, |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
78 checked_exceptions_length, |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
79 compressed_line_number_size, |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
80 localvariable_table_length, |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
81 exception_table_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
82 method_parameters_length); |
6934 | 83 set_method_type(method_type); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
84 assert(this->size() == size, "wrong size for object"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
85 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
86 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
87 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
88 // Deallocate metadata fields associated with ConstMethod* |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
89 void ConstMethod::deallocate_contents(ClassLoaderData* loader_data) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
90 set_interpreter_kind(Interpreter::invalid); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
91 if (stackmap_data() != NULL) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
92 MetadataFactory::free_array<u1>(loader_data, stackmap_data()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
93 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
94 set_stackmap_data(NULL); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
95 } |
0 | 96 |
97 // How big must this constMethodObject be? | |
98 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
99 int ConstMethod::size(int code_size, |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
100 int compressed_line_number_size, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
101 int local_variable_table_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
102 int exception_table_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
103 int checked_exceptions_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
104 int method_parameters_length, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
105 u2 generic_signature_index) { |
0 | 106 int extra_bytes = code_size; |
107 if (compressed_line_number_size > 0) { | |
108 extra_bytes += compressed_line_number_size; | |
109 } | |
110 if (checked_exceptions_length > 0) { | |
111 extra_bytes += sizeof(u2); | |
112 extra_bytes += checked_exceptions_length * sizeof(CheckedExceptionElement); | |
113 } | |
114 if (local_variable_table_length > 0) { | |
115 extra_bytes += sizeof(u2); | |
116 extra_bytes += | |
117 local_variable_table_length * sizeof(LocalVariableTableElement); | |
118 } | |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
119 if (exception_table_length > 0) { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
120 extra_bytes += sizeof(u2); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
121 extra_bytes += exception_table_length * sizeof(ExceptionTableElement); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
122 } |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
123 if (generic_signature_index != 0) { |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
124 extra_bytes += sizeof(u2); |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
125 } |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
126 if (method_parameters_length > 0) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
127 extra_bytes += sizeof(u2); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
128 extra_bytes += method_parameters_length * sizeof(MethodParametersElement); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
129 } |
0 | 130 int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord; |
131 return align_object_size(header_size() + extra_words); | |
132 } | |
133 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
134 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
|
135 return _constants->pool_holder()->method_with_idnum(_method_idnum); |
6123
2fe087c3e814
7172967: Eliminate constMethod's _method backpointer to methodOop.
jiangli
parents:
1972
diff
changeset
|
136 } |
0 | 137 |
138 // linenumber table - note that length is unknown until decompression, | |
139 // see class CompressedLineNumberReadStream. | |
140 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
141 u_char* ConstMethod::compressed_linenumber_table() const { |
0 | 142 // Located immediately following the bytecodes. |
143 assert(has_linenumber_table(), "called only if table is present"); | |
144 return code_end(); | |
145 } | |
146 | |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
147 u2* ConstMethod::generic_signature_index_addr() const { |
0 | 148 // 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
|
149 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
|
150 return last_u2_element(); |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
151 } |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
152 |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
153 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
|
154 // Located immediately before the generic signature index. |
0 | 155 assert(has_checked_exceptions(), "called only if table is present"); |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
156 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
157 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
158 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
159 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
160 // Else, the exception table is at the end of the constMethod. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
161 return has_generic_signature() ? (last_u2_element() - 1) : |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
162 last_u2_element(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
163 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
164 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
165 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
166 u2* ConstMethod::method_parameters_length_addr() const { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
167 assert(has_method_parameters(), "called only if table is present"); |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
168 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
|
169 last_u2_element(); |
0 | 170 } |
171 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
172 u2* ConstMethod::exception_table_length_addr() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
173 assert(has_exception_handler(), "called only if table is present"); |
0 | 174 if (has_checked_exceptions()) { |
175 // If checked_exception present, locate immediately before them. | |
176 return (u2*) checked_exceptions_start() - 1; | |
177 } else { | |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
178 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
179 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
180 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
181 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
182 // 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
|
183 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
|
184 last_u2_element(); |
0 | 185 } |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
186 } |
0 | 187 } |
188 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
189 u2* ConstMethod::localvariable_table_length_addr() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
190 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
|
191 if (has_exception_handler()) { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
192 // If exception_table present, locate immediately before them. |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
193 return (u2*) exception_table_start() - 1; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
194 } else { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
195 if (has_checked_exceptions()) { |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
196 // If checked_exception present, locate immediately before them. |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
197 return (u2*) checked_exceptions_start() - 1; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
198 } else { |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
199 if(has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
200 // If method parameters present, locate immediately before them. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
201 return (u2*)method_parameters_start() - 1; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
202 } else { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
203 // 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
|
204 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
|
205 last_u2_element(); |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
206 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
207 } |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
208 } |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
209 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
210 |
0 | 211 // Update the flags to indicate the presence of these optional fields. |
7183
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
212 void ConstMethod::set_inlined_tables_length(u2 generic_signature_index, |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
213 int checked_exceptions_len, |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
214 int compressed_line_number_size, |
b2dbd323c668
8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod.
jiangli
parents:
6940
diff
changeset
|
215 int localvariable_table_len, |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
216 int exception_table_len, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
217 int method_parameters_len) { |
0 | 218 assert(_flags == 0, "Error"); |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
219 if (compressed_line_number_size > 0) |
0 | 220 _flags |= _has_linenumber_table; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
221 if (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
|
222 _flags |= _has_generic_signature; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
223 if (method_parameters_len > 0) |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
224 _flags |= _has_method_parameters; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
225 if (checked_exceptions_len > 0) |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
226 _flags |= _has_checked_exceptions; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
227 if (exception_table_len > 0) |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
228 _flags |= _has_exception_table; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
229 if (localvariable_table_len > 0) |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
230 _flags |= _has_localvariable_table; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
231 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
232 // This code is extremely brittle and should possibly be revised. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
233 // The *_length_addr functions walk backwards through the |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
234 // constMethod data, using each of the length indexes ahead of them, |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
235 // as well as the flags variable. Therefore, the indexes must be |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
236 // initialized in reverse order, or else they will compute the wrong |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
237 // offsets. Moving the initialization of _flags into a separate |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
238 // block solves *half* of the problem, but the following part will |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
239 // still break if the order is not exactly right. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
240 // |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
241 // Also, the servicability agent needs to be informed anytime |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
242 // 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
|
243 // of indication of this inline. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
244 if (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
|
245 *(generic_signature_index_addr()) = generic_signature_index; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
246 // New data should probably go here. |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
247 if (method_parameters_len > 0) |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
248 *(method_parameters_length_addr()) = method_parameters_len; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
249 if (checked_exceptions_len > 0) |
0 | 250 *(checked_exceptions_length_addr()) = checked_exceptions_len; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
251 if (exception_table_len > 0) |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
252 *(exception_table_length_addr()) = exception_table_len; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
253 if (localvariable_table_len > 0) |
0 | 254 *(localvariable_table_length_addr()) = localvariable_table_len; |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
255 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
256 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
257 int ConstMethod::method_parameters_length() const { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
258 return has_method_parameters() ? *(method_parameters_length_addr()) : 0; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
259 } |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
260 |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
261 MethodParametersElement* ConstMethod::method_parameters_start() const { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
262 u2* addr = method_parameters_length_addr(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
263 u2 length = *addr; |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
264 assert(length > 0, "should only be called if table is present"); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
265 addr -= length * sizeof(MethodParametersElement) / sizeof(u2); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
266 return (MethodParametersElement*) addr; |
0 | 267 } |
268 | |
269 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
270 int ConstMethod::checked_exceptions_length() const { |
0 | 271 return has_checked_exceptions() ? *(checked_exceptions_length_addr()) : 0; |
272 } | |
273 | |
274 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
275 CheckedExceptionElement* ConstMethod::checked_exceptions_start() const { |
0 | 276 u2* addr = checked_exceptions_length_addr(); |
277 u2 length = *addr; | |
278 assert(length > 0, "should only be called if table is present"); | |
279 addr -= length * sizeof(CheckedExceptionElement) / sizeof(u2); | |
280 return (CheckedExceptionElement*) addr; | |
281 } | |
282 | |
283 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
284 int ConstMethod::localvariable_table_length() const { |
0 | 285 return has_localvariable_table() ? *(localvariable_table_length_addr()) : 0; |
286 } | |
287 | |
288 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
289 LocalVariableTableElement* ConstMethod::localvariable_table_start() const { |
0 | 290 u2* addr = localvariable_table_length_addr(); |
291 u2 length = *addr; | |
292 assert(length > 0, "should only be called if table is present"); | |
293 addr -= length * sizeof(LocalVariableTableElement) / sizeof(u2); | |
294 return (LocalVariableTableElement*) addr; | |
295 } | |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
296 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
297 int ConstMethod::exception_table_length() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
298 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
|
299 } |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
300 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
301 ExceptionTableElement* ConstMethod::exception_table_start() const { |
6213
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
302 u2* addr = exception_table_length_addr(); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
303 u2 length = *addr; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
304 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
|
305 addr -= length * sizeof(ExceptionTableElement) / sizeof(u2); |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
306 return (ExceptionTableElement*)addr; |
8150fa46d2ed
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
jiangli
parents:
6123
diff
changeset
|
307 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
308 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
309 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
310 // Printing |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
311 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
312 void ConstMethod::print_on(outputStream* st) const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
313 ResourceMark rm; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
314 assert(is_constMethod(), "must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
315 st->print_cr(internal_name()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
316 st->print(" - method: " INTPTR_FORMAT " ", (address)method()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
317 method()->print_value_on(st); st->cr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
318 if (has_stackmap_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
319 st->print(" - stackmap data: "); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
320 stackmap_data()->print_value_on(st); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
321 st->cr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
322 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
323 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
324 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
325 // 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
|
326 // method it belongs to. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
327 void ConstMethod::print_value_on(outputStream* st) const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
328 assert(is_constMethod(), "must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
329 st->print(" const part of method " ); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
330 method()->print_value_on(st); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
331 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
332 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
333 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
334 // Verification |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
335 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
336 void ConstMethod::verify_on(outputStream* st) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
337 guarantee(is_constMethod(), "object must be constMethod"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
338 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
|
339 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
340 // 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
|
341 // other fields have been initialized. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
342 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
|
343 guarantee(method()->is_method(), "should be method"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
344 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
345 address m_end = (address)((oop*) this + size()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
346 address compressed_table_start = code_end(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
347 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
|
348 address compressed_table_end = compressed_table_start; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
349 // Verify line number table |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
350 if (has_linenumber_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
351 CompressedLineNumberReadStream stream(compressed_linenumber_table()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
352 while (stream.read_pair()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
353 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
|
354 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
355 compressed_table_end += stream.position(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
356 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
357 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
|
358 // Verify checked exceptions, exception table and local variable tables |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
359 if (has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
360 u2* addr = method_parameters_length_addr(); |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
361 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
|
362 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
363 if (has_checked_exceptions()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
364 u2* addr = checked_exceptions_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
365 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
|
366 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
367 if (has_exception_handler()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
368 u2* addr = exception_table_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
369 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
|
370 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
371 if (has_localvariable_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
372 u2* addr = localvariable_table_length_addr(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
373 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
|
374 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
375 // 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
|
376 u2* uncompressed_table_start; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
377 if (has_localvariable_table()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
378 uncompressed_table_start = (u2*) localvariable_table_start(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
379 } else if (has_exception_handler()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
380 uncompressed_table_start = (u2*) exception_table_start(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
381 } else if (has_checked_exceptions()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
382 uncompressed_table_start = (u2*) checked_exceptions_start(); |
7462
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
383 } else if (has_method_parameters()) { |
ade95d680b42
8004728: Add hotspot support for parameter reflection
coleenp
parents:
7183
diff
changeset
|
384 uncompressed_table_start = (u2*) method_parameters_start(); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
385 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
386 uncompressed_table_start = (u2*) m_end; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
387 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
388 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
|
389 int max_gap = align_object_size(1)*BytesPerWord; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6213
diff
changeset
|
390 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
|
391 } |