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