use of com.oracle.truffle.api.dsl.Specialization in project sulong by graalvm.
the class LLVMStoreVectorNode method writeVector.
@Specialization(guards = "address.isManaged()")
@ExplodeLoop
protected Object writeVector(LLVMTruffleObject address, LLVMI1Vector value, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
assert value.getLength() == vectorLength;
LLVMTruffleObject currentPtr = address;
for (int i = 0; i < vectorLength; i++) {
foreignWrite.execute(currentPtr, value.getValue(i));
currentPtr = currentPtr.increment(I1_SIZE_IN_BYTES);
}
return null;
}
use of com.oracle.truffle.api.dsl.Specialization in project sulong by graalvm.
the class LLVMStoreVectorNode method writeVector.
@Specialization(guards = "address.isManaged()")
@ExplodeLoop
protected Object writeVector(LLVMTruffleObject address, LLVMDoubleVector value, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
assert value.getLength() == vectorLength;
LLVMTruffleObject currentPtr = address;
for (int i = 0; i < vectorLength; i++) {
foreignWrite.execute(currentPtr, value.getValue(i));
currentPtr = currentPtr.increment(DOUBLE_SIZE_IN_BYTES);
}
return null;
}
use of com.oracle.truffle.api.dsl.Specialization in project sulong by graalvm.
the class LLVMStoreVectorNode method writeVector.
@Specialization(guards = "address.isManaged()")
@ExplodeLoop
protected Object writeVector(LLVMTruffleObject address, LLVMI32Vector value, @Cached("createForeignWrite()") LLVMForeignWriteNode foreignWrite) {
assert value.getLength() == vectorLength;
LLVMTruffleObject currentPtr = address;
for (int i = 0; i < vectorLength; i++) {
foreignWrite.execute(currentPtr, value.getValue(i));
currentPtr = currentPtr.increment(I32_SIZE_IN_BYTES);
}
return null;
}
use of com.oracle.truffle.api.dsl.Specialization in project TrufflePascal by Aspect26.
the class NewBuiltinNode method allocate.
@Specialization
void allocate(PointerValue pointerValue) {
Object newObject = pointerValue.getType().getDefaultValue();
HeapSlot heapSlot = PascalHeap.getInstance().allocateNewObject(newObject);
pointerValue.setHeapSlot(heapSlot);
}
use of com.oracle.truffle.api.dsl.Specialization in project TrufflePascal by Aspect26.
the class AssignToRecordField method assignPointer.
@Specialization
void assignPointer(RecordValue record, PointerValue pointer) {
PointerValue recordPointer = (PointerValue) record.getFrame().getValue(record.getSlot(this.identifier));
recordPointer.setHeapSlot(pointer.getHeapSlot());
}
Aggregations