use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMAddressArrayLiteralNode method foreignWriteRef.
// TODO: work around a DSL bug (GR-6493): remove cached int a and int b
@SuppressWarnings("unused")
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteRef(VirtualFrame frame, LLVMTruffleObject addr, @Cached("0") int a, @Cached("0") int b, @Cached("createForeignWrites()") LLVMForeignWriteNode[] foreignWrites) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
Object currentValue = values[i].execute(frame);
foreignWrites[i].execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMFloatArrayLiteralNode method foreignWriteFloat.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteFloat(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
float currentValue = LLVMTypesGen.asFloat(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMI1ArrayLiteralNode method foreignWriteI1.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteI1(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
boolean currentValue = LLVMTypesGen.asBoolean(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMI32ArrayLiteralNode method foreignWriteI32.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteI32(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
int currentValue = LLVMTypesGen.asInteger(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMI8ArrayLiteralNode method foreignWriteI8.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteI8(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
byte currentValue = LLVMTypesGen.asByte(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
Aggregations