RFR(m): 8220351: Cross-modifying code
Andrew Haley
aph at redhat.com
Wed Mar 13 10:48:40 UTC 2019
Hi,
On 3/13/19 10:19 AM, Doerr, Martin wrote:
> mustIterateImmediateOopsInCode means that nmethods may contain oops
> in the instruction stream which are not in the nmethod's separately
> recorded oops section. This only occurs on x86.
> Other platforms use the oop recorder for such oops so they can be
> found there, too. So they can be referenced by the nmethod twice: in
> the separate section and in the instruction stream. This may be the
> case on aarch64 (not sure).
That's right. In more detail, mustIterateImmediateOopsInCode assumes
that inline oops can be patched with simple stores, i.e. that an
immediate move is an instruction followed by a separately-addressible
field that contains the word-sized address.
On AArch64, paching of oops is done by
void oop_Relocation::fix_oop_relocation() {
if (!oop_is_immediate()) {
// get the oop from the pool, and re-insert it into the instruction:
set_value(value());
|
v
DataRelocation::set_value
|
v
Relocation::pd_set_data_value
|
v
MacroAssembler::patch_oop
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list