annotate src/share/vm/code/relocInfo.hpp @ 21205:f34ae5c01864

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