@Override public LLVMAddress executePointee(VirtualFrame frame) { LLVMAddress sourceAggr = sourceAggregate.executePointee(frame); LLVMAddress targetAggr = targetAggregate.executePointee(frame); LLVMHeap.memCopy(targetAggr, sourceAggr, sourceAggregateSize); return targetAggr; }
public static LLVMAddress allocateCString(String string) { LLVMAddress baseAddress = LLVMHeap.allocateMemory(string.length() + 1); LLVMAddress currentAddress = baseAddress; for (int i = 0; i < string.length(); i++) { byte c = (byte) string.charAt(i); LLVMMemory.putI8(currentAddress, c); currentAddress = currentAddress.increment(1); } LLVMMemory.putI8(currentAddress, (byte) 0); return baseAddress; }
@Specialization public void executeVoid( LLVMAddress target, LLVMAddress source, long length, int align, boolean isVolatile) { LLVMHeap.memCopy(target, source, length, align, isVolatile); }