--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp Wed Sep 19 16:50:26 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp Thu Sep 20 16:49:17 2012 +0200
@@ -347,7 +347,11 @@
inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); }
inline void Assembler::swap( Register s1, int simm13a, Register d) { v9_dep(); emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
-inline void Assembler::swap( Address& a, Register d, int offset ) { relocate(a.rspec(offset)); swap( a.base(), a.disp() + offset, d ); }
+inline void Assembler::swap( Address& a, Register d, int offset ) {
+ relocate(a.rspec(offset));
+ if (a.has_index()) { assert(offset == 0, ""); swap( a.base(), a.index(), d ); }
+ else { swap( a.base(), a.disp() + offset, d ); }
+}
// Use the right loads/stores for the platform