Ejemplo n.º 1
0
 @Override
 public LLVMAddress executePointee(VirtualFrame frame) {
   LLVMAddress sourceAggr = sourceAggregate.executePointee(frame);
   LLVMAddress targetAggr = targetAggregate.executePointee(frame);
   LLVMHeap.memCopy(targetAggr, sourceAggr, sourceAggregateSize);
   return targetAggr;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 @Specialization
 public void executeVoid(
     LLVMAddress target, LLVMAddress source, long length, int align, boolean isVolatile) {
   LLVMHeap.memCopy(target, source, length, align, isVolatile);
 }