Mercurial > hg > graal-compiler
changeset 7883:cc9b45598a4f
Change argument order to be consistent with the rest of the backend.
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Tue Feb 26 18:26:13 2013 +0100 @@ -140,12 +140,12 @@ @Override public Variable emitMove(Value input) { Variable result = newVariable(input.getKind()); - emitMove(input, result); + emitMove(result, input); return result; } @Override - public void emitMove(Value src, Value dst) { + public void emitMove(Value dst, Value src) { if (isRegister(src) || isStackSlot(dst)) { append(new MoveFromRegOp(dst, src)); } else { @@ -167,7 +167,7 @@ baseRegister = Value.ILLEGAL; } else { Value newBase = newVariable(Kind.Long); - emitMove(base, newBase); + emitMove(newBase, base); baseRegister = newBase; } } @@ -188,7 +188,7 @@ // create a temporary variable for the index, the pointer load cannot handle a // constant index Value newIndex = newVariable(Kind.Long); - emitMove(index, newIndex); + emitMove(newIndex, index); indexRegister = newIndex; } } @@ -460,11 +460,11 @@ public Value[] emitIntegerDivRem(Value a, Value b) { switch (a.getKind()) { case Int: - emitMove(a, RAX_I); + emitMove(RAX_I, a); append(new DivRemOp(IDIVREM, RAX_I, load(b), state())); return new Value[]{emitMove(RAX_I), emitMove(RDX_I)}; case Long: - emitMove(a, RAX_L); + emitMove(RAX_L, a); append(new DivRemOp(LDIVREM, RAX_L, load(b), state())); return new Value[]{emitMove(RAX_L), emitMove(RDX_L)}; default: @@ -476,11 +476,11 @@ public Value emitDiv(Value a, Value b) { switch (a.getKind()) { case Int: - emitMove(a, RAX_I); + emitMove(RAX_I, a); append(new DivOp(IDIV, RAX_I, RAX_I, load(b), state())); return emitMove(RAX_I); case Long: - emitMove(a, RAX_L); + emitMove(RAX_L, a); append(new DivOp(LDIV, RAX_L, RAX_L, load(b), state())); return emitMove(RAX_L); case Float: { @@ -502,11 +502,11 @@ public Value emitRem(Value a, Value b) { switch (a.getKind()) { case Int: - emitMove(a, RAX_I); + emitMove(RAX_I, a); append(new DivOp(IREM, RDX_I, RAX_I, load(b), state())); return emitMove(RDX_I); case Long: - emitMove(a, RAX_L); + emitMove(RAX_L, a); append(new DivOp(LREM, RDX_L, RAX_L, load(b), state())); return emitMove(RDX_L); case Float: { @@ -526,11 +526,11 @@ public Variable emitUDiv(Value a, Value b) { switch (a.getKind()) { case Int: - emitMove(a, RAX_I); + emitMove(RAX_I, a); append(new DivOp(IUDIV, RAX_I, RAX_I, load(b), state())); return emitMove(RAX_I); case Long: - emitMove(a, RAX_L); + emitMove(RAX_L, a); append(new DivOp(LUDIV, RAX_L, RAX_L, load(b), state())); return emitMove(RAX_L); default: @@ -542,11 +542,11 @@ public Variable emitURem(Value a, Value b) { switch (a.getKind()) { case Int: - emitMove(a, RAX_I); + emitMove(RAX_I, a); append(new DivOp(IUREM, RDX_I, RAX_I, load(b), state())); return emitMove(RDX_I); case Long: - emitMove(a, RAX_L); + emitMove(RAX_L, a); append(new DivOp(LUREM, RDX_L, RAX_L, load(b), state())); return emitMove(RDX_L); default: @@ -655,7 +655,7 @@ return value; } // Non-constant shift count must be in RCX - emitMove(value, RCX_I); + emitMove(RCX_I, value); return RCX_I; } @@ -725,7 +725,7 @@ // Instructions that move or generate 32-bit register values also set the upper 32 // bits of the register to zero. // Consequently, there is no need for a special zero-extension move. - emitMove(input, result); + emitMove(result, input); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -765,7 +765,7 @@ // The current register allocator cannot handle variables at call sites, need a fixed // register. Value targetAddress = AMD64.rax.asValue(); - emitMove(operand(callTarget.computedAddress()), targetAddress); + emitMove(targetAddress, operand(callTarget.computedAddress())); append(new IndirectCallOp(callTarget.target(), result, parameters, temps, targetAddress, callState)); } @@ -901,7 +901,7 @@ } RegisterValue rax = AMD64.rax.asValue(kind); - emitMove(expected, rax); + emitMove(rax, expected); append(new CompareAndSwapOp(rax, address, rax, newValue)); Variable result = newVariable(node.kind());
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Tue Feb 26 18:26:13 2013 +0100 @@ -101,12 +101,12 @@ @Override public Variable emitMove(Value input) { Variable result = newVariable(input.getKind()); - emitMove(input, result); + emitMove(result, input); return result; } @Override - public void emitMove(Value src, Value dst) { + public void emitMove(Value dst, Value src) { if (isRegister(src) || isStackSlot(dst)) { append(new MoveFromRegOp(dst, src)); } else {
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue Feb 26 18:26:13 2013 +0100 @@ -214,7 +214,7 @@ } @Override - public void emitMove(Value src, Value dst) { + public void emitMove(Value dst, Value src) { // SPARC: Auto-generated method stub }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Feb 26 18:26:13 2013 +0100 @@ -203,7 +203,7 @@ } if (storeKind == Kind.Byte || storeKind == Kind.Boolean) { Variable tempVar = new Variable(value.getKind(), lir.nextVariable(), Register.RegisterFlag.Byte); - emitMove(value, tempVar); + emitMove(tempVar, value); return tempVar; } return load(value); @@ -525,7 +525,7 @@ Value operand = Value.ILLEGAL; if (x.result() != null) { operand = resultOperandFor(x.result().kind()); - emitMove(operand(x.result()), operand); + emitMove(operand, operand(x.result())); } emitReturn(operand); } @@ -747,7 +747,7 @@ for (ValueNode arg : arguments) { if (arg != null) { Value operand = toStackKind(cc.getArgument(j)); - emitMove(operand(arg), operand); + emitMove(operand, operand(arg)); result[j] = operand; j++; } else { @@ -770,7 +770,7 @@ for (int i = 0; i < args.length; i++) { Value arg = args[i]; Value loc = cc.getArgument(i); - emitMove(arg, loc); + emitMove(loc, arg); argLocations[i] = loc; } emitCall(callTarget, cc.getReturn(), argLocations, cc.getTemporaries(), Constant.forLong(0), info);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java Tue Feb 26 18:26:13 2013 +0100 @@ -187,7 +187,7 @@ private void emitMove(Value src, Value dest) { assert isLegal(src); assert isLegal(dest); - gen.emitMove(src, dest); + gen.emitMove(dest, src); } // Traverse assignment graph in depth first order and generate moves in post order
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue Feb 26 18:26:13 2013 +0100 @@ -139,11 +139,11 @@ } RegisterValue rax = AMD64.rax.asValue(kind); - emitMove(expected, rax); + emitMove(rax, expected); append(new CompareAndSwapOp(rax, address, rax, newVal)); Variable result = newVariable(x.kind()); - emitMove(rax, result); + emitMove(result, rax); setResult(x, result); } @@ -161,9 +161,9 @@ @Override protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { Value metaspaceMethod = AMD64.rbx.asValue(); - emitMove(operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod()), metaspaceMethod); + emitMove(metaspaceMethod, operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod())); Value targetAddress = AMD64.rax.asValue(); - emitMove(operand(callTarget.computedAddress()), targetAddress); + emitMove(targetAddress, operand(callTarget.computedAddress())); append(new AMD64IndirectCallOp(callTarget.target(), result, parameters, temps, metaspaceMethod, targetAddress, callState)); } }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java Tue Feb 26 18:26:13 2013 +0100 @@ -41,7 +41,7 @@ @Override public void generate(LIRGeneratorTool generator) { Value obj = generator.newVariable(generator.target().wordKind); - generator.emitMove(generator.operand(object()), obj); + generator.emitMove(obj, generator.operand(object())); generateBarrier(obj, generator); } }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java Tue Feb 26 18:26:13 2013 +0100 @@ -47,7 +47,7 @@ @Override public void generate(LIRGeneratorTool gen) { Value obj = gen.newVariable(gen.target().wordKind); - gen.emitMove(gen.operand(object), obj); + gen.emitMove(obj, gen.operand(object)); gen.setResult(this, obj); } }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/RegisterNode.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/RegisterNode.java Tue Feb 26 18:26:13 2013 +0100 @@ -54,7 +54,7 @@ // The register allocator would prefer us not to tie up an allocatable // register for the complete lifetime of this node. result = generator.newVariable(kind()); - generator.emitMove(register.asValue(kind()), result); + generator.emitMove(result, register.asValue(kind())); } else { result = register.asValue(kind()); }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue Feb 26 18:26:13 2013 +0100 @@ -93,7 +93,7 @@ if (kind() != object.kind()) { assert generator.target().sizeInBytes(kind()) == generator.target().sizeInBytes(object.kind()) : "unsafe cast cannot be used to change the size of a value"; Value result = generator.newVariable(kind()); - generator.emitMove(generator.operand(object), result); + generator.emitMove(result, generator.operand(object)); generator.setResult(this, result); } else { // The LIR only cares about the kind of an operand, not the actual type of an object. So
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Tue Feb 26 18:26:12 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Tue Feb 26 18:26:13 2013 +0100 @@ -65,7 +65,7 @@ public abstract Value emitMove(Value input); - public abstract void emitMove(Value src, Value dst); + public abstract void emitMove(Value dst, Value src); public abstract Value emitLoad(Kind kind, Value base, int displacement, Value index, int scale, boolean canTrap);