--- old/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java 2016-07-06 18:07:02.913645952 +0000 +++ new/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java 2016-07-06 18:07:02.813645946 +0000 @@ -28,10 +28,12 @@ import java.util.ArrayList; import java.util.Arrays; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.ValueKindFactory; import jdk.vm.ci.code.site.Call; import jdk.vm.ci.code.site.ConstantReference; import jdk.vm.ci.code.site.DataPatch; @@ -46,6 +48,7 @@ import jdk.vm.ci.hotspot.HotSpotCompiledNmethod; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.InvokeTarget; import jdk.vm.ci.meta.JavaKind; @@ -145,6 +148,11 @@ public abstract StackSlot emitFloatToStack(Register a); /** + * Emit code to store a double-precision float from a register to a new stack slot. + */ + public abstract StackSlot emitDoubleToStack(Register a); + + /** * Emit code to store a wide pointer from a register to a new stack slot. */ public abstract StackSlot emitPointerToStack(Register a); @@ -165,6 +173,11 @@ public abstract void emitIntRet(Register a); /** + * Emit code to return from a function, returning a single precision float. + */ + public abstract void emitFloatRet(Register a); + + /** * Emit code to return from a function, returning a wide oop pointer. */ public abstract void emitPointerRet(Register a); @@ -193,7 +206,13 @@ private StackSlot deoptRescue; - private static class TestValueKind extends ValueKind { + public ValueKindFactory valueKindFactory = new ValueKindFactory() { + public TestValueKind getValueKind(JavaKind javaKind) { + return (TestValueKind) TestAssembler.this.getValueKind(javaKind); + } + }; + + static class TestValueKind extends ValueKind { TestValueKind(PlatformKind kind) { super(kind); @@ -340,6 +359,11 @@ data.putFloat(f); } + public void emitDouble(double f) { + ensureSize(data.position() + 8); + data.putDouble(f); + } + public void align(int alignment) { int pos = data.position(); int misaligned = pos % alignment; @@ -353,4 +377,27 @@ return Arrays.copyOf(data.array(), data.position()); } } + + /** + * Loads a primitive into the Allocatable av. Implementors may only implement + * primitive types. + */ + public abstract void emitLoad(AllocatableValue av, Object prim); + + /** + * Emit a call to a fixed address addr + */ + public abstract void emitCall(long addr); + + /** + * Emit code which is necessary to call a method with {@link CallingConvention} cc + * and arguments prim. + */ + public abstract void emitCallPrologue(CallingConvention cc, Object... prim); + + /** + * Emit code which is necessary after calling a method with CallingConvention cc. + */ + public abstract void emitCallEpilogue(CallingConvention cc); + }