src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54601 c40b2a190173
child 58679 9c3209ff7550
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java	Thu Oct 17 20:53:35 2019 +0100
@@ -30,6 +30,8 @@
 import java.util.Map;
 import java.util.function.Consumer;
 
+import org.graalvm.compiler.debug.GraalError;
+
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.TargetDescription;
@@ -160,11 +162,15 @@
         return codeBuffer.close(trimmedCopy);
     }
 
+    public byte[] copy(int start, int end) {
+        return codeBuffer.copyData(start, end);
+    }
+
     private void checkAndClearLabelsWithPatches() throws InternalError {
         Label label = labelsWithPatches;
         while (label != null) {
             if (label.patchPositions != null) {
-                throw new InternalError("Label used by instructions at following offsets has not been bound: " + label.patchPositions);
+                throw new GraalError("Label used by instructions at following offsets has not been bound: %s", label.patchPositions);
             }
             Label next = label.nextWithPatches;
             label.nextWithPatches = null;