use of com.oracle.truffle.llvm.runtime.LLVMTruffleObject in project sulong by graalvm.
the class StructLiteralNode method doLLVMTruffleObject.
@ExplodeLoop
@Specialization
protected LLVMTruffleObject doLLVMTruffleObject(VirtualFrame frame, LLVMTruffleObject address) {
for (int i = 0; i < offsets.length; i++) {
LLVMTruffleObject currentAddr = address.increment(offsets[i]);
Object value = values[i] == null ? null : values[i].executeGeneric(frame);
elementWriteNodes[i].executeWithTarget(currentAddr, value);
}
return address;
}
use of com.oracle.truffle.llvm.runtime.LLVMTruffleObject in project sulong by graalvm.
the class LLVM80BitFloatArrayLiteralNode method foreignWrite.
@Specialization
@ExplodeLoop
protected LLVMTruffleObject foreignWrite(VirtualFrame frame, LLVMTruffleObject addr, @Cached("create80BitFloatStore()") LLVM80BitFloatStoreNode write) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
try {
LLVM80BitFloat currentValue = values[i].executeLLVM80BitFloat(frame);
write.executeWithTarget(addr, currentValue);
currentPtr = currentPtr.increment(stride);
} catch (UnexpectedResultException e) {
CompilerDirectives.transferToInterpreter();
throw new IllegalStateException(e);
}
}
return addr;
}
use of com.oracle.truffle.llvm.runtime.LLVMTruffleObject in project sulong by graalvm.
the class LLVMDoubleArrayLiteralNode method foreignWriteDouble.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteDouble(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
double currentValue = LLVMTypesGen.asDouble(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
use of com.oracle.truffle.llvm.runtime.LLVMTruffleObject in project sulong by graalvm.
the class LLVMFunctionArrayLiteralNode method handleTruffleObject.
@Specialization(guards = "array.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject handleTruffleObject(VirtualFrame frame, LLVMTruffleObject array, @Cached("createForeignWrites()") LLVMForeignWriteNode[] foreignWrites) {
LLVMTruffleObject currentPtr = array;
for (int i = 0; i < values.length; i++) {
try {
LLVMFunctionDescriptor currentValue = (LLVMFunctionDescriptor) values[i].executeTruffleObject(frame);
foreignWrites[i].execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
} catch (UnexpectedResultException e) {
CompilerDirectives.transferToInterpreter();
throw new IllegalStateException(e);
}
}
return array;
}
use of com.oracle.truffle.llvm.runtime.LLVMTruffleObject in project sulong by graalvm.
the class LLVMI16ArrayLiteralNode method foreignWriteI16.
@Specialization(guards = "addr.isManaged()")
@ExplodeLoop
protected LLVMTruffleObject foreignWriteI16(VirtualFrame frame, LLVMTruffleObject addr, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
LLVMTruffleObject currentPtr = addr;
for (int i = 0; i < values.length; i++) {
short currentValue = LLVMTypesGen.asShort(values[i].executeGeneric(frame));
foreignWrite.execute(currentPtr, currentValue);
currentPtr = currentPtr.increment(stride);
}
return addr;
}
Aggregations