Mercurial > hg > truffle
annotate src/share/vm/code/relocInfo.hpp @ 13705:ac5b0f31f7a2
Truffle API-change: FrameDescriptors are now stored in the RootNode in a final field instead of the CallTarget.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 17 Jan 2014 17:06:08 +0100 |
parents | d49f00604347 |
children | d2c8b553f621 |
rev | line source |
---|---|
0 | 1 /* |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
11041
diff
changeset
|
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
337
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
337
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:
337
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_CODE_RELOCINFO_HPP |
26 #define SHARE_VM_CODE_RELOCINFO_HPP | |
27 | |
28 #include "memory/allocation.hpp" | |
29 #include "utilities/top.hpp" | |
30 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
31 class NativeMovConstReg; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
32 |
0 | 33 // Types in this file: |
34 // relocInfo | |
35 // One element of an array of halfwords encoding compressed relocations. | |
36 // Also, the source of relocation types (relocInfo::oop_type, ...). | |
37 // Relocation | |
38 // A flyweight object representing a single relocation. | |
39 // It is fully unpacked from the compressed relocation array. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
40 // metadata_Relocation, ... (subclasses of Relocation) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
41 // The location of some type-specific operations (metadata_addr, ...). |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
42 // Also, the source of relocation specs (metadata_Relocation::spec, ...). |
0 | 43 // oop_Relocation, ... (subclasses of Relocation) |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
44 // oops in the code stream (strings, class loaders) |
0 | 45 // Also, the source of relocation specs (oop_Relocation::spec, ...). |
46 // RelocationHolder | |
47 // A ValueObj type which acts as a union holding a Relocation object. | |
48 // Represents a relocation spec passed into a CodeBuffer during assembly. | |
49 // RelocIterator | |
50 // A StackObj which iterates over the relocations associated with | |
51 // a range of code addresses. Can be used to operate a copy of code. | |
52 // BoundRelocation | |
53 // An _internal_ type shared by packers and unpackers of relocations. | |
54 // It pastes together a RelocationHolder with some pointers into | |
55 // code and relocInfo streams. | |
56 | |
57 | |
58 // Notes on relocType: | |
59 // | |
60 // These hold enough information to read or write a value embedded in | |
61 // the instructions of an CodeBlob. They're used to update: | |
62 // | |
63 // 1) embedded oops (isOop() == true) | |
64 // 2) inline caches (isIC() == true) | |
65 // 3) runtime calls (isRuntimeCall() == true) | |
66 // 4) internal word ref (isInternalWord() == true) | |
67 // 5) external word ref (isExternalWord() == true) | |
68 // | |
69 // when objects move (GC) or if code moves (compacting the code heap). | |
70 // They are also used to patch the code (if a call site must change) | |
71 // | |
72 // A relocInfo is represented in 16 bits: | |
73 // 4 bits indicating the relocation type | |
74 // 12 bits indicating the offset from the previous relocInfo address | |
75 // | |
76 // The offsets accumulate along the relocInfo stream to encode the | |
77 // address within the CodeBlob, which is named RelocIterator::addr(). | |
78 // The address of a particular relocInfo always points to the first | |
79 // byte of the relevant instruction (and not to any of its subfields | |
80 // or embedded immediate constants). | |
81 // | |
82 // The offset value is scaled appropriately for the target machine. | |
83 // (See relocInfo_<arch>.hpp for the offset scaling.) | |
84 // | |
85 // On some machines, there may also be a "format" field which may provide | |
86 // additional information about the format of the instruction stream | |
87 // at the corresponding code address. The format value is usually zero. | |
88 // Any machine (such as Intel) whose instructions can sometimes contain | |
89 // more than one relocatable constant needs format codes to distinguish | |
90 // which operand goes with a given relocation. | |
91 // | |
92 // If the target machine needs N format bits, the offset has 12-N bits, | |
93 // the format is encoded between the offset and the type, and the | |
94 // relocInfo_<arch>.hpp file has manifest constants for the format codes. | |
95 // | |
96 // If the type is "data_prefix_tag" then the offset bits are further encoded, | |
97 // and in fact represent not a code-stream offset but some inline data. | |
98 // The data takes the form of a counted sequence of halfwords, which | |
99 // precedes the actual relocation record. (Clients never see it directly.) | |
100 // The interpetation of this extra data depends on the relocation type. | |
101 // | |
102 // On machines that have 32-bit immediate fields, there is usually | |
103 // little need for relocation "prefix" data, because the instruction stream | |
104 // is a perfectly reasonable place to store the value. On machines in | |
105 // which 32-bit values must be "split" across instructions, the relocation | |
106 // data is the "true" specification of the value, which is then applied | |
107 // to some field of the instruction (22 or 13 bits, on SPARC). | |
108 // | |
109 // Whenever the location of the CodeBlob changes, any PC-relative | |
110 // relocations, and any internal_word_type relocations, must be reapplied. | |
111 // After the GC runs, oop_type relocations must be reapplied. | |
112 // | |
113 // | |
114 // Here are meanings of the types: | |
115 // | |
116 // relocInfo::none -- a filler record | |
117 // Value: none | |
118 // Instruction: The corresponding code address is ignored | |
119 // Data: Any data prefix and format code are ignored | |
120 // (This means that any relocInfo can be disabled by setting | |
121 // its type to none. See relocInfo::remove.) | |
122 // | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
123 // relocInfo::oop_type, relocInfo::metadata_type -- a reference to an oop or meta data |
0 | 124 // Value: an oop, or else the address (handle) of an oop |
125 // Instruction types: memory (load), set (load address) | |
126 // Data: [] an oop stored in 4 bytes of instruction | |
127 // [n] n is the index of an oop in the CodeBlob's oop pool | |
128 // [[N]n l] and l is a byte offset to be applied to the oop | |
129 // [Nn Ll] both index and offset may be 32 bits if necessary | |
130 // Here is a special hack, used only by the old compiler: | |
131 // [[N]n 00] the value is the __address__ of the nth oop in the pool | |
132 // (Note that the offset allows optimal references to class variables.) | |
133 // | |
134 // relocInfo::internal_word_type -- an address within the same CodeBlob | |
135 // relocInfo::section_word_type -- same, but can refer to another section | |
136 // Value: an address in the CodeBlob's code or constants section | |
137 // Instruction types: memory (load), set (load address) | |
138 // Data: [] stored in 4 bytes of instruction | |
139 // [[L]l] a relative offset (see [About Offsets] below) | |
140 // In the case of section_word_type, the offset is relative to a section | |
141 // base address, and the section number (e.g., SECT_INSTS) is encoded | |
142 // into the low two bits of the offset L. | |
143 // | |
144 // relocInfo::external_word_type -- a fixed address in the runtime system | |
145 // Value: an address | |
146 // Instruction types: memory (load), set (load address) | |
147 // Data: [] stored in 4 bytes of instruction | |
148 // [n] the index of a "well-known" stub (usual case on RISC) | |
149 // [Ll] a 32-bit address | |
150 // | |
151 // relocInfo::runtime_call_type -- a fixed subroutine in the runtime system | |
152 // Value: an address | |
153 // Instruction types: PC-relative call (or a PC-relative branch) | |
154 // Data: [] stored in 4 bytes of instruction | |
155 // | |
156 // relocInfo::static_call_type -- a static call | |
157 // Value: an CodeBlob, a stub, or a fixup routine | |
158 // Instruction types: a call | |
159 // Data: [] | |
160 // The identity of the callee is extracted from debugging information. | |
161 // //%note reloc_3 | |
162 // | |
163 // relocInfo::virtual_call_type -- a virtual call site (which includes an inline | |
164 // cache) | |
165 // Value: an CodeBlob, a stub, the interpreter, or a fixup routine | |
166 // Instruction types: a call, plus some associated set-oop instructions | |
167 // Data: [] the associated set-oops are adjacent to the call | |
168 // [n] n is a relative offset to the first set-oop | |
169 // [[N]n l] and l is a limit within which the set-oops occur | |
170 // [Nn Ll] both n and l may be 32 bits if necessary | |
171 // The identity of the callee is extracted from debugging information. | |
172 // | |
173 // relocInfo::opt_virtual_call_type -- a virtual call site that is statically bound | |
174 // | |
175 // Same info as a static_call_type. We use a special type, so the handling of | |
176 // virtuals and statics are separated. | |
177 // | |
178 // | |
179 // The offset n points to the first set-oop. (See [About Offsets] below.) | |
180 // In turn, the set-oop instruction specifies or contains an oop cell devoted | |
181 // exclusively to the IC call, which can be patched along with the call. | |
182 // | |
183 // The locations of any other set-oops are found by searching the relocation | |
184 // information starting at the first set-oop, and continuing until all | |
185 // relocations up through l have been inspected. The value l is another | |
186 // relative offset. (Both n and l are relative to the call's first byte.) | |
187 // | |
188 // The limit l of the search is exclusive. However, if it points within | |
189 // the call (e.g., offset zero), it is adjusted to point after the call and | |
190 // any associated machine-specific delay slot. | |
191 // | |
192 // Since the offsets could be as wide as 32-bits, these conventions | |
193 // put no restrictions whatever upon code reorganization. | |
194 // | |
195 // The compiler is responsible for ensuring that transition from a clean | |
196 // state to a monomorphic compiled state is MP-safe. This implies that | |
197 // the system must respond well to intermediate states where a random | |
198 // subset of the set-oops has been correctly from the clean state | |
199 // upon entry to the VEP of the compiled method. In the case of a | |
200 // machine (Intel) with a single set-oop instruction, the 32-bit | |
201 // immediate field must not straddle a unit of memory coherence. | |
202 // //%note reloc_3 | |
203 // | |
204 // relocInfo::static_stub_type -- an extra stub for each static_call_type | |
205 // Value: none | |
206 // Instruction types: a virtual call: { set_oop; jump; } | |
207 // Data: [[N]n] the offset of the associated static_call reloc | |
208 // This stub becomes the target of a static call which must be upgraded | |
209 // to a virtual call (because the callee is interpreted). | |
210 // See [About Offsets] below. | |
211 // //%note reloc_2 | |
212 // | |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
213 // relocInfo::poll_[return_]type -- a safepoint poll |
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
214 // Value: none |
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
215 // Instruction types: memory load or test |
13553
d49f00604347
removed poll_Relocation::pollingForm type and associated data field and rely solely on format field of safepoint relocation entries when deciding whether or not to relocate the operand of a safepoint poll instruction
Doug Simon <doug.simon@oracle.com>
parents:
13515
diff
changeset
|
216 // Data: none |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
217 // |
0 | 218 // For example: |
219 // | |
220 // INSTRUCTIONS RELOC: TYPE PREFIX DATA | |
221 // ------------ ---- ----------- | |
222 // sethi %hi(myObject), R oop_type [n(myObject)] | |
223 // ld [R+%lo(myObject)+fldOffset], R2 oop_type [n(myObject) fldOffset] | |
224 // add R2, 1, R2 | |
225 // st R2, [R+%lo(myObject)+fldOffset] oop_type [n(myObject) fldOffset] | |
226 //%note reloc_1 | |
227 // | |
228 // This uses 4 instruction words, 8 relocation halfwords, | |
229 // and an entry (which is sharable) in the CodeBlob's oop pool, | |
230 // for a total of 36 bytes. | |
231 // | |
232 // Note that the compiler is responsible for ensuring the "fldOffset" when | |
233 // added to "%lo(myObject)" does not overflow the immediate fields of the | |
234 // memory instructions. | |
235 // | |
236 // | |
237 // [About Offsets] Relative offsets are supplied to this module as | |
238 // positive byte offsets, but they may be internally stored scaled | |
239 // and/or negated, depending on what is most compact for the target | |
240 // system. Since the object pointed to by the offset typically | |
241 // precedes the relocation address, it is profitable to store | |
242 // these negative offsets as positive numbers, but this decision | |
243 // is internal to the relocation information abstractions. | |
244 // | |
245 | |
246 class Relocation; | |
247 class CodeBuffer; | |
248 class CodeSection; | |
249 class RelocIterator; | |
250 | |
251 class relocInfo VALUE_OBJ_CLASS_SPEC { | |
252 friend class RelocIterator; | |
253 public: | |
254 enum relocType { | |
255 none = 0, // Used when no relocation should be generated | |
256 oop_type = 1, // embedded oop | |
257 virtual_call_type = 2, // a standard inline cache call for a virtual send | |
258 opt_virtual_call_type = 3, // a virtual call that has been statically bound (i.e., no IC cache) | |
259 static_call_type = 4, // a static send | |
260 static_stub_type = 5, // stub-entry for static send (takes care of interpreter case) | |
261 runtime_call_type = 6, // call to fixed external routine | |
262 external_word_type = 7, // reference to fixed external address | |
263 internal_word_type = 8, // reference within the current code blob | |
264 section_word_type = 9, // internal, but a cross-section reference | |
265 poll_type = 10, // polling instruction for safepoints | |
266 poll_return_type = 11, // polling instruction for safepoints at return | |
11041 | 267 metadata_type = 12, // metadata that used to be oops |
268 yet_unused_type_1 = 13, // Still unused | |
0 | 269 yet_unused_type_2 = 14, // Still unused |
270 data_prefix_tag = 15, // tag for a prefix (carries data arguments) | |
271 type_mask = 15 // A mask which selects only the above values | |
272 }; | |
273 | |
274 protected: | |
275 unsigned short _value; | |
276 | |
277 enum RawBitsToken { RAW_BITS }; | |
278 relocInfo(relocType type, RawBitsToken ignore, int bits) | |
279 : _value((type << nontype_width) + bits) { } | |
280 | |
281 relocInfo(relocType type, RawBitsToken ignore, int off, int f) | |
282 : _value((type << nontype_width) + (off / (unsigned)offset_unit) + (f << offset_width)) { } | |
283 | |
284 public: | |
285 // constructor | |
286 relocInfo(relocType type, int offset, int format = 0) | |
287 #ifndef ASSERT | |
288 { | |
289 (*this) = relocInfo(type, RAW_BITS, offset, format); | |
290 } | |
291 #else | |
292 // Put a bunch of assertions out-of-line. | |
293 ; | |
294 #endif | |
295 | |
296 #define APPLY_TO_RELOCATIONS(visitor) \ | |
297 visitor(oop) \ | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
298 visitor(metadata) \ |
0 | 299 visitor(virtual_call) \ |
300 visitor(opt_virtual_call) \ | |
301 visitor(static_call) \ | |
302 visitor(static_stub) \ | |
303 visitor(runtime_call) \ | |
304 visitor(external_word) \ | |
305 visitor(internal_word) \ | |
306 visitor(poll) \ | |
307 visitor(poll_return) \ | |
308 visitor(section_word) \ | |
309 | |
310 | |
311 public: | |
312 enum { | |
313 value_width = sizeof(unsigned short) * BitsPerByte, | |
314 type_width = 4, // == log2(type_mask+1) | |
315 nontype_width = value_width - type_width, | |
316 datalen_width = nontype_width-1, | |
317 datalen_tag = 1 << datalen_width, // or-ed into _value | |
318 datalen_limit = 1 << datalen_width, | |
319 datalen_mask = (1 << datalen_width)-1 | |
320 }; | |
321 | |
322 // accessors | |
323 public: | |
324 relocType type() const { return (relocType)((unsigned)_value >> nontype_width); } | |
325 int format() const { return format_mask==0? 0: format_mask & | |
326 ((unsigned)_value >> offset_width); } | |
327 int addr_offset() const { assert(!is_prefix(), "must have offset"); | |
328 return (_value & offset_mask)*offset_unit; } | |
329 | |
330 protected: | |
331 const short* data() const { assert(is_datalen(), "must have data"); | |
332 return (const short*)(this + 1); } | |
333 int datalen() const { assert(is_datalen(), "must have data"); | |
334 return (_value & datalen_mask); } | |
335 int immediate() const { assert(is_immediate(), "must have immed"); | |
336 return (_value & datalen_mask); } | |
337 public: | |
338 static int addr_unit() { return offset_unit; } | |
339 static int offset_limit() { return (1 << offset_width) * offset_unit; } | |
340 | |
341 void set_type(relocType type); | |
342 void set_format(int format); | |
343 | |
344 void remove() { set_type(none); } | |
345 | |
346 protected: | |
347 bool is_none() const { return type() == none; } | |
348 bool is_prefix() const { return type() == data_prefix_tag; } | |
349 bool is_datalen() const { assert(is_prefix(), "must be prefix"); | |
350 return (_value & datalen_tag) != 0; } | |
351 bool is_immediate() const { assert(is_prefix(), "must be prefix"); | |
352 return (_value & datalen_tag) == 0; } | |
353 | |
354 public: | |
355 // Occasionally records of type relocInfo::none will appear in the stream. | |
356 // We do not bother to filter these out, but clients should ignore them. | |
357 // These records serve as "filler" in three ways: | |
358 // - to skip large spans of unrelocated code (this is rare) | |
359 // - to pad out the relocInfo array to the required oop alignment | |
360 // - to disable old relocation information which is no longer applicable | |
361 | |
362 inline friend relocInfo filler_relocInfo(); | |
363 | |
364 // Every non-prefix relocation may be preceded by at most one prefix, | |
365 // which supplies 1 or more halfwords of associated data. Conventionally, | |
366 // an int is represented by 0, 1, or 2 halfwords, depending on how | |
367 // many bits are required to represent the value. (In addition, | |
368 // if the sole halfword is a 10-bit unsigned number, it is made | |
369 // "immediate" in the prefix header word itself. This optimization | |
370 // is invisible outside this module.) | |
371 | |
372 inline friend relocInfo prefix_relocInfo(int datalen = 0); | |
373 | |
374 protected: | |
375 // an immediate relocInfo optimizes a prefix with one 10-bit unsigned value | |
376 static relocInfo immediate_relocInfo(int data0) { | |
377 assert(fits_into_immediate(data0), "data0 in limits"); | |
378 return relocInfo(relocInfo::data_prefix_tag, RAW_BITS, data0); | |
379 } | |
380 static bool fits_into_immediate(int data0) { | |
381 return (data0 >= 0 && data0 < datalen_limit); | |
382 } | |
383 | |
384 public: | |
385 // Support routines for compilers. | |
386 | |
387 // This routine takes an infant relocInfo (unprefixed) and | |
388 // edits in its prefix, if any. It also updates dest.locs_end. | |
389 void initialize(CodeSection* dest, Relocation* reloc); | |
390 | |
391 // This routine updates a prefix and returns the limit pointer. | |
392 // It tries to compress the prefix from 32 to 16 bits, and if | |
393 // successful returns a reduced "prefix_limit" pointer. | |
394 relocInfo* finish_prefix(short* prefix_limit); | |
395 | |
396 // bit-packers for the data array: | |
397 | |
398 // As it happens, the bytes within the shorts are ordered natively, | |
399 // but the shorts within the word are ordered big-endian. | |
400 // This is an arbitrary choice, made this way mainly to ease debugging. | |
401 static int data0_from_int(jint x) { return x >> value_width; } | |
402 static int data1_from_int(jint x) { return (short)x; } | |
403 static jint jint_from_data(short* data) { | |
404 return (data[0] << value_width) + (unsigned short)data[1]; | |
405 } | |
406 | |
407 static jint short_data_at(int n, short* data, int datalen) { | |
408 return datalen > n ? data[n] : 0; | |
409 } | |
410 | |
411 static jint jint_data_at(int n, short* data, int datalen) { | |
412 return datalen > n+1 ? jint_from_data(&data[n]) : short_data_at(n, data, datalen); | |
413 } | |
414 | |
415 // Update methods for relocation information | |
416 // (since code is dynamically patched, we also need to dynamically update the relocation info) | |
417 // Both methods takes old_type, so it is able to performe sanity checks on the information removed. | |
418 static void change_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type, relocType new_type); | |
419 static void remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type); | |
420 | |
421 // Machine dependent stuff | |
1972 | 422 #ifdef TARGET_ARCH_x86 |
423 # include "relocInfo_x86.hpp" | |
424 #endif | |
425 #ifdef TARGET_ARCH_sparc | |
426 # include "relocInfo_sparc.hpp" | |
427 #endif | |
428 #ifdef TARGET_ARCH_zero | |
429 # include "relocInfo_zero.hpp" | |
430 #endif | |
2192
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
431 #ifdef TARGET_ARCH_arm |
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
432 # include "relocInfo_arm.hpp" |
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
433 #endif |
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
434 #ifdef TARGET_ARCH_ppc |
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
435 # include "relocInfo_ppc.hpp" |
b92c45f2bc75
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
1972
diff
changeset
|
436 #endif |
1972 | 437 |
0 | 438 |
439 protected: | |
440 // Derived constant, based on format_width which is PD: | |
441 enum { | |
442 offset_width = nontype_width - format_width, | |
443 offset_mask = (1<<offset_width) - 1, | |
444 format_mask = (1<<format_width) - 1 | |
445 }; | |
446 public: | |
447 enum { | |
448 // Conservatively large estimate of maximum length (in shorts) | |
11041 | 449 // of any relocation record. |
0 | 450 // Extended format is length prefix, data words, and tag/offset suffix. |
451 length_limit = 1 + 1 + (3*BytesPerWord/BytesPerShort) + 1, | |
452 have_format = format_width > 0 | |
453 }; | |
454 }; | |
455 | |
456 #define FORWARD_DECLARE_EACH_CLASS(name) \ | |
457 class name##_Relocation; | |
458 APPLY_TO_RELOCATIONS(FORWARD_DECLARE_EACH_CLASS) | |
459 #undef FORWARD_DECLARE_EACH_CLASS | |
460 | |
461 | |
462 | |
463 inline relocInfo filler_relocInfo() { | |
464 return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit); | |
465 } | |
466 | |
467 inline relocInfo prefix_relocInfo(int datalen) { | |
468 assert(relocInfo::fits_into_immediate(datalen), "datalen in limits"); | |
469 return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen); | |
470 } | |
471 | |
472 | |
473 // Holder for flyweight relocation objects. | |
474 // Although the flyweight subclasses are of varying sizes, | |
475 // the holder is "one size fits all". | |
476 class RelocationHolder VALUE_OBJ_CLASS_SPEC { | |
477 friend class Relocation; | |
478 friend class CodeSection; | |
479 | |
480 private: | |
481 // this preallocated memory must accommodate all subclasses of Relocation | |
482 // (this number is assertion-checked in Relocation::operator new) | |
483 enum { _relocbuf_size = 5 }; | |
484 void* _relocbuf[ _relocbuf_size ]; | |
485 | |
486 public: | |
487 Relocation* reloc() const { return (Relocation*) &_relocbuf[0]; } | |
488 inline relocInfo::relocType type() const; | |
489 | |
490 // Add a constant offset to a relocation. Helper for class Address. | |
491 RelocationHolder plus(int offset) const; | |
492 | |
493 inline RelocationHolder(); // initializes type to none | |
494 | |
495 inline RelocationHolder(Relocation* r); // make a copy | |
496 | |
497 static const RelocationHolder none; | |
498 }; | |
499 | |
500 // A RelocIterator iterates through the relocation information of a CodeBlob. | |
501 // It is a variable BoundRelocation which is able to take on successive | |
502 // values as it is advanced through a code stream. | |
503 // Usage: | |
504 // RelocIterator iter(nm); | |
505 // while (iter.next()) { | |
506 // iter.reloc()->some_operation(); | |
507 // } | |
508 // or: | |
509 // RelocIterator iter(nm); | |
510 // while (iter.next()) { | |
511 // switch (iter.type()) { | |
512 // case relocInfo::oop_type : | |
513 // case relocInfo::ic_type : | |
514 // case relocInfo::prim_type : | |
515 // case relocInfo::uncommon_type : | |
516 // case relocInfo::runtime_call_type : | |
517 // case relocInfo::internal_word_type: | |
518 // case relocInfo::external_word_type: | |
519 // ... | |
520 // } | |
521 // } | |
522 | |
523 class RelocIterator : public StackObj { | |
1762
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
524 enum { SECT_LIMIT = 3 }; // must be equal to CodeBuffer::SECT_LIMIT, checked in ctor |
0 | 525 friend class Relocation; |
526 friend class relocInfo; // for change_reloc_info_for_address only | |
527 typedef relocInfo::relocType relocType; | |
528 | |
529 private: | |
530 address _limit; // stop producing relocations after this _addr | |
531 relocInfo* _current; // the current relocation information | |
532 relocInfo* _end; // end marker; we're done iterating when _current == _end | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
533 nmethod* _code; // compiled method containing _addr |
0 | 534 address _addr; // instruction to which the relocation applies |
535 short _databuf; // spare buffer for compressed data | |
536 short* _data; // pointer to the relocation's data | |
537 short _datalen; // number of halfwords in _data | |
538 char _format; // position within the instruction | |
539 | |
540 // Base addresses needed to compute targets of section_word_type relocs. | |
541 address _section_start[SECT_LIMIT]; | |
1762
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
542 address _section_end [SECT_LIMIT]; |
0 | 543 |
544 void set_has_current(bool b) { | |
545 _datalen = !b ? -1 : 0; | |
546 debug_only(_data = NULL); | |
547 } | |
548 void set_current(relocInfo& ri) { | |
549 _current = &ri; | |
550 set_has_current(true); | |
551 } | |
552 | |
553 RelocationHolder _rh; // where the current relocation is allocated | |
554 | |
555 relocInfo* current() const { assert(has_current(), "must have current"); | |
556 return _current; } | |
557 | |
558 void set_limits(address begin, address limit); | |
559 | |
560 void advance_over_prefix(); // helper method | |
561 | |
1762
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
562 void initialize_misc(); |
0 | 563 |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
564 void initialize(nmethod* nm, address begin, address limit); |
0 | 565 |
566 RelocIterator() { initialize_misc(); } | |
567 | |
568 public: | |
569 // constructor | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
570 RelocIterator(nmethod* nm, address begin = NULL, address limit = NULL); |
0 | 571 RelocIterator(CodeSection* cb, address begin = NULL, address limit = NULL); |
572 | |
573 // get next reloc info, return !eos | |
574 bool next() { | |
575 _current++; | |
576 assert(_current <= _end, "must not overrun relocInfo"); | |
577 if (_current == _end) { | |
578 set_has_current(false); | |
579 return false; | |
580 } | |
581 set_has_current(true); | |
582 | |
583 if (_current->is_prefix()) { | |
584 advance_over_prefix(); | |
585 assert(!current()->is_prefix(), "only one prefix at a time"); | |
586 } | |
587 | |
588 _addr += _current->addr_offset(); | |
589 | |
590 if (_limit != NULL && _addr >= _limit) { | |
591 set_has_current(false); | |
592 return false; | |
593 } | |
594 | |
595 if (relocInfo::have_format) _format = current()->format(); | |
596 return true; | |
597 } | |
598 | |
599 // accessors | |
600 address limit() const { return _limit; } | |
601 void set_limit(address x); | |
602 relocType type() const { return current()->type(); } | |
603 int format() const { return (relocInfo::have_format) ? current()->format() : 0; } | |
604 address addr() const { return _addr; } | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
605 nmethod* code() const { return _code; } |
0 | 606 short* data() const { return _data; } |
607 int datalen() const { return _datalen; } | |
608 bool has_current() const { return _datalen >= 0; } | |
609 | |
610 void set_addr(address addr) { _addr = addr; } | |
1762
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
611 bool addr_in_const() const; |
0 | 612 |
613 address section_start(int n) const { | |
1762
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
614 assert(_section_start[n], "must be initialized"); |
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
615 return _section_start[n]; |
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
616 } |
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
617 address section_end(int n) const { |
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
618 assert(_section_end[n], "must be initialized"); |
0878d7bae69f
6961697: move nmethod constants section before instruction section
twisti
parents:
1579
diff
changeset
|
619 return _section_end[n]; |
0 | 620 } |
621 | |
622 // The address points to the affected displacement part of the instruction. | |
623 // For RISC, this is just the whole instruction. | |
624 // For Intel, this is an unaligned 32-bit word. | |
625 | |
626 // type-specific relocation accessors: oop_Relocation* oop_reloc(), etc. | |
627 #define EACH_TYPE(name) \ | |
628 inline name##_Relocation* name##_reloc(); | |
629 APPLY_TO_RELOCATIONS(EACH_TYPE) | |
630 #undef EACH_TYPE | |
631 // generic relocation accessor; switches on type to call the above | |
632 Relocation* reloc(); | |
633 | |
634 // CodeBlob's have relocation indexes for faster random access: | |
635 static int locs_and_index_size(int code_size, int locs_size); | |
636 // Store an index into [dest_start+dest_count..dest_end). | |
637 // At dest_start[0..dest_count] is the actual relocation information. | |
638 // Everything else up to dest_end is free space for the index. | |
639 static void create_index(relocInfo* dest_begin, int dest_count, relocInfo* dest_end); | |
640 | |
641 #ifndef PRODUCT | |
642 public: | |
643 void print(); | |
644 void print_current(); | |
645 #endif | |
646 }; | |
647 | |
648 | |
649 // A Relocation is a flyweight object allocated within a RelocationHolder. | |
650 // It represents the relocation data of relocation record. | |
651 // So, the RelocIterator unpacks relocInfos into Relocations. | |
652 | |
653 class Relocation VALUE_OBJ_CLASS_SPEC { | |
654 friend class RelocationHolder; | |
655 friend class RelocIterator; | |
656 | |
657 private: | |
658 static void guarantee_size(); | |
659 | |
660 // When a relocation has been created by a RelocIterator, | |
661 // this field is non-null. It allows the relocation to know | |
662 // its context, such as the address to which it applies. | |
663 RelocIterator* _binding; | |
664 | |
665 protected: | |
666 RelocIterator* binding() const { | |
667 assert(_binding != NULL, "must be bound"); | |
668 return _binding; | |
669 } | |
670 void set_binding(RelocIterator* b) { | |
671 assert(_binding == NULL, "must be unbound"); | |
672 _binding = b; | |
673 assert(_binding != NULL, "must now be bound"); | |
674 } | |
675 | |
676 Relocation() { | |
677 _binding = NULL; | |
678 } | |
679 | |
680 static RelocationHolder newHolder() { | |
681 return RelocationHolder(); | |
682 } | |
683 | |
684 public: | |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
11041
diff
changeset
|
685 void* operator new(size_t size, const RelocationHolder& holder) throw() { |
0 | 686 if (size > sizeof(holder._relocbuf)) guarantee_size(); |
687 assert((void* const *)holder.reloc() == &holder._relocbuf[0], "ptrs must agree"); | |
688 return holder.reloc(); | |
689 } | |
690 | |
691 // make a generic relocation for a given type (if possible) | |
692 static RelocationHolder spec_simple(relocInfo::relocType rtype); | |
693 | |
694 // here is the type-specific hook which writes relocation data: | |
695 virtual void pack_data_to(CodeSection* dest) { } | |
696 | |
697 // here is the type-specific hook which reads (unpacks) relocation data: | |
698 virtual void unpack_data() { | |
699 assert(datalen()==0 || type()==relocInfo::none, "no data here"); | |
700 } | |
701 | |
2455
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
702 static bool is_reloc_index(intptr_t index) { |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
703 return 0 < index && index < os::vm_page_size(); |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
704 } |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
705 |
0 | 706 protected: |
707 // Helper functions for pack_data_to() and unpack_data(). | |
708 | |
709 // Most of the compression logic is confined here. | |
710 // (The "immediate data" mechanism of relocInfo works independently | |
711 // of this stuff, and acts to further compress most 1-word data prefixes.) | |
712 | |
713 // A variable-width int is encoded as a short if it will fit in 16 bits. | |
714 // The decoder looks at datalen to decide whether to unpack short or jint. | |
715 // Most relocation records are quite simple, containing at most two ints. | |
716 | |
717 static bool is_short(jint x) { return x == (short)x; } | |
718 static short* add_short(short* p, int x) { *p++ = x; return p; } | |
719 static short* add_jint (short* p, jint x) { | |
720 *p++ = relocInfo::data0_from_int(x); *p++ = relocInfo::data1_from_int(x); | |
721 return p; | |
722 } | |
723 static short* add_var_int(short* p, jint x) { // add a variable-width int | |
724 if (is_short(x)) p = add_short(p, x); | |
725 else p = add_jint (p, x); | |
726 return p; | |
727 } | |
728 | |
729 static short* pack_1_int_to(short* p, jint x0) { | |
730 // Format is one of: [] [x] [Xx] | |
731 if (x0 != 0) p = add_var_int(p, x0); | |
732 return p; | |
733 } | |
734 int unpack_1_int() { | |
735 assert(datalen() <= 2, "too much data"); | |
736 return relocInfo::jint_data_at(0, data(), datalen()); | |
737 } | |
738 | |
739 // With two ints, the short form is used only if both ints are short. | |
740 short* pack_2_ints_to(short* p, jint x0, jint x1) { | |
741 // Format is one of: [] [x y?] [Xx Y?y] | |
742 if (x0 == 0 && x1 == 0) { | |
743 // no halfwords needed to store zeroes | |
744 } else if (is_short(x0) && is_short(x1)) { | |
745 // 1-2 halfwords needed to store shorts | |
746 p = add_short(p, x0); if (x1!=0) p = add_short(p, x1); | |
747 } else { | |
748 // 3-4 halfwords needed to store jints | |
749 p = add_jint(p, x0); p = add_var_int(p, x1); | |
750 } | |
751 return p; | |
752 } | |
753 void unpack_2_ints(jint& x0, jint& x1) { | |
754 int dlen = datalen(); | |
755 short* dp = data(); | |
756 if (dlen <= 2) { | |
757 x0 = relocInfo::short_data_at(0, dp, dlen); | |
758 x1 = relocInfo::short_data_at(1, dp, dlen); | |
759 } else { | |
760 assert(dlen <= 4, "too much data"); | |
761 x0 = relocInfo::jint_data_at(0, dp, dlen); | |
762 x1 = relocInfo::jint_data_at(2, dp, dlen); | |
763 } | |
764 } | |
765 | |
766 protected: | |
767 // platform-dependent utilities for decoding and patching instructions | |
2375
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
768 void pd_set_data_value (address x, intptr_t off, bool verify_only = false); // a set or mem-ref |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
769 void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); } |
0 | 770 address pd_call_destination (address orig_addr = NULL); |
771 void pd_set_call_destination (address x); | |
772 | |
773 // this extracts the address of an address in the code stream instead of the reloc data | |
774 address* pd_address_in_code (); | |
775 | |
776 // this extracts an address from the code stream instead of the reloc data | |
777 address pd_get_address_from_code (); | |
778 | |
779 // these convert from byte offsets, to scaled offsets, to addresses | |
780 static jint scaled_offset(address x, address base) { | |
781 int byte_offset = x - base; | |
782 int offset = -byte_offset / relocInfo::addr_unit(); | |
783 assert(address_from_scaled_offset(offset, base) == x, "just checkin'"); | |
784 return offset; | |
785 } | |
786 static jint scaled_offset_null_special(address x, address base) { | |
787 // Some relocations treat offset=0 as meaning NULL. | |
788 // Handle this extra convention carefully. | |
789 if (x == NULL) return 0; | |
790 assert(x != base, "offset must not be zero"); | |
791 return scaled_offset(x, base); | |
792 } | |
793 static address address_from_scaled_offset(jint offset, address base) { | |
794 int byte_offset = -( offset * relocInfo::addr_unit() ); | |
795 return base + byte_offset; | |
796 } | |
797 | |
798 // these convert between indexes and addresses in the runtime system | |
799 static int32_t runtime_address_to_index(address runtime_address); | |
800 static address index_to_runtime_address(int32_t index); | |
801 | |
802 // helpers for mapping between old and new addresses after a move or resize | |
803 address old_addr_for(address newa, const CodeBuffer* src, CodeBuffer* dest); | |
804 address new_addr_for(address olda, const CodeBuffer* src, CodeBuffer* dest); | |
805 void normalize_address(address& addr, const CodeSection* dest, bool allow_other_sections = false); | |
806 | |
807 public: | |
808 // accessors which only make sense for a bound Relocation | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
809 address addr() const { return binding()->addr(); } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
810 nmethod* code() const { return binding()->code(); } |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
811 bool addr_in_const() const { return binding()->addr_in_const(); } |
0 | 812 protected: |
813 short* data() const { return binding()->data(); } | |
814 int datalen() const { return binding()->datalen(); } | |
815 int format() const { return binding()->format(); } | |
816 | |
817 public: | |
818 virtual relocInfo::relocType type() { return relocInfo::none; } | |
819 | |
820 // is it a call instruction? | |
821 virtual bool is_call() { return false; } | |
822 | |
823 // is it a data movement instruction? | |
824 virtual bool is_data() { return false; } | |
825 | |
826 // some relocations can compute their own values | |
827 virtual address value(); | |
828 | |
829 // all relocations are able to reassert their values | |
830 virtual void set_value(address x); | |
831 | |
832 virtual void clear_inline_cache() { } | |
833 | |
834 // This method assumes that all virtual/static (inline) caches are cleared (since for static_call_type and | |
835 // ic_call_type is not always posisition dependent (depending on the state of the cache)). However, this is | |
836 // probably a reasonable assumption, since empty caches simplifies code reloacation. | |
837 virtual void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { } | |
838 | |
839 void print(); | |
840 }; | |
841 | |
842 | |
843 // certain inlines must be deferred until class Relocation is defined: | |
844 | |
845 inline RelocationHolder::RelocationHolder() { | |
846 // initialize the vtbl, just to keep things type-safe | |
847 new(*this) Relocation(); | |
848 } | |
849 | |
850 | |
851 inline RelocationHolder::RelocationHolder(Relocation* r) { | |
852 // wordwise copy from r (ok if it copies garbage after r) | |
853 for (int i = 0; i < _relocbuf_size; i++) { | |
854 _relocbuf[i] = ((void**)r)[i]; | |
855 } | |
856 } | |
857 | |
858 | |
859 relocInfo::relocType RelocationHolder::type() const { | |
860 return reloc()->type(); | |
861 } | |
862 | |
863 // A DataRelocation always points at a memory or load-constant instruction.. | |
864 // It is absolute on most machines, and the constant is split on RISCs. | |
865 // The specific subtypes are oop, external_word, and internal_word. | |
866 // By convention, the "value" does not include a separately reckoned "offset". | |
867 class DataRelocation : public Relocation { | |
868 public: | |
869 bool is_data() { return true; } | |
870 | |
871 // both target and offset must be computed somehow from relocation data | |
872 virtual int offset() { return 0; } | |
873 address value() = 0; | |
874 void set_value(address x) { set_value(x, offset()); } | |
875 void set_value(address x, intptr_t o) { | |
876 if (addr_in_const()) | |
877 *(address*)addr() = x; | |
878 else | |
879 pd_set_data_value(x, o); | |
880 } | |
2375
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
881 void verify_value(address x) { |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
882 if (addr_in_const()) |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
883 assert(*(address*)addr() == x, "must agree"); |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
884 else |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
885 pd_verify_data_value(x, offset()); |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
886 } |
0 | 887 |
888 // The "o" (displacement) argument is relevant only to split relocations | |
889 // on RISC machines. In some CPUs (SPARC), the set-hi and set-lo ins'ns | |
890 // can encode more than 32 bits between them. This allows compilers to | |
891 // share set-hi instructions between addresses that differ by a small | |
892 // offset (e.g., different static variables in the same class). | |
893 // On such machines, the "x" argument to set_value on all set-lo | |
894 // instructions must be the same as the "x" argument for the | |
895 // corresponding set-hi instructions. The "o" arguments for the | |
896 // set-hi instructions are ignored, and must not affect the high-half | |
897 // immediate constant. The "o" arguments for the set-lo instructions are | |
898 // added into the low-half immediate constant, and must not overflow it. | |
899 }; | |
900 | |
901 // A CallRelocation always points at a call instruction. | |
902 // It is PC-relative on most machines. | |
903 class CallRelocation : public Relocation { | |
904 public: | |
905 bool is_call() { return true; } | |
906 | |
907 address destination() { return pd_call_destination(); } | |
908 void set_destination(address x); // pd_set_call_destination | |
909 | |
910 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); | |
911 address value() { return destination(); } | |
912 void set_value(address x) { set_destination(x); } | |
913 }; | |
914 | |
915 class oop_Relocation : public DataRelocation { | |
916 relocInfo::relocType type() { return relocInfo::oop_type; } | |
917 | |
918 public: | |
919 // encode in one of these formats: [] [n] [n l] [Nn l] [Nn Ll] | |
920 // an oop in the CodeBlob's oop pool | |
921 static RelocationHolder spec(int oop_index, int offset = 0) { | |
922 assert(oop_index > 0, "must be a pool-resident oop"); | |
923 RelocationHolder rh = newHolder(); | |
924 new(rh) oop_Relocation(oop_index, offset); | |
925 return rh; | |
926 } | |
927 // an oop in the instruction stream | |
928 static RelocationHolder spec_for_immediate() { | |
929 const int oop_index = 0; | |
930 const int offset = 0; // if you want an offset, use the oop pool | |
931 RelocationHolder rh = newHolder(); | |
932 new(rh) oop_Relocation(oop_index, offset); | |
933 return rh; | |
934 } | |
935 | |
936 private: | |
937 jint _oop_index; // if > 0, index into CodeBlob::oop_at | |
938 jint _offset; // byte offset to apply to the oop itself | |
939 | |
940 oop_Relocation(int oop_index, int offset) { | |
941 _oop_index = oop_index; _offset = offset; | |
942 } | |
943 | |
944 friend class RelocIterator; | |
945 oop_Relocation() { } | |
946 | |
947 public: | |
948 int oop_index() { return _oop_index; } | |
949 int offset() { return _offset; } | |
950 | |
951 // data is packed in "2_ints" format: [i o] or [Ii Oo] | |
952 void pack_data_to(CodeSection* dest); | |
953 void unpack_data(); | |
954 | |
955 void fix_oop_relocation(); // reasserts oop value | |
956 | |
2375
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
957 void verify_oop_relocation(); |
d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
never
parents:
2192
diff
changeset
|
958 |
0 | 959 address value() { return (address) *oop_addr(); } |
960 | |
961 bool oop_is_immediate() { return oop_index() == 0; } | |
962 | |
963 oop* oop_addr(); // addr or &pool[jint_data] | |
964 oop oop_value(); // *oop_addr | |
965 // Note: oop_value transparently converts Universe::non_oop_word to NULL. | |
966 }; | |
967 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
968 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
969 // copy of oop_Relocation for now but may delete stuff in both/either |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
970 class metadata_Relocation : public DataRelocation { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
971 relocInfo::relocType type() { return relocInfo::metadata_type; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
972 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
973 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
974 // encode in one of these formats: [] [n] [n l] [Nn l] [Nn Ll] |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
975 // an metadata in the CodeBlob's metadata pool |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
976 static RelocationHolder spec(int metadata_index, int offset = 0) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
977 assert(metadata_index > 0, "must be a pool-resident metadata"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
978 RelocationHolder rh = newHolder(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
979 new(rh) metadata_Relocation(metadata_index, offset); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
980 return rh; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
981 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
982 // an metadata in the instruction stream |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
983 static RelocationHolder spec_for_immediate() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
984 const int metadata_index = 0; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
985 const int offset = 0; // if you want an offset, use the metadata pool |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
986 RelocationHolder rh = newHolder(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
987 new(rh) metadata_Relocation(metadata_index, offset); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
988 return rh; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
989 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
990 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
991 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
992 jint _metadata_index; // if > 0, index into nmethod::metadata_at |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
993 jint _offset; // byte offset to apply to the metadata itself |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
994 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
995 metadata_Relocation(int metadata_index, int offset) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
996 _metadata_index = metadata_index; _offset = offset; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
997 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
998 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
999 friend class RelocIterator; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1000 metadata_Relocation() { } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1001 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1002 // Fixes a Metadata pointer in the code. Most platforms embeds the |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1003 // Metadata pointer in the code at compile time so this is empty |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1004 // for them. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1005 void pd_fix_value(address x); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1006 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1007 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1008 int metadata_index() { return _metadata_index; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1009 int offset() { return _offset; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1010 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1011 // data is packed in "2_ints" format: [i o] or [Ii Oo] |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1012 void pack_data_to(CodeSection* dest); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1013 void unpack_data(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1014 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1015 void fix_metadata_relocation(); // reasserts metadata value |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1016 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1017 void verify_metadata_relocation(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1018 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1019 address value() { return (address) *metadata_addr(); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1020 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1021 bool metadata_is_immediate() { return metadata_index() == 0; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1022 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1023 Metadata** metadata_addr(); // addr or &pool[jint_data] |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1024 Metadata* metadata_value(); // *metadata_addr |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1025 // Note: metadata_value transparently converts Universe::non_metadata_word to NULL. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1026 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1027 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1028 |
0 | 1029 class virtual_call_Relocation : public CallRelocation { |
1030 relocInfo::relocType type() { return relocInfo::virtual_call_type; } | |
1031 | |
1032 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1033 // "cached_value" points to the first associated set-oop. |
0 | 1034 // The oop_limit helps find the last associated set-oop. |
1035 // (See comments at the top of this file.) | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1036 static RelocationHolder spec(address cached_value) { |
0 | 1037 RelocationHolder rh = newHolder(); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1038 new(rh) virtual_call_Relocation(cached_value); |
0 | 1039 return rh; |
1040 } | |
1041 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1042 virtual_call_Relocation(address cached_value) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1043 _cached_value = cached_value; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1044 assert(cached_value != NULL, "first oop address must be specified"); |
0 | 1045 } |
1046 | |
1047 private: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1048 address _cached_value; // location of set-value instruction |
0 | 1049 |
1050 friend class RelocIterator; | |
1051 virtual_call_Relocation() { } | |
1052 | |
1053 | |
1054 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2468
diff
changeset
|
1055 address cached_value(); |
0 | 1056 |
1057 // data is packed as scaled offsets in "2_ints" format: [f l] or [Ff Ll] | |
1058 // oop_limit is set to 0 if the limit falls somewhere within the call. | |
1059 // When unpacking, a zero oop_limit is taken to refer to the end of the call. | |
1060 // (This has the effect of bringing in the call's delay slot on SPARC.) | |
1061 void pack_data_to(CodeSection* dest); | |
1062 void unpack_data(); | |
1063 | |
1064 void clear_inline_cache(); | |
1065 }; | |
1066 | |
1067 | |
1068 class opt_virtual_call_Relocation : public CallRelocation { | |
1069 relocInfo::relocType type() { return relocInfo::opt_virtual_call_type; } | |
1070 | |
1071 public: | |
1072 static RelocationHolder spec() { | |
1073 RelocationHolder rh = newHolder(); | |
1074 new(rh) opt_virtual_call_Relocation(); | |
1075 return rh; | |
1076 } | |
1077 | |
1078 private: | |
1079 friend class RelocIterator; | |
1080 opt_virtual_call_Relocation() { } | |
1081 | |
1082 public: | |
1083 void clear_inline_cache(); | |
1084 | |
1085 // find the matching static_stub | |
1086 address static_stub(); | |
1087 }; | |
1088 | |
1089 | |
1090 class static_call_Relocation : public CallRelocation { | |
1091 relocInfo::relocType type() { return relocInfo::static_call_type; } | |
1092 | |
1093 public: | |
1094 static RelocationHolder spec() { | |
1095 RelocationHolder rh = newHolder(); | |
1096 new(rh) static_call_Relocation(); | |
1097 return rh; | |
1098 } | |
1099 | |
1100 private: | |
1101 friend class RelocIterator; | |
1102 static_call_Relocation() { } | |
1103 | |
1104 public: | |
1105 void clear_inline_cache(); | |
1106 | |
1107 // find the matching static_stub | |
1108 address static_stub(); | |
1109 }; | |
1110 | |
1111 class static_stub_Relocation : public Relocation { | |
1112 relocInfo::relocType type() { return relocInfo::static_stub_type; } | |
1113 | |
1114 public: | |
1115 static RelocationHolder spec(address static_call) { | |
1116 RelocationHolder rh = newHolder(); | |
1117 new(rh) static_stub_Relocation(static_call); | |
1118 return rh; | |
1119 } | |
1120 | |
1121 private: | |
1122 address _static_call; // location of corresponding static_call | |
1123 | |
1124 static_stub_Relocation(address static_call) { | |
1125 _static_call = static_call; | |
1126 } | |
1127 | |
1128 friend class RelocIterator; | |
1129 static_stub_Relocation() { } | |
1130 | |
1131 public: | |
1132 void clear_inline_cache(); | |
1133 | |
1134 address static_call() { return _static_call; } | |
1135 | |
1136 // data is packed as a scaled offset in "1_int" format: [c] or [Cc] | |
1137 void pack_data_to(CodeSection* dest); | |
1138 void unpack_data(); | |
1139 }; | |
1140 | |
1141 class runtime_call_Relocation : public CallRelocation { | |
1142 relocInfo::relocType type() { return relocInfo::runtime_call_type; } | |
1143 | |
1144 public: | |
1145 static RelocationHolder spec() { | |
1146 RelocationHolder rh = newHolder(); | |
1147 new(rh) runtime_call_Relocation(); | |
1148 return rh; | |
1149 } | |
1150 | |
1151 private: | |
1152 friend class RelocIterator; | |
1153 runtime_call_Relocation() { } | |
1154 | |
1155 public: | |
1156 }; | |
1157 | |
1158 class external_word_Relocation : public DataRelocation { | |
1159 relocInfo::relocType type() { return relocInfo::external_word_type; } | |
1160 | |
1161 public: | |
1162 static RelocationHolder spec(address target) { | |
1163 assert(target != NULL, "must not be null"); | |
1164 RelocationHolder rh = newHolder(); | |
1165 new(rh) external_word_Relocation(target); | |
1166 return rh; | |
1167 } | |
1168 | |
1169 // Use this one where all 32/64 bits of the target live in the code stream. | |
1170 // The target must be an intptr_t, and must be absolute (not relative). | |
1171 static RelocationHolder spec_for_immediate() { | |
1172 RelocationHolder rh = newHolder(); | |
1173 new(rh) external_word_Relocation(NULL); | |
1174 return rh; | |
1175 } | |
1176 | |
2455
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1177 // Some address looking values aren't safe to treat as relocations |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1178 // and should just be treated as constants. |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1179 static bool can_be_relocated(address target) { |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1180 return target != NULL && !is_reloc_index((intptr_t)target); |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1181 } |
479b4b4b6950
6777083: assert(target != __null,"must not be null")
never
parents:
2375
diff
changeset
|
1182 |
0 | 1183 private: |
1184 address _target; // address in runtime | |
1185 | |
1186 external_word_Relocation(address target) { | |
1187 _target = target; | |
1188 } | |
1189 | |
1190 friend class RelocIterator; | |
1191 external_word_Relocation() { } | |
1192 | |
1193 public: | |
1194 // data is packed as a well-known address in "1_int" format: [a] or [Aa] | |
1195 // The function runtime_address_to_index is used to turn full addresses | |
1196 // to short indexes, if they are pre-registered by the stub mechanism. | |
1197 // If the "a" value is 0 (i.e., _target is NULL), the address is stored | |
1198 // in the code stream. See external_word_Relocation::target(). | |
1199 void pack_data_to(CodeSection* dest); | |
1200 void unpack_data(); | |
1201 | |
1202 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); | |
1203 address target(); // if _target==NULL, fetch addr from code stream | |
1204 address value() { return target(); } | |
1205 }; | |
1206 | |
1207 class internal_word_Relocation : public DataRelocation { | |
1208 relocInfo::relocType type() { return relocInfo::internal_word_type; } | |
1209 | |
1210 public: | |
1211 static RelocationHolder spec(address target) { | |
1212 assert(target != NULL, "must not be null"); | |
1213 RelocationHolder rh = newHolder(); | |
1214 new(rh) internal_word_Relocation(target); | |
1215 return rh; | |
1216 } | |
1217 | |
1218 // use this one where all the bits of the target can fit in the code stream: | |
1219 static RelocationHolder spec_for_immediate() { | |
1220 RelocationHolder rh = newHolder(); | |
1221 new(rh) internal_word_Relocation(NULL); | |
1222 return rh; | |
1223 } | |
1224 | |
1225 internal_word_Relocation(address target) { | |
1226 _target = target; | |
1227 _section = -1; // self-relative | |
1228 } | |
1229 | |
1230 protected: | |
1231 address _target; // address in CodeBlob | |
1232 int _section; // section providing base address, if any | |
1233 | |
1234 friend class RelocIterator; | |
1235 internal_word_Relocation() { } | |
1236 | |
1237 // bit-width of LSB field in packed offset, if section >= 0 | |
1238 enum { section_width = 2 }; // must equal CodeBuffer::sect_bits | |
1239 | |
1240 public: | |
1241 // data is packed as a scaled offset in "1_int" format: [o] or [Oo] | |
1242 // If the "o" value is 0 (i.e., _target is NULL), the offset is stored | |
1243 // in the code stream. See internal_word_Relocation::target(). | |
1244 // If _section is not -1, it is appended to the low bits of the offset. | |
1245 void pack_data_to(CodeSection* dest); | |
1246 void unpack_data(); | |
1247 | |
1248 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); | |
1249 address target(); // if _target==NULL, fetch addr from code stream | |
1250 int section() { return _section; } | |
1251 address value() { return target(); } | |
1252 }; | |
1253 | |
1254 class section_word_Relocation : public internal_word_Relocation { | |
1255 relocInfo::relocType type() { return relocInfo::section_word_type; } | |
1256 | |
1257 public: | |
1258 static RelocationHolder spec(address target, int section) { | |
1259 RelocationHolder rh = newHolder(); | |
1260 new(rh) section_word_Relocation(target, section); | |
1261 return rh; | |
1262 } | |
1263 | |
1264 section_word_Relocation(address target, int section) { | |
1265 assert(target != NULL, "must not be null"); | |
1266 assert(section >= 0, "must be a valid section"); | |
1267 _target = target; | |
1268 _section = section; | |
1269 } | |
1270 | |
1271 //void pack_data_to -- inherited | |
1272 void unpack_data(); | |
1273 | |
1274 private: | |
1275 friend class RelocIterator; | |
1276 section_word_Relocation() { } | |
1277 }; | |
1278 | |
13553
d49f00604347
removed poll_Relocation::pollingForm type and associated data field and rely solely on format field of safepoint relocation entries when deciding whether or not to relocate the operand of a safepoint poll instruction
Doug Simon <doug.simon@oracle.com>
parents:
13515
diff
changeset
|
1279 |
0 | 1280 class poll_Relocation : public Relocation { |
13553
d49f00604347
removed poll_Relocation::pollingForm type and associated data field and rely solely on format field of safepoint relocation entries when deciding whether or not to relocate the operand of a safepoint poll instruction
Doug Simon <doug.simon@oracle.com>
parents:
13515
diff
changeset
|
1281 bool is_data() { return true; } |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
1282 relocInfo::relocType type() { return relocInfo::poll_type; } |
304 | 1283 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); |
0 | 1284 }; |
1285 | |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
12146
diff
changeset
|
1286 class poll_return_Relocation : public poll_Relocation { |
0 | 1287 relocInfo::relocType type() { return relocInfo::poll_return_type; } |
1288 }; | |
1289 | |
1290 // We know all the xxx_Relocation classes, so now we can define these: | |
1291 #define EACH_CASE(name) \ | |
1292 inline name##_Relocation* RelocIterator::name##_reloc() { \ | |
1293 assert(type() == relocInfo::name##_type, "type must agree"); \ | |
1294 /* The purpose of the placed "new" is to re-use the same */ \ | |
1295 /* stack storage for each new iteration. */ \ | |
1296 name##_Relocation* r = new(_rh) name##_Relocation(); \ | |
1297 r->set_binding(this); \ | |
1298 r->name##_Relocation::unpack_data(); \ | |
1299 return r; \ | |
1300 } | |
1301 APPLY_TO_RELOCATIONS(EACH_CASE); | |
1302 #undef EACH_CASE | |
1303 | |
1563
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
1304 inline RelocIterator::RelocIterator(nmethod* nm, address begin, address limit) { |
1a5913bf5e19
6951083: oops and relocations should part of nmethod not CodeBlob
twisti
parents:
337
diff
changeset
|
1305 initialize(nm, begin, limit); |
0 | 1306 } |
1307 | |
1972 | 1308 #endif // SHARE_VM_CODE_RELOCINFO_HPP |