Search in sources :

Example 1 with PointerValue

use of cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PointerValue in project TrufflePascal by Aspect26.

the class StrAllocNode method strAlloc.

@Specialization
PointerValue strAlloc(long size) {
    PCharValue pchar = new PCharValue(size);
    HeapSlot heapSlot = PascalHeap.getInstance().allocateNewObject(pchar);
    PointerValue pointer = new PointerValue(PCharDesriptor.getInstance());
    pointer.setHeapSlot(heapSlot);
    return pointer;
}
Also used : PointerValue(cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PointerValue) HeapSlot(cz.cuni.mff.d3s.trupple.language.runtime.heap.HeapSlot) PCharValue(cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PCharValue) Specialization(com.oracle.truffle.api.dsl.Specialization)

Example 2 with PointerValue

use of cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PointerValue 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());
}
Also used : PointerValue(cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PointerValue) Specialization(com.oracle.truffle.api.dsl.Specialization)

Aggregations

Specialization (com.oracle.truffle.api.dsl.Specialization)2 PointerValue (cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PointerValue)2 PCharValue (cz.cuni.mff.d3s.trupple.language.runtime.customvalues.PCharValue)1 HeapSlot (cz.cuni.mff.d3s.trupple.language.runtime.heap.HeapSlot)1