# HG changeset patch # User Christian Wimmer # Date 1323137725 28800 # Node ID 4e037604f6ee8e0baabee9a4e3fb28c0e0f6c816 # Parent 54915831e5650b02ee28a86a7f936a07e1f6542b use alignment for constants specified in DataPatch.alignment diff -r 54915831e565 -r 4e037604f6ee src/share/vm/graal/graalCodeInstaller.cpp --- 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); diff -r 54915831e565 -r 4e037604f6ee src/share/vm/graal/graalJavaAccess.hpp --- 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;") \