use of com.oracle.truffle.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVMTruffleExecute method doExecute.
@ExplodeLoop
private Object doExecute(VirtualFrame frame, TruffleObject value, LLVMContext context, LLVMGetStackNode getStack) {
Object[] evaluatedArgs = new Object[args.length];
for (int i = 0; i < args.length; i++) {
evaluatedArgs[i] = prepareValuesForEscape[i].executeWithTarget(args[i].executeGeneric(frame));
}
try {
LLVMStack stack = getStack.executeWithTarget(getThreadingStack(context), Thread.currentThread());
Object rawValue;
try (StackPointer save = stack.newFrame()) {
rawValue = ForeignAccess.sendExecute(foreignExecute, value, evaluatedArgs);
}
return toLLVM.executeWithTarget(rawValue);
} catch (UnsupportedMessageException | UnsupportedTypeException | ArityException e) {
CompilerDirectives.transferToInterpreter();
throw new IllegalStateException(e);
}
}
use of com.oracle.truffle.api.nodes.ExplodeLoop 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.api.nodes.ExplodeLoop in project sulong by graalvm.
the class StructLiteralNode method doLLVMAddress.
@ExplodeLoop
@Specialization
protected LLVMAddress doLLVMAddress(VirtualFrame frame, LLVMAddress address) {
for (int i = 0; i < offsets.length; i++) {
LLVMAddress 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.api.nodes.ExplodeLoop 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.api.nodes.ExplodeLoop in project sulong by graalvm.
the class LLVM80BitFloatArrayLiteralNode method write80BitFloat.
@Specialization
@ExplodeLoop
protected LLVMAddress write80BitFloat(VirtualFrame frame, LLVMAddress addr, @Cached("getLLVMMemory()") LLVMMemory memory) {
long currentPtr = addr.getVal();
for (int i = 0; i < values.length; i++) {
try {
LLVM80BitFloat currentValue = values[i].executeLLVM80BitFloat(frame);
memory.put80BitFloat(currentPtr, currentValue);
currentPtr += stride;
} catch (UnexpectedResultException e) {
CompilerDirectives.transferToInterpreter();
throw new IllegalStateException(e);
}
}
return addr;
}
Aggregations