From 73bc9c4c0bac5cb2750b8dad8ef4c5e334b9692d Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 9 Mar 2015 09:59:53 +0100 Subject: [PATCH] 8071731: Better scaling for C1 Reviewed-by: kvn, iveresov --- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index d2174df60cc..1c34e610496 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -2208,7 +2208,15 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) { if (log2_scale != 0) { // temporary fix (platform dependent code without shift on Intel would be better) // TODO: ARM also allows embedded shift in the address - __ shift_left(index_op, log2_scale, index_op); + LIR_Opr tmp = new_pointer_register(); + if (TwoOperandLIRForm) { + __ move(index_op, tmp); + index_op = tmp; + } + __ shift_left(index_op, log2_scale, tmp); + if (!TwoOperandLIRForm) { + index_op = tmp; + } } LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type());