src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
equal
deleted
inserted
replaced
28 import java.util.HashMap; |
28 import java.util.HashMap; |
29 import java.util.List; |
29 import java.util.List; |
30 import java.util.Map; |
30 import java.util.Map; |
31 import java.util.function.Consumer; |
31 import java.util.function.Consumer; |
32 |
32 |
|
33 import org.graalvm.compiler.debug.GraalError; |
|
34 |
33 import jdk.vm.ci.code.Register; |
35 import jdk.vm.ci.code.Register; |
34 import jdk.vm.ci.code.StackSlot; |
36 import jdk.vm.ci.code.StackSlot; |
35 import jdk.vm.ci.code.TargetDescription; |
37 import jdk.vm.ci.code.TargetDescription; |
36 |
38 |
37 /** |
39 /** |
158 public byte[] close(boolean trimmedCopy) { |
160 public byte[] close(boolean trimmedCopy) { |
159 checkAndClearLabelsWithPatches(); |
161 checkAndClearLabelsWithPatches(); |
160 return codeBuffer.close(trimmedCopy); |
162 return codeBuffer.close(trimmedCopy); |
161 } |
163 } |
162 |
164 |
|
165 public byte[] copy(int start, int end) { |
|
166 return codeBuffer.copyData(start, end); |
|
167 } |
|
168 |
163 private void checkAndClearLabelsWithPatches() throws InternalError { |
169 private void checkAndClearLabelsWithPatches() throws InternalError { |
164 Label label = labelsWithPatches; |
170 Label label = labelsWithPatches; |
165 while (label != null) { |
171 while (label != null) { |
166 if (label.patchPositions != null) { |
172 if (label.patchPositions != null) { |
167 throw new InternalError("Label used by instructions at following offsets has not been bound: " + label.patchPositions); |
173 throw new GraalError("Label used by instructions at following offsets has not been bound: %s", label.patchPositions); |
168 } |
174 } |
169 Label next = label.nextWithPatches; |
175 Label next = label.nextWithPatches; |
170 label.nextWithPatches = null; |
176 label.nextWithPatches = null; |
171 label = next; |
177 label = next; |
172 } |
178 } |