From e7b9fb45d5550493972d74fbdd512f9712e5521c Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Sun, 28 Jun 2009 04:16:46 +0100 Subject: [PATCH] Avoid problems with moveable objects breaking LIR canonical form. --- rvm/src/org/jikesrvm/compilers/opt/Simplifier.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java b/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java index b8bdf7faa..707b16736 100644 --- a/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java +++ b/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java @@ -3837,20 +3837,20 @@ private static DefUseEffect refLoad(Instruction s, OptOptions opts) { } /** - * To reduce the number of conditions to consider, we - * transform all commutative - * operators to a canoncial form. The following forms are considered - * canonical: + * To reduce the number of conditions to consider, we transform all commutative + * operators to a canoncial form. The following forms are considered canonical: * + * For object constant operands we treat movable objects like registers. */ private static void canonicalizeCommutativeOperator(Instruction instr) { - if (Binary.getVal1(instr).isConstant()) { - Operand tmp = Binary.getClearVal1(instr); - Binary.setVal1(instr, Binary.getClearVal2(instr)); + Operand op1 = Binary.getVal1(instr); + if (op1.isConstant() && !op1.isMovableObjectConstant()) { + Operand tmp = Binary.getClearVal1(instr); + Binary.setVal1(instr, Binary.getClearVal2(instr)); Binary.setVal2(instr, tmp); } }