Mercurial > hg > truffle
changeset 3710:4e037604f6ee
use alignment for constants specified in DataPatch.alignment
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 05 Dec 2011 18:15:25 -0800 |
parents | 54915831e565 |
children | 5711f2ab6c7c d6a0c46a73b2 |
files | src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalJavaAccess.hpp |
diffstat | 2 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/graal/graalCodeInstaller.cpp Mon Dec 05 20:00:57 2011 +0100 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Mon Dec 05 18:15:25 2011 -0800 @@ -735,6 +735,7 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) { oop constant = CiTargetMethod_DataPatch::constant(site); + int alignment = CiTargetMethod_DataPatch::alignment(site); oop kind = CiConstant::kind(constant); address instruction = _instructions->start() + pc_offset; @@ -754,11 +755,12 @@ case 'd': { address operand = Assembler::locate_operand(instruction, Assembler::disp32_operand); address next_instruction = Assembler::locate_next_instruction(instruction); + int size = _constants->size(); + if (alignment > 0) { + guarantee(alignment <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin"); + size = align_size_up(size, alignment); + } // we don't care if this is a long/double/etc., the primitive field contains the right bits - int size = _constants->size(); - if (typeChar == 'd' || typeChar == 'j') { - size = _constants->align_at_start(size); - } address dest = _constants->start() + size; _constants->set_end(dest + BytesPerLong); *(jlong*) dest = CiConstant::primitive(constant);
--- a/src/share/vm/graal/graalJavaAccess.hpp Mon Dec 05 20:00:57 2011 +0100 +++ b/src/share/vm/graal/graalJavaAccess.hpp Mon Dec 05 18:15:25 2011 -0800 @@ -125,6 +125,7 @@ end_class \ start_class(CiTargetMethod_DataPatch) \ oop_field(CiTargetMethod_DataPatch, constant, "Lcom/sun/cri/ci/CiConstant;") \ + int_field(CiTargetMethod_DataPatch, alignment) \ end_class \ start_class(CiTargetMethod_Safepoint) \ oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;") \