hotspot/test/compiler/jvmci/code/TestAssembler.java
changeset 35591 35ab7c6816e9
parent 35582 c32a0cc19877
child 35823 59a847ec6ee3
--- a/hotspot/test/compiler/jvmci/code/TestAssembler.java	Fri Jan 22 12:37:32 2016 +0100
+++ b/hotspot/test/compiler/jvmci/code/TestAssembler.java	Thu Jan 21 16:22:01 2016 +0100
@@ -295,6 +295,15 @@
             data.putFloat(f);
         }
 
+        public void align(int alignment) {
+            int pos = data.position();
+            int misaligned = pos % alignment;
+            if (misaligned != 0) {
+                pos += alignment - misaligned;
+                data.position(pos);
+            }
+        }
+
         private byte[] finish() {
             return Arrays.copyOf(data.array(), data.position());
         }