Mercurial > hg > graal-jvmci-8
diff src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp @ 22590:3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Mon, 21 Sep 2015 15:01:13 +0200 |
parents | 02fc27dc1da7 |
children | ceca35d52380 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp Mon Sep 21 11:48:40 2015 +0200 +++ b/src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp Mon Sep 21 15:01:13 2015 +0200 @@ -83,6 +83,23 @@ } } +void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle& constant) { + address pc = _instructions->start() + pc_offset; + if (HotSpotMetaspaceConstantImpl::compressed(constant)) { +#ifdef _LP64 + address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand); + *((narrowKlass*) operand) = record_narrow_metadata_reference(constant); + TRACE_jvmci_3("relocating (narrow metaspace constant) at %p/%p", pc, operand); +#else + fatal("compressed Klass* on 32bit"); +#endif + } else { + address operand = Assembler::locate_operand(pc, Assembler::imm_operand); + *((Metadata**) operand) = record_metadata_reference(constant); + TRACE_jvmci_3("relocating (metaspace constant) at %p/%p", pc, operand); + } +} + void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) { address pc = _instructions->start() + pc_offset;